Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply clang-format two more times to make sure we have everything formatted #918

Merged
merged 2 commits into from
Nov 13, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
164 changes: 81 additions & 83 deletions lib/mayaUsd/ufe/UsdAttributes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,89 +126,87 @@ Ufe::Attribute::Type
UsdAttributes::getUfeTypeForAttribute(const PXR_NS::UsdAttribute& usdAttr) const
{
// Map the USD type into UFE type.
static const std::
unordered_map<size_t, Ufe::Attribute::Type>
sUsdTypeToUfe {
{ SdfValueTypeNames->Bool.GetHash(), Ufe::Attribute::kBool }, // bool
// {SdfValueTypeNames->UChar.GetHash(), Ufe::Attribute::kUnknown},
//// uint8_t
{ SdfValueTypeNames->Int.GetHash(), Ufe::Attribute::kInt }, // int32_t
// {SdfValueTypeNames->UInt.GetHash(), Ufe::Attribute::kUnknown},
//// uint32_t
// {SdfValueTypeNames->Int64.GetHash(), Ufe::Attribute::kInt},
//// int64_t {SdfValueTypeNames->UInt64.GetHash(), Ufe::Attribute::kUnknown},
//// uint64_t
// {SdfValueTypeNames->Half.GetHash(), Ufe::Attribute::kUnknown},
//// GfHalf
{ SdfValueTypeNames->Float.GetHash(), Ufe::Attribute::kFloat }, // float
{ SdfValueTypeNames->Double.GetHash(), Ufe::Attribute::kDouble }, // double
{ SdfValueTypeNames->String.GetHash(), Ufe::Attribute::kString }, // std::string
{ SdfValueTypeNames->Token.GetHash(), Ufe::Attribute::kEnumString }, // TfToken
// {SdfValueTypeNames->Asset.GetHash(), Ufe::Attribute::kUnknown},
//// SdfAssetPath {SdfValueTypeNames->Int2.GetHash(), Ufe::Attribute::kInt2},
//// GfVec2i {SdfValueTypeNames->Half2.GetHash(), Ufe::Attribute::kUnknown},
//// GfVec2h {SdfValueTypeNames->Float2.GetHash(), Ufe::Attribute::kFloat2},
//// GfVec2f {SdfValueTypeNames->Double2.GetHash(), Ufe::Attribute::kDouble2},
//// GfVec2d
{ SdfValueTypeNames->Int3.GetHash(), Ufe::Attribute::kInt3 }, // GfVec3i
// {SdfValueTypeNames->Half3.GetHash(), Ufe::Attribute::kUnknown},
//// GfVec3h
{ SdfValueTypeNames->Float3.GetHash(), Ufe::Attribute::kFloat3 }, // GfVec3f
{ SdfValueTypeNames->Double3.GetHash(), Ufe::Attribute::kDouble3 }, // GfVec3d
// {SdfValueTypeNames->Int4.GetHash(), Ufe::Attribute::kInt4},
//// GfVec4i {SdfValueTypeNames->Half4.GetHash(), Ufe::Attribute::kUnknown},
//// GfVec4h {SdfValueTypeNames->Float4.GetHash(), Ufe::Attribute::kFloat4},
//// GfVec4f {SdfValueTypeNames->Double4.GetHash(), Ufe::Attribute::kDouble4},
//// GfVec4d {SdfValueTypeNames->Point3h.GetHash(), Ufe::Attribute::kUnknown},
//// GfVec3h {SdfValueTypeNames->Point3f.GetHash(), Ufe::Attribute::kUnknown},
//// GfVec3f {SdfValueTypeNames->Point3d.GetHash(), Ufe::Attribute::kUnknown},
//// GfVec3d {SdfValueTypeNames->Vector3h.GetHash(), Ufe::Attribute::kUnknown},
//// GfVec3h {SdfValueTypeNames->Vector3f.GetHash(), Ufe::Attribute::kUnknown},
//// GfVec3f {SdfValueTypeNames->Vector3d.GetHash(), Ufe::Attribute::kUnknown},
//// GfVec3d {SdfValueTypeNames->Normal3h.GetHash(), Ufe::Attribute::kUnknown},
//// GfVec3h {SdfValueTypeNames->Normal3f.GetHash(), Ufe::Attribute::kUnknown},
//// GfVec3f {SdfValueTypeNames->Normal3d.GetHash(), Ufe::Attribute::kUnknown},
//// GfVec3d {SdfValueTypeNames->Color3h.GetHash(), Ufe::Attribute::kUnknown},
//// GfVec3h
{ SdfValueTypeNames->Color3f.GetHash(), Ufe::Attribute::kColorFloat3 }, // GfVec3f
{ SdfValueTypeNames->Color3d.GetHash(), Ufe::Attribute::kColorFloat3 }, // GfVec3d
// {SdfValueTypeNames->Color4h.GetHash(), Ufe::Attribute::kUnknown},
//// GfVec4h {SdfValueTypeNames->Color4f.GetHash(), Ufe::Attribute::kUnknown},
//// GfVec4f {SdfValueTypeNames->Color4d.GetHash(), Ufe::Attribute::kUnknown},
//// GfVec4d {SdfValueTypeNames->Quath.GetHash(), Ufe::Attribute::kUnknown},
//// GfQuath {SdfValueTypeNames->Quatf.GetHash(), Ufe::Attribute::kUnknown},
//// GfQuatf {SdfValueTypeNames->Quatd.GetHash(), Ufe::Attribute::kUnknown},
//// GfQuatd {SdfValueTypeNames->Matrix2d.GetHash(), Ufe::Attribute::kUnknown},
//// GfMatrix2d {SdfValueTypeNames->Matrix3d.GetHash(), Ufe::Attribute::kUnknown},
//// GfMatrix3d {SdfValueTypeNames->Matrix4d.GetHash(), Ufe::Attribute::kUnknown},
//// GfMatrix4d {SdfValueTypeNames->Frame4d.GetHash(), Ufe::Attribute::kUnknown},
//// GfMatrix4d {SdfValueTypeNames->TexCoord2f.GetHash(), Ufe::Attribute::kUnknown},
//// GfVec2f {SdfValueTypeNames->TexCoord2d.GetHash(), Ufe::Attribute::kUnknown},
//// GfVec2d {SdfValueTypeNames->TexCoord2h.GetHash(), Ufe::Attribute::kUnknown},
//// GfVec2h {SdfValueTypeNames->TexCoord3f.GetHash(), Ufe::Attribute::kUnknown},
//// GfVec3f {SdfValueTypeNames->TexCoord3d.GetHash(), Ufe::Attribute::kUnknown},
//// GfVec3d {SdfValueTypeNames->TexCoord3h.GetHash(), Ufe::Attribute::kUnknown},
//// GfVec3h
// To add?
// SdfValueTypeName BoolArray;
// SdfValueTypeName UCharArray, IntArray, UIntArray, Int64Array, UInt64Array;
// SdfValueTypeName HalfArray, FloatArray, DoubleArray;
// SdfValueTypeName StringArray, TokenArray, AssetArray;
// SdfValueTypeName Int2Array, Int3Array, Int4Array;
// SdfValueTypeName Half2Array, Half3Array, Half4Array;
// SdfValueTypeName Float2Array, Float3Array, Float4Array;
// SdfValueTypeName Double2Array, Double3Array, Double4Array;
// SdfValueTypeName Point3hArray, Point3fArray, Point3dArray;
// SdfValueTypeName Vector3hArray, Vector3fArray, Vector3dArray;
// SdfValueTypeName Normal3hArray, Normal3fArray, Normal3dArray;
// SdfValueTypeName Color3hArray, Color3fArray, Color3dArray;
// SdfValueTypeName Color4hArray, Color4fArray, Color4dArray;
// SdfValueTypeName QuathArray, QuatfArray, QuatdArray;
// SdfValueTypeName Matrix2dArray, Matrix3dArray, Matrix4dArray;
// SdfValueTypeName Frame4dArray;
// SdfValueTypeName TexCoord2hArray, TexCoord2fArray, TexCoord2dArray;
// SdfValueTypeName TexCoord3hArray, TexCoord3fArray, TexCoord3dArray;
};
static const std::unordered_map<size_t, Ufe::Attribute::Type> sUsdTypeToUfe {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really hate this formatting and this make it impossible to read. Can you please revert this map back to its original state before the first clang-format was applied. Then you can manually change the tabs to spaces. And add in the clang-format off/on comment so this block will remain unchanged by clang-format.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed dead code and fixed based on our discussion.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much better, thanks.

{ SdfValueTypeNames->Bool.GetHash(), Ufe::Attribute::kBool }, // bool
// {SdfValueTypeNames->UChar.GetHash(), Ufe::Attribute::kUnknown},
//// uint8_t
{ SdfValueTypeNames->Int.GetHash(), Ufe::Attribute::kInt }, // int32_t
// {SdfValueTypeNames->UInt.GetHash(), Ufe::Attribute::kUnknown},
//// uint32_t
// {SdfValueTypeNames->Int64.GetHash(), Ufe::Attribute::kInt},
//// int64_t {SdfValueTypeNames->UInt64.GetHash(),
/// Ufe::Attribute::kUnknown}, / uint64_t
// {SdfValueTypeNames->Half.GetHash(), Ufe::Attribute::kUnknown},
//// GfHalf
{ SdfValueTypeNames->Float.GetHash(), Ufe::Attribute::kFloat }, // float
{ SdfValueTypeNames->Double.GetHash(), Ufe::Attribute::kDouble }, // double
{ SdfValueTypeNames->String.GetHash(), Ufe::Attribute::kString }, // std::string
{ SdfValueTypeNames->Token.GetHash(), Ufe::Attribute::kEnumString }, // TfToken
// {SdfValueTypeNames->Asset.GetHash(), Ufe::Attribute::kUnknown},
//// SdfAssetPath {SdfValueTypeNames->Int2.GetHash(), Ufe::Attribute::kInt2},
//// GfVec2i {SdfValueTypeNames->Half2.GetHash(),
/// Ufe::Attribute::kUnknown}, / GfVec2h {SdfValueTypeNames->Float2.GetHash(),
/// Ufe::Attribute::kFloat2}, / GfVec2f {SdfValueTypeNames->Double2.GetHash(),
/// Ufe::Attribute::kDouble2}, / GfVec2d
{ SdfValueTypeNames->Int3.GetHash(), Ufe::Attribute::kInt3 }, // GfVec3i
// {SdfValueTypeNames->Half3.GetHash(), Ufe::Attribute::kUnknown},
//// GfVec3h
{ SdfValueTypeNames->Float3.GetHash(), Ufe::Attribute::kFloat3 }, // GfVec3f
{ SdfValueTypeNames->Double3.GetHash(), Ufe::Attribute::kDouble3 }, // GfVec3d
// {SdfValueTypeNames->Int4.GetHash(), Ufe::Attribute::kInt4},
//// GfVec4i {SdfValueTypeNames->Half4.GetHash(),
/// Ufe::Attribute::kUnknown}, / GfVec4h {SdfValueTypeNames->Float4.GetHash(),
/// Ufe::Attribute::kFloat4}, / GfVec4f {SdfValueTypeNames->Double4.GetHash(),
/// Ufe::Attribute::kDouble4}, / GfVec4d {SdfValueTypeNames->Point3h.GetHash(),
/// Ufe::Attribute::kUnknown}, / GfVec3h {SdfValueTypeNames->Point3f.GetHash(),
/// Ufe::Attribute::kUnknown}, / GfVec3f {SdfValueTypeNames->Point3d.GetHash(),
/// Ufe::Attribute::kUnknown}, / GfVec3d
///{SdfValueTypeNames->Vector3h.GetHash(), Ufe::Attribute::kUnknown}, / GfVec3h
///{SdfValueTypeNames->Vector3f.GetHash(), Ufe::Attribute::kUnknown}, / GfVec3f
///{SdfValueTypeNames->Vector3d.GetHash(), Ufe::Attribute::kUnknown}, / GfVec3d
///{SdfValueTypeNames->Normal3h.GetHash(), Ufe::Attribute::kUnknown}, / GfVec3h
///{SdfValueTypeNames->Normal3f.GetHash(), Ufe::Attribute::kUnknown}, / GfVec3f
///{SdfValueTypeNames->Normal3d.GetHash(), Ufe::Attribute::kUnknown}, / GfVec3d
///{SdfValueTypeNames->Color3h.GetHash(), Ufe::Attribute::kUnknown}, / GfVec3h
{ SdfValueTypeNames->Color3f.GetHash(), Ufe::Attribute::kColorFloat3 }, // GfVec3f
{ SdfValueTypeNames->Color3d.GetHash(), Ufe::Attribute::kColorFloat3 }, // GfVec3d
// {SdfValueTypeNames->Color4h.GetHash(), Ufe::Attribute::kUnknown},
//// GfVec4h {SdfValueTypeNames->Color4f.GetHash(),
/// Ufe::Attribute::kUnknown}, / GfVec4f {SdfValueTypeNames->Color4d.GetHash(),
/// Ufe::Attribute::kUnknown}, / GfVec4d {SdfValueTypeNames->Quath.GetHash(),
/// Ufe::Attribute::kUnknown}, / GfQuath {SdfValueTypeNames->Quatf.GetHash(),
/// Ufe::Attribute::kUnknown}, / GfQuatf {SdfValueTypeNames->Quatd.GetHash(),
/// Ufe::Attribute::kUnknown}, / GfQuatd
///{SdfValueTypeNames->Matrix2d.GetHash(), Ufe::Attribute::kUnknown}, / GfMatrix2d
///{SdfValueTypeNames->Matrix3d.GetHash(), Ufe::Attribute::kUnknown}, / GfMatrix3d
///{SdfValueTypeNames->Matrix4d.GetHash(), Ufe::Attribute::kUnknown}, / GfMatrix4d
///{SdfValueTypeNames->Frame4d.GetHash(), Ufe::Attribute::kUnknown}, / GfMatrix4d
///{SdfValueTypeNames->TexCoord2f.GetHash(), Ufe::Attribute::kUnknown}, / GfVec2f
///{SdfValueTypeNames->TexCoord2d.GetHash(), Ufe::Attribute::kUnknown}, / GfVec2d
///{SdfValueTypeNames->TexCoord2h.GetHash(), Ufe::Attribute::kUnknown}, / GfVec2h
///{SdfValueTypeNames->TexCoord3f.GetHash(), Ufe::Attribute::kUnknown}, / GfVec3f
///{SdfValueTypeNames->TexCoord3d.GetHash(), Ufe::Attribute::kUnknown}, / GfVec3d
///{SdfValueTypeNames->TexCoord3h.GetHash(), Ufe::Attribute::kUnknown}, / GfVec3h
// To add?
// SdfValueTypeName BoolArray;
// SdfValueTypeName UCharArray, IntArray, UIntArray, Int64Array, UInt64Array;
// SdfValueTypeName HalfArray, FloatArray, DoubleArray;
// SdfValueTypeName StringArray, TokenArray, AssetArray;
// SdfValueTypeName Int2Array, Int3Array, Int4Array;
// SdfValueTypeName Half2Array, Half3Array, Half4Array;
// SdfValueTypeName Float2Array, Float3Array, Float4Array;
// SdfValueTypeName Double2Array, Double3Array, Double4Array;
// SdfValueTypeName Point3hArray, Point3fArray, Point3dArray;
// SdfValueTypeName Vector3hArray, Vector3fArray, Vector3dArray;
// SdfValueTypeName Normal3hArray, Normal3fArray, Normal3dArray;
// SdfValueTypeName Color3hArray, Color3fArray, Color3dArray;
// SdfValueTypeName Color4hArray, Color4fArray, Color4dArray;
// SdfValueTypeName QuathArray, QuatfArray, QuatdArray;
// SdfValueTypeName Matrix2dArray, Matrix3dArray, Matrix4dArray;
// SdfValueTypeName Frame4dArray;
// SdfValueTypeName TexCoord2hArray, TexCoord2fArray, TexCoord2dArray;
// SdfValueTypeName TexCoord3hArray, TexCoord3fArray, TexCoord3dArray;
};

if (usdAttr.IsValid()) {
const PXR_NS::SdfValueTypeName typeName = usdAttr.GetTypeName();
Expand Down
77 changes: 44 additions & 33 deletions plugin/al/mayautils/AL/maya/event/MayaEventManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -878,37 +878,42 @@ void MayaEventHandler::initDagMessage(MayaCallbackInfo& cbi)
case DagMessage::kParentAdded:
cbi.mayaCallback = MDagMessage::addParentAddedCallback(bindParentChildFunction, &cbi);
break;
case DagMessage::kParentAddedDagPath: /* cbi.mayaCallback =
MDagMessage::addParentAddedDagPathCallback(bindNodeStringBoolFunc,
&cbi); */
case DagMessage::
kParentAddedDagPath: /* cbi.mayaCallback =
MDagMessage::addParentAddedDagPathCallback(bindNodeStringBoolFunc,
&cbi); */
break;
case DagMessage::kParentRemoved:
cbi.mayaCallback = MDagMessage::addParentRemovedCallback(bindParentChildFunction, &cbi);
break;
case DagMessage::kParentRemovedDagPath: /* cbi.mayaCallback =
MDagMessage::addParentRemovedDagPathCallback(bindNodeStringBoolFunc,
&cbi); */
case DagMessage::
kParentRemovedDagPath: /* cbi.mayaCallback =
MDagMessage::addParentRemovedDagPathCallback(bindNodeStringBoolFunc,
&cbi); */
break;
case DagMessage::kChildAdded:
cbi.mayaCallback = MDagMessage::addChildAddedCallback(bindParentChildFunction, &cbi);
break;
case DagMessage::kChildAddedDagPath: /* cbi.mayaCallback =
MContainerMessage::addChildAddedDagPathCallback(bindNodeStringBoolFunc,
&cbi); */
case DagMessage::
kChildAddedDagPath: /* cbi.mayaCallback =
MContainerMessage::addChildAddedDagPathCallback(bindNodeStringBoolFunc,
&cbi); */
break;
case DagMessage::kChildRemoved:
cbi.mayaCallback = MDagMessage::addChildRemovedCallback(bindParentChildFunction, &cbi);
break;
case DagMessage::kChildRemovedDagPath: /* cbi.mayaCallback =
MDagMessage::addChildRemovedDagPathCallback(bindNodeStringBoolFunc,
&cbi); */
case DagMessage::
kChildRemovedDagPath: /* cbi.mayaCallback =
MDagMessage::addChildRemovedDagPathCallback(bindNodeStringBoolFunc,
&cbi); */
break;
case DagMessage::kChildReordered:
cbi.mayaCallback = MDagMessage::addChildReorderedCallback(bindParentChildFunction, &cbi);
break;
case DagMessage::kChildReorderedDagPath: /* cbi.mayaCallback =
MDagMessage::addChildReorderedDagPathCallback(bindNodeStringBoolFunc,
&cbi); */
case DagMessage::
kChildReorderedDagPath: /* cbi.mayaCallback =
MDagMessage::addChildReorderedDagPathCallback(bindNodeStringBoolFunc,
&cbi); */
break;
case DagMessage::kDag: /* cbi.mayaCallback =
MDagMessage::addDagCallback(bindMessageParentChildFunction, &cbi); */
Expand All @@ -921,27 +926,31 @@ void MayaEventHandler::initDagMessage(MayaCallbackInfo& cbi)
cbi.mayaCallback
= MDagMessage::addAllDagChangesCallback(bindMessageParentChildFunction, &cbi);
break;
case DagMessage::kAllDagChangesDagPath: /* cbi.mayaCallback =
MDagMessage::addAllDagChangesDagPathCallback(bindNodeStringBoolFunc,
&cbi); */
case DagMessage::
kAllDagChangesDagPath: /* cbi.mayaCallback =
MDagMessage::addAllDagChangesDagPathCallback(bindNodeStringBoolFunc,
&cbi); */
break;
case DagMessage::kInstanceAdded:
cbi.mayaCallback = MDagMessage::addInstanceAddedCallback(bindParentChildFunction, &cbi);
break;
case DagMessage::kInstanceAddedDagPath: /* cbi.mayaCallback =
MDagMessage::addInstanceAddedDagPathCallback(bindNodeStringBoolFunc,
&cbi); */
case DagMessage::
kInstanceAddedDagPath: /* cbi.mayaCallback =
MDagMessage::addInstanceAddedDagPathCallback(bindNodeStringBoolFunc,
&cbi); */
break;
case DagMessage::kInstanceRemoved:
cbi.mayaCallback = MDagMessage::addInstanceRemovedCallback(bindParentChildFunction, &cbi);
break;
case DagMessage::kInstanceRemovedDagPath: /* cbi.mayaCallback =
MDagMessage::addInstanceRemovedDagPathCallback(bindNodeStringBoolFunc,
&cbi); */
case DagMessage::
kInstanceRemovedDagPath: /* cbi.mayaCallback =
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is pretty ugly...wasn't expecting clang-format to break it this way. Must have something to do with commented code after.

Something to remember and revisit eventually.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not put it back to what it was before and use the clang-format off/on comment?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't want developers to have to fallback to disabling clang-format in too many cases. We will update clang-format version at one point. This will be a good opportunity to revising some of the clang-format settings and prevent this type of formatting.

For that reason, I'm not going to use the clang-format off/on comment.

MDagMessage::addInstanceRemovedDagPathCallback(bindNodeStringBoolFunc,
&cbi); */
break;
case DagMessage::kWorldMatrixModified: /* cbi.mayaCallback =
MDagMessage::addWorldMatrixModifiedCallback(bindNodeStringBoolFunc,
&cbi); */
case DagMessage::
kWorldMatrixModified: /* cbi.mayaCallback =
MDagMessage::addWorldMatrixModifiedCallback(bindNodeStringBoolFunc,
&cbi); */
break;
default: break;
}
Expand Down Expand Up @@ -1143,13 +1152,15 @@ void MayaEventHandler::initModelMessage(MayaCallbackInfo& cbi)
case ModelMessage::kAfterDuplicate:
cbi.mayaCallback = MModelMessage::addAfterDuplicateCallback(bindBasicFunction, &cbi);
break;
case ModelMessage::kNodeAddedToModel: /* cbi.mayaCallback =
MModelMessage::addNodeAddedToModelCallback(bindTimeFunction,
&cbi); */
case ModelMessage::
kNodeAddedToModel: /* cbi.mayaCallback =
MModelMessage::addNodeAddedToModelCallback(bindTimeFunction,
&cbi); */
break;
case ModelMessage::kNodeRemovedFromModel: /* cbi.mayaCallback =
MModelMessage::addNodeRemovedFromModelCallback(bindTimeFunction,
&cbi); */
case ModelMessage::
kNodeRemovedFromModel: /* cbi.mayaCallback =
MModelMessage::addNodeRemovedFromModelCallback(bindTimeFunction,
&cbi); */
break;
default: break;
}
Expand Down
Loading