From cf25153d6d67f0c97427cd7d6fa0a8d5cc47d3a9 Mon Sep 17 00:00:00 2001 From: Krystian Ligenza Date: Wed, 30 Sep 2020 20:46:48 -0400 Subject: [PATCH 1/3] Fixes required before applying clang-format --- .../AL/usdmaya/fileio/ExportTranslator.h | 1 + .../AL/usdmaya/nodes/ProxyDrawOverride.h | 2 + .../lib/AL_USDMaya/AL/usdmaya/nodes/Scope.h | 2 + plugin/al/translators/Mesh.h | 68 ++++++++++--------- plugin/al/translators/NurbsCurve.h | 9 ++- 5 files changed, 50 insertions(+), 32 deletions(-) diff --git a/plugin/al/lib/AL_USDMaya/AL/usdmaya/fileio/ExportTranslator.h b/plugin/al/lib/AL_USDMaya/AL/usdmaya/fileio/ExportTranslator.h index cd24edc867..d501c8cdfc 100644 --- a/plugin/al/lib/AL_USDMaya/AL/usdmaya/fileio/ExportTranslator.h +++ b/plugin/al/lib/AL_USDMaya/AL/usdmaya/fileio/ExportTranslator.h @@ -18,6 +18,7 @@ #include #include #include +#include namespace AL { namespace usdmaya { diff --git a/plugin/al/lib/AL_USDMaya/AL/usdmaya/nodes/ProxyDrawOverride.h b/plugin/al/lib/AL_USDMaya/AL/usdmaya/nodes/ProxyDrawOverride.h index 4f252010f1..c7dd8b72cb 100644 --- a/plugin/al/lib/AL_USDMaya/AL/usdmaya/nodes/ProxyDrawOverride.h +++ b/plugin/al/lib/AL_USDMaya/AL/usdmaya/nodes/ProxyDrawOverride.h @@ -28,6 +28,8 @@ namespace AL { namespace usdmaya { namespace nodes { +class ProxyShape; + //---------------------------------------------------------------------------------------------------------------------- /// \brief This class provides the draw override for the USD proxy shape node. /// \ingroup nodes diff --git a/plugin/al/lib/AL_USDMaya/AL/usdmaya/nodes/Scope.h b/plugin/al/lib/AL_USDMaya/AL/usdmaya/nodes/Scope.h index b17fd9bd78..69762ce8d4 100644 --- a/plugin/al/lib/AL_USDMaya/AL/usdmaya/nodes/Scope.h +++ b/plugin/al/lib/AL_USDMaya/AL/usdmaya/nodes/Scope.h @@ -15,7 +15,9 @@ // #pragma once +#include "AL/maya/utils/MayaHelperMacros.h" #include "AL/maya/utils/NodeHelper.h" +#include "AL/usdmaya/TypeIDs.h" #include #include diff --git a/plugin/al/translators/Mesh.h b/plugin/al/translators/Mesh.h index 99b98ed320..9c23c395f1 100644 --- a/plugin/al/translators/Mesh.h +++ b/plugin/al/translators/Mesh.h @@ -17,47 +17,54 @@ #pragma once #include "AL/usdmaya/fileio/translators/TranslatorBase.h" +PXR_NAMESPACE_OPEN_SCOPE -namespace AL{ -namespace usdmaya{ -namespace fileio{ -namespace translators{ +// forward declare usd types +class UsdGeomMesh; + +PXR_NAMESPACE_CLOSE_SCOPE + +namespace AL { +namespace usdmaya { +namespace fileio { +namespace translators { //---------------------------------------------------------------------------------------------------------------------- /// \brief Class to translate a mesh in and out of maya. //---------------------------------------------------------------------------------------------------------------------- -class Mesh : public TranslatorBase -{ +class Mesh : public TranslatorBase { public: - AL_USDMAYA_DECLARE_TRANSLATOR(Mesh); + AL_USDMAYA_DECLARE_TRANSLATOR(Mesh); + private: - MStatus initialize() override; - MStatus import(const UsdPrim& prim, MObject& parent, MObject& createdObj) override; - UsdPrim exportObject(UsdStageRefPtr stage, MDagPath dagPath, const SdfPath& usdPath, - const ExporterParams& params) override; - MStatus tearDown(const SdfPath& path) override; - MStatus update(const UsdPrim& path) override; - MStatus preTearDown(UsdPrim& prim) override; + MStatus initialize() override; + MStatus import(const UsdPrim& prim, MObject& parent, MObject& createdObj) override; + UsdPrim exportObject( + UsdStageRefPtr stage, + MDagPath dagPath, + const SdfPath& usdPath, + const ExporterParams& params) override; + MStatus tearDown(const SdfPath& path) override; + MStatus update(const UsdPrim& path) override; + MStatus preTearDown(UsdPrim& prim) override; - bool supportsUpdate() const override - { return false; } // Turned off supportsUpdate to get tearDown working correctly - bool importableByDefault() const override - { return false; } + bool supportsUpdate() const override + { + return false; + } // Turned off supportsUpdate to get tearDown working correctly + bool importableByDefault() const override { return false; } - ExportFlag canExport(const MObject& obj) override - { return obj.hasFn(MFn::kMesh) ? ExportFlag::kFallbackSupport : ExportFlag::kNotSupported; } - bool canBeOverridden() override - { return true; } + ExportFlag canExport(const MObject& obj) override + { + return obj.hasFn(MFn::kMesh) ? ExportFlag::kFallbackSupport : ExportFlag::kNotSupported; + } + bool canBeOverridden() override { return true; } private: - enum WriteOptions - { - kPerformDiff = 1 << 0, - kDynamicAttributes = 1 << 1 - }; - void writeEdits(MDagPath& dagPath, UsdGeomMesh& geomPrim, uint32_t options = kDynamicAttributes); - static MObject m_visible; - + enum WriteOptions { kPerformDiff = 1 << 0, kDynamicAttributes = 1 << 1 }; + void + writeEdits(MDagPath& dagPath, PXR_NS::UsdGeomMesh& geomPrim, uint32_t options = kDynamicAttributes); + static MObject m_visible; }; //---------------------------------------------------------------------------------------------------------------------- @@ -66,4 +73,3 @@ class Mesh : public TranslatorBase } // namespace usdmaya } // namespace AL //---------------------------------------------------------------------------------------------------------------------- - diff --git a/plugin/al/translators/NurbsCurve.h b/plugin/al/translators/NurbsCurve.h index af267a0f45..62c6837460 100644 --- a/plugin/al/translators/NurbsCurve.h +++ b/plugin/al/translators/NurbsCurve.h @@ -17,6 +17,13 @@ #pragma once #include "AL/usdmaya/fileio/translators/TranslatorBase.h" +PXR_NAMESPACE_OPEN_SCOPE + +// forward declare usd types +class UsdGeomNurbsCurves; + +PXR_NAMESPACE_CLOSE_SCOPE + namespace AL { namespace usdmaya { namespace fileio { @@ -49,7 +56,7 @@ class NurbsCurve : public TranslatorBase { return true; } private: - void writeEdits(UsdGeomNurbsCurves& nurbsCurvesPrim, MFnNurbsCurve& fnCurve, bool writeAll); + void writeEdits(PXR_NS::UsdGeomNurbsCurves& nurbsCurvesPrim, MFnNurbsCurve& fnCurve, bool writeAll); static MObject m_visible; }; From 3ab02ea9b41b8f6c4547c3dee6e5ea2445933cbc Mon Sep 17 00:00:00 2001 From: Krystian Ligenza Date: Wed, 30 Sep 2020 20:52:02 -0400 Subject: [PATCH 2/3] Add rule for glew --- .clang-format | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.clang-format b/.clang-format index 9ade1d180e..9b9e5ed287 100644 --- a/.clang-format +++ b/.clang-format @@ -25,6 +25,7 @@ IncludeBlocks: Regroup IncludeCategories: # Desired final ordering: + # 0. Glew must be included before any other GL header # 1. Related header # 2. All private headers # 3. All public headers from this repository (maya-usd) @@ -35,6 +36,11 @@ IncludeCategories: # 8. C system headers # 9. Conditional includes + # 0. Glew must be included before any other GL header + # Negative priority puts it above the default IncludeIsMainRegex + - Regex: '' + Priority: -1 + # 1. Related header # Handled by the default IncludeIsMainRegex regex, and auto-assigned # Priority 0 From 4b05960766acb5307821522501106d7d67bca001 Mon Sep 17 00:00:00 2001 From: Krystian Ligenza Date: Wed, 30 Sep 2020 21:07:28 -0400 Subject: [PATCH 3/3] Reverted formatting change in Mesh.h --- plugin/al/translators/Mesh.h | 62 ++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/plugin/al/translators/Mesh.h b/plugin/al/translators/Mesh.h index 9c23c395f1..9ecaf612c8 100644 --- a/plugin/al/translators/Mesh.h +++ b/plugin/al/translators/Mesh.h @@ -24,47 +24,46 @@ class UsdGeomMesh; PXR_NAMESPACE_CLOSE_SCOPE -namespace AL { -namespace usdmaya { -namespace fileio { -namespace translators { +namespace AL{ +namespace usdmaya{ +namespace fileio{ +namespace translators{ //---------------------------------------------------------------------------------------------------------------------- /// \brief Class to translate a mesh in and out of maya. //---------------------------------------------------------------------------------------------------------------------- -class Mesh : public TranslatorBase { +class Mesh : public TranslatorBase +{ public: - AL_USDMAYA_DECLARE_TRANSLATOR(Mesh); - + AL_USDMAYA_DECLARE_TRANSLATOR(Mesh); private: - MStatus initialize() override; - MStatus import(const UsdPrim& prim, MObject& parent, MObject& createdObj) override; - UsdPrim exportObject( - UsdStageRefPtr stage, - MDagPath dagPath, - const SdfPath& usdPath, - const ExporterParams& params) override; - MStatus tearDown(const SdfPath& path) override; - MStatus update(const UsdPrim& path) override; - MStatus preTearDown(UsdPrim& prim) override; + MStatus initialize() override; + MStatus import(const UsdPrim& prim, MObject& parent, MObject& createdObj) override; + UsdPrim exportObject(UsdStageRefPtr stage, MDagPath dagPath, const SdfPath& usdPath, + const ExporterParams& params) override; + MStatus tearDown(const SdfPath& path) override; + MStatus update(const UsdPrim& path) override; + MStatus preTearDown(UsdPrim& prim) override; - bool supportsUpdate() const override - { - return false; - } // Turned off supportsUpdate to get tearDown working correctly - bool importableByDefault() const override { return false; } + bool supportsUpdate() const override + { return false; } // Turned off supportsUpdate to get tearDown working correctly + bool importableByDefault() const override + { return false; } - ExportFlag canExport(const MObject& obj) override - { - return obj.hasFn(MFn::kMesh) ? ExportFlag::kFallbackSupport : ExportFlag::kNotSupported; - } - bool canBeOverridden() override { return true; } + ExportFlag canExport(const MObject& obj) override + { return obj.hasFn(MFn::kMesh) ? ExportFlag::kFallbackSupport : ExportFlag::kNotSupported; } + bool canBeOverridden() override + { return true; } private: - enum WriteOptions { kPerformDiff = 1 << 0, kDynamicAttributes = 1 << 1 }; - void - writeEdits(MDagPath& dagPath, PXR_NS::UsdGeomMesh& geomPrim, uint32_t options = kDynamicAttributes); - static MObject m_visible; + enum WriteOptions + { + kPerformDiff = 1 << 0, + kDynamicAttributes = 1 << 1 + }; + void writeEdits(MDagPath& dagPath, PXR_NS::UsdGeomMesh& geomPrim, uint32_t options = kDynamicAttributes); + static MObject m_visible; + }; //---------------------------------------------------------------------------------------------------------------------- @@ -73,3 +72,4 @@ class Mesh : public TranslatorBase { } // namespace usdmaya } // namespace AL //---------------------------------------------------------------------------------------------------------------------- +