From c35855050166920ad0b2f6bdc223fa56cd135fae Mon Sep 17 00:00:00 2001 From: Hamed Sabri Date: Mon, 20 Jul 2020 14:25:18 -0400 Subject: [PATCH 1/6] Clean up member variable names, header orders, etc.. according to guideline. --- lib/mayaUsd/ufe/UsdUndoInsertChildCommand.cpp | 90 +++++++++---------- lib/mayaUsd/ufe/UsdUndoInsertChildCommand.h | 45 +++++----- 2 files changed, 68 insertions(+), 67 deletions(-) diff --git a/lib/mayaUsd/ufe/UsdUndoInsertChildCommand.cpp b/lib/mayaUsd/ufe/UsdUndoInsertChildCommand.cpp index 6db2b79dbf..e2df0b2b39 100644 --- a/lib/mayaUsd/ufe/UsdUndoInsertChildCommand.cpp +++ b/lib/mayaUsd/ufe/UsdUndoInsertChildCommand.cpp @@ -15,12 +15,20 @@ // #include "UsdUndoInsertChildCommand.h" -#include "Utils.h" #include "private/InPathChange.h" +#include "Utils.h" +#include #include #include -#include + +#include +#include +#include +#include + +#include + #ifdef UFE_V2_FEATURES_AVAILABLE #define UFE_ENABLE_ASSERTS #include @@ -28,13 +36,6 @@ #include #endif -#include - -#include -#include -#include -#include - namespace { // shared_ptr requires public ctor, dtor, so derive a class for it. template @@ -50,46 +51,46 @@ struct MakeSharedEnabler : public T { MAYAUSD_NS_DEF { namespace ufe { -UsdUndoInsertChildCommand::UsdUndoInsertChildCommand( - const UsdSceneItem::Ptr& parent, - const UsdSceneItem::Ptr& child, - const UsdSceneItem::Ptr& /* pos */ -) : Ufe::UndoableCommand() +UsdUndoInsertChildCommand::UsdUndoInsertChildCommand(const UsdSceneItem::Ptr& parent, + const UsdSceneItem::Ptr& child, + const UsdSceneItem::Ptr& /* pos */) + : Ufe::UndoableCommand() + , _ufeSrcItem(child) + , _stage(child->prim().GetStage()) + , _usdSrcPath(child->prim().GetPath()) { + const auto& childPrim = child->prim(); + const auto& parentPrim = parent->prim(); + // First, check if we need to rename the child. - auto childName = uniqueChildName(parent, child->path()); + const auto& childName = uniqueChildName(parent, child->path()); - // Set up all paths to perform the reparent. - auto childPrim = child->prim(); - fStage = childPrim.GetStage(); - fUfeSrcItem = child; - fUsdSrcPath = childPrim.GetPath(); // Create a new segment if parent and child are in different run-times. + // parenting a USD node to the proxy shape node implies two different run-times auto cRtId = child->path().runTimeId(); if (parent->path().runTimeId() == cRtId) { - fUfeDstPath = parent->path() + childName; + _ufeDstPath = parent->path() + childName; } else { auto cSep = child->path().getSegments().back().separator(); - fUfeDstPath = parent->path() + Ufe::PathSegment( + _ufeDstPath = parent->path() + Ufe::PathSegment( Ufe::PathComponent(childName), cRtId, cSep); } - fUsdDstPath = parent->prim().GetPath().AppendChild(TfToken(childName)); + _usdDstPath = parent->prim().GetPath().AppendChild(TfToken(childName)); - fChildLayer = MayaUsdUtils::defPrimSpecLayer(childPrim); - if (!fChildLayer) { + _childLayer = MayaUsdUtils::defPrimSpecLayer(childPrim); + if (!_childLayer) { std::string err = TfStringPrintf("No child prim found at %s", childPrim.GetPath().GetString().c_str()); throw std::runtime_error(err.c_str()); } - auto parentPrim = parent->prim(); // If parent prim is the pseudo-root, no def primSpec will be found, so // just use the edit target layer. - fParentLayer = parentPrim.IsPseudoRoot() ? - fStage->GetEditTarget().GetLayer() : + _parentLayer = parentPrim.IsPseudoRoot() ? + _stage->GetEditTarget().GetLayer() : MayaUsdUtils::defPrimSpecLayer(parentPrim); - if (!fParentLayer) { + if (!_parentLayer) { std::string err = TfStringPrintf("No parent prim found at %s", parentPrim.GetPath().GetString().c_str()); throw std::runtime_error(err.c_str()); } @@ -100,11 +101,10 @@ UsdUndoInsertChildCommand::~UsdUndoInsertChildCommand() } /*static*/ -UsdUndoInsertChildCommand::Ptr UsdUndoInsertChildCommand::create( - const UsdSceneItem::Ptr& parent, - const UsdSceneItem::Ptr& child, - const UsdSceneItem::Ptr& pos -) +UsdUndoInsertChildCommand::Ptr +UsdUndoInsertChildCommand::create(const UsdSceneItem::Ptr& parent, + const UsdSceneItem::Ptr& child, + const UsdSceneItem::Ptr& pos) { // Error if requested parent is currently a child of requested child. if (parent->path().startsWith(child->path())) { @@ -117,10 +117,10 @@ UsdUndoInsertChildCommand::Ptr UsdUndoInsertChildCommand::create( bool UsdUndoInsertChildCommand::insertChildRedo() { // See comments in UsdUndoRenameCommand.cpp. - bool status = SdfCopySpec(fChildLayer, fUsdSrcPath, fParentLayer, fUsdDstPath); + bool status = SdfCopySpec(_childLayer, _usdSrcPath, _parentLayer, _usdDstPath); if (status) { - auto srcPrim = fStage->GetPrimAtPath(fUsdSrcPath); + auto srcPrim = _stage->GetPrimAtPath(_usdSrcPath); #ifdef UFE_V2_FEATURES_AVAILABLE UFE_ASSERT_MSG(srcPrim, "Invalid prim cannot be inactivated."); #else @@ -129,14 +129,14 @@ bool UsdUndoInsertChildCommand::insertChildRedo() status = srcPrim.SetActive(false); if (status) { - fUfeDstItem = UsdSceneItem::create(fUfeDstPath, ufePathToPrim(fUfeDstPath)); + _ufeDstItem = UsdSceneItem::create(_ufeDstPath, ufePathToPrim(_ufeDstPath)); - sendNotification(fUfeDstItem, fUfeSrcItem->path()); + sendNotification(_ufeDstItem, _ufeSrcItem->path()); } } else { UFE_LOG(std::string("Warning: SdfCopySpec(") + - fUsdSrcPath.GetString() + std::string(") failed.")); + _usdSrcPath.GetString() + std::string(") failed.")); } return status; @@ -149,11 +149,11 @@ bool UsdUndoInsertChildCommand::insertChildUndo() // Regardless of where the edit target is currently set, switch to the // layer where we copied the source prim into the destination, then // restore the edit target. - UsdEditContext ctx(fStage, fParentLayer); - status = fStage->RemovePrim(fUsdDstPath); + UsdEditContext ctx(_stage, _parentLayer); + status = _stage->RemovePrim(_usdDstPath); } if (status) { - auto srcPrim = fStage->GetPrimAtPath(fUsdSrcPath); + auto srcPrim = _stage->GetPrimAtPath(_usdSrcPath); #ifdef UFE_V2_FEATURES_AVAILABLE UFE_ASSERT_MSG(srcPrim, "Invalid prim cannot be activated."); #else @@ -163,14 +163,14 @@ bool UsdUndoInsertChildCommand::insertChildUndo() if (status) { - sendNotification(fUfeSrcItem, fUfeDstItem->path()); + sendNotification(_ufeSrcItem, _ufeDstItem->path()); - fUfeDstItem = nullptr; + _ufeDstItem = nullptr; } } else { UFE_LOG(std::string("Warning: RemovePrim(") + - fUsdDstPath.GetString() + std::string(") failed.")); + _usdDstPath.GetString() + std::string(") failed.")); } return status; diff --git a/lib/mayaUsd/ufe/UsdUndoInsertChildCommand.h b/lib/mayaUsd/ufe/UsdUndoInsertChildCommand.h index d7f8c203b9..ad8137c570 100644 --- a/lib/mayaUsd/ufe/UsdUndoInsertChildCommand.h +++ b/lib/mayaUsd/ufe/UsdUndoInsertChildCommand.h @@ -15,12 +15,12 @@ // #pragma once -#include -#include +#include #include -#include +#include +#include PXR_NAMESPACE_USING_DIRECTIVE @@ -31,10 +31,11 @@ namespace ufe { class MAYAUSD_CORE_PUBLIC UsdUndoInsertChildCommand : public Ufe::UndoableCommand { public: - typedef std::shared_ptr Ptr; + using Ptr = std::shared_ptr; ~UsdUndoInsertChildCommand() override; + // Delete the copy/move constructors assignment operators. UsdUndoInsertChildCommand(const UsdUndoInsertChildCommand&) = delete; UsdUndoInsertChildCommand& operator=(const UsdUndoInsertChildCommand&) = delete; UsdUndoInsertChildCommand(UsdUndoInsertChildCommand&&) = delete; @@ -42,20 +43,16 @@ class MAYAUSD_CORE_PUBLIC UsdUndoInsertChildCommand : public Ufe::UndoableComman //! Create a UsdUndoInsertChildCommand. Note that as of 4-May-2020 the //! pos argument is ignored, and only append is supported. - static UsdUndoInsertChildCommand::Ptr create( - const UsdSceneItem::Ptr& parent, - const UsdSceneItem::Ptr& child, - const UsdSceneItem::Ptr& pos - ); + static UsdUndoInsertChildCommand::Ptr create(const UsdSceneItem::Ptr& parent, + const UsdSceneItem::Ptr& child, + const UsdSceneItem::Ptr& pos); protected: //! Construct a UsdUndoInsertChildCommand. Note that as of 4-May-2020 the //! pos argument is ignored, and only append is supported. - UsdUndoInsertChildCommand( - const UsdSceneItem::Ptr& parent, - const UsdSceneItem::Ptr& child, - const UsdSceneItem::Ptr& pos - ); + UsdUndoInsertChildCommand(const UsdSceneItem::Ptr& parent, + const UsdSceneItem::Ptr& child, + const UsdSceneItem::Ptr& pos); private: void undo() override; @@ -64,14 +61,18 @@ class MAYAUSD_CORE_PUBLIC UsdUndoInsertChildCommand : public Ufe::UndoableComman bool insertChildRedo(); bool insertChildUndo(); - UsdStageWeakPtr fStage; - SdfLayerHandle fChildLayer; - SdfLayerHandle fParentLayer; - UsdSceneItem::Ptr fUfeSrcItem; - SdfPath fUsdSrcPath; - UsdSceneItem::Ptr fUfeDstItem; - Ufe::Path fUfeDstPath; - SdfPath fUsdDstPath; + UsdStageWeakPtr _stage; + + UsdSceneItem::Ptr _ufeSrcItem; + UsdSceneItem::Ptr _ufeDstItem; + + SdfPath _usdSrcPath; + SdfPath _usdDstPath; + + SdfLayerHandle _childLayer; + SdfLayerHandle _parentLayer; + + Ufe::Path _ufeDstPath; }; // UsdUndoInsertChildCommand From 0202eecc5b6e41b3578d092ef468feadc45e42fb Mon Sep 17 00:00:00 2001 From: Hamed Sabri Date: Mon, 20 Jul 2020 14:30:35 -0400 Subject: [PATCH 2/6] Apply restriction rules for child and parent prims before performing the operations. --- lib/mayaUsd/ufe/UsdUndoInsertChildCommand.cpp | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/lib/mayaUsd/ufe/UsdUndoInsertChildCommand.cpp b/lib/mayaUsd/ufe/UsdUndoInsertChildCommand.cpp index e2df0b2b39..c6e4db0616 100644 --- a/lib/mayaUsd/ufe/UsdUndoInsertChildCommand.cpp +++ b/lib/mayaUsd/ufe/UsdUndoInsertChildCommand.cpp @@ -16,6 +16,7 @@ #include "UsdUndoInsertChildCommand.h" #include "private/InPathChange.h" +#include "private/Utils.h" #include "Utils.h" #include @@ -62,6 +63,10 @@ UsdUndoInsertChildCommand::UsdUndoInsertChildCommand(const UsdSceneItem::Ptr& pa const auto& childPrim = child->prim(); const auto& parentPrim = parent->prim(); + // Apply restriction rules + ufe::applyCommandRestriction(childPrim, "reparent"); + ufe::applyCommandRestriction(parentPrim, "reparent"); + // First, check if we need to rename the child. const auto& childName = uniqueChildName(parent, child->path()); @@ -78,22 +83,13 @@ UsdUndoInsertChildCommand::UsdUndoInsertChildCommand(const UsdSceneItem::Ptr& pa } _usdDstPath = parent->prim().GetPath().AppendChild(TfToken(childName)); - _childLayer = MayaUsdUtils::defPrimSpecLayer(childPrim); - if (!_childLayer) { - std::string err = TfStringPrintf("No child prim found at %s", childPrim.GetPath().GetString().c_str()); - throw std::runtime_error(err.c_str()); - } + _childLayer = _stage->GetEditTarget().GetLayer(); // If parent prim is the pseudo-root, no def primSpec will be found, so // just use the edit target layer. - _parentLayer = parentPrim.IsPseudoRoot() ? - _stage->GetEditTarget().GetLayer() : - MayaUsdUtils::defPrimSpecLayer(parentPrim); - - if (!_parentLayer) { - std::string err = TfStringPrintf("No parent prim found at %s", parentPrim.GetPath().GetString().c_str()); - throw std::runtime_error(err.c_str()); - } + _parentLayer = parentPrim.IsPseudoRoot() + ? _stage->GetEditTarget().GetLayer() + : MayaUsdUtils::defPrimSpecLayer(parentPrim); } UsdUndoInsertChildCommand::~UsdUndoInsertChildCommand() From baf159546a2d50b71cd9738103cd9624500d96e7 Mon Sep 17 00:00:00 2001 From: Hamed Sabri Date: Mon, 20 Jul 2020 23:21:00 -0400 Subject: [PATCH 3/6] Fix failing unit tests ( testGroupCmd, testParentCmd ). --- .../ufe/test-samples/groupBalls/ballset.ma | 189 ++++++++++++++++++ .../ufe/test-samples/groupBalls/ballset.usda | 56 ++++++ test/lib/ufe/testGroupCmd.py | 72 +++---- test/lib/ufe/testParentCmd.py | 94 +++++---- test/lib/ufe/ufeTestUtils/mayaUtils.py | 4 + 5 files changed, 340 insertions(+), 75 deletions(-) create mode 100644 test/lib/ufe/test-samples/groupBalls/ballset.ma create mode 100644 test/lib/ufe/test-samples/groupBalls/ballset.usda diff --git a/test/lib/ufe/test-samples/groupBalls/ballset.ma b/test/lib/ufe/test-samples/groupBalls/ballset.ma new file mode 100644 index 0000000000..5034046995 --- /dev/null +++ b/test/lib/ufe/test-samples/groupBalls/ballset.ma @@ -0,0 +1,189 @@ +//Maya ASCII 2020 scene +//Name: ballset.ma +//Last modified: Mon, Jul 20, 2020 11:08:40 PM +//Codeset: 1252 +requires maya "2020"; +requires -nodeType "mayaUsdProxyShape" -dataType "pxrUsdStageData" "mayaUsdPlugin" "1.0"; +currentUnit -l centimeter -a degree -t film; +fileInfo "application" "maya"; +fileInfo "product" "Maya 2021"; +fileInfo "version" "Preview Release 117"; +fileInfo "cutIdentifier" "202007080330-2453fbe041"; +fileInfo "osv" "Windows 10 Pro v1909 (Build: 18363)"; +fileInfo "UUID" "758F7E28-4E93-AE30-697B-4DA2E498433D"; +createNode transform -s -n "persp"; + rename -uid "51A6600D-4D0B-322A-D42C-BABF728BCCD2"; + setAttr ".v" no; + setAttr ".t" -type "double3" 18.111036298647001 -9.5950069162938512 13.680617196960139 ; + setAttr ".r" -type "double3" 62.482924915356314 -3.1805546814635168e-15 47.594913994746712 ; +createNode camera -s -n "perspShape" -p "persp"; + rename -uid "0345E212-4800-67FC-C598-19A6E9381EAE"; + setAttr -k off ".v" no; + setAttr ".fl" 34.999999999999993; + setAttr ".coi" 21.416154882584024; + setAttr ".imn" -type "string" "persp"; + setAttr ".den" -type "string" "persp_depth"; + setAttr ".man" -type "string" "persp_mask"; + setAttr ".tp" -type "double3" 1.3550635346161095 0.27013743329668638 3.3631376075465309 ; + setAttr ".hc" -type "string" "viewSet -p %camera"; +createNode transform -s -n "top"; + rename -uid "95C8A6B4-4269-4709-90BB-3D95CC9C6E91"; + setAttr ".v" no; + setAttr ".t" -type "double3" 0 0 1000.1 ; +createNode camera -s -n "topShape" -p "top"; + rename -uid "1F8635D5-4F07-1DBA-0A5F-7C8810C45574"; + setAttr -k off ".v" no; + setAttr ".rnd" no; + setAttr ".coi" 1000.1; + setAttr ".ow" 30; + setAttr ".imn" -type "string" "top"; + setAttr ".den" -type "string" "top_depth"; + setAttr ".man" -type "string" "top_mask"; + setAttr ".hc" -type "string" "viewSet -t %camera"; + setAttr ".o" yes; +createNode transform -s -n "front"; + rename -uid "0DF634E3-459D-8D5F-46B5-2DBBA35D0209"; + setAttr ".v" no; + setAttr ".t" -type "double3" 0 -1000.1 0 ; + setAttr ".r" -type "double3" 90 0 0 ; +createNode camera -s -n "frontShape" -p "front"; + rename -uid "B8B7451C-4886-5E1C-1EC8-88B7FFB7CDC4"; + setAttr -k off ".v" no; + setAttr ".rnd" no; + setAttr ".coi" 1000.1; + setAttr ".ow" 30; + setAttr ".imn" -type "string" "front"; + setAttr ".den" -type "string" "front_depth"; + setAttr ".man" -type "string" "front_mask"; + setAttr ".hc" -type "string" "viewSet -f %camera"; + setAttr ".o" yes; +createNode transform -s -n "side"; + rename -uid "F98A7694-4960-5ED8-5020-75B87FF02430"; + setAttr ".v" no; + setAttr ".t" -type "double3" 1000.1 0 0 ; + setAttr ".r" -type "double3" 90 0 90 ; +createNode camera -s -n "sideShape" -p "side"; + rename -uid "779E20C9-4BEF-D464-CBA4-44BD314F61D8"; + setAttr -k off ".v" no; + setAttr ".rnd" no; + setAttr ".coi" 1000.1; + setAttr ".ow" 30; + setAttr ".imn" -type "string" "side"; + setAttr ".den" -type "string" "side_depth"; + setAttr ".man" -type "string" "side_mask"; + setAttr ".hc" -type "string" "viewSet -s %camera"; + setAttr ".o" yes; +createNode transform -n "transform1"; + rename -uid "D274FFC8-4D7F-0D0D-8EA7-30AA571D5949"; +createNode mayaUsdProxyShape -n "proxyShape1" -p "transform1"; + rename -uid "4A68C6AE-4341-03C3-AAE5-749E5205EDD7"; + addAttr -r false -ci true -h true -sn "forceCompute" -ln "forceCompute" -min 0 + -max 1 -at "bool"; + setAttr -k off ".v"; + setAttr ".covm[0]" 0 1 1; + setAttr ".cdvm[0]" 0 1 1; + setAttr ".fp" -type "string" "./ballset.usda"; + setAttr ".pp" -type "string" ""; + setAttr ".epp" -type "string" ""; +createNode lightLinker -s -n "lightLinker1"; + rename -uid "0C0B875E-4B0E-7A86-A12F-D5A3BEF6E8B2"; + setAttr -s 2 ".lnk"; + setAttr -s 2 ".slnk"; +createNode shapeEditorManager -n "shapeEditorManager"; + rename -uid "3C4A790D-45C3-C41A-A76D-49A1C5B4DC70"; +createNode poseInterpolatorManager -n "poseInterpolatorManager"; + rename -uid "1EBAB8A1-47A2-CEA7-0D37-8C9DB399DE39"; +createNode displayLayerManager -n "layerManager"; + rename -uid "17F47A11-43D5-15EB-5C97-B5A007180A68"; +createNode displayLayer -n "defaultLayer"; + rename -uid "D0684D39-4FC0-D28B-3896-069ABEC7DB00"; +createNode renderLayerManager -n "renderLayerManager"; + rename -uid "81EE1852-4D2D-32C7-559D-50824369B938"; +createNode renderLayer -n "defaultRenderLayer"; + rename -uid "0CDD2F97-4864-B05D-23CC-1E87F64452A9"; + setAttr ".g" yes; +createNode script -n "uiConfigurationScriptNode"; + rename -uid "1A99693E-4B2F-D68E-DB3D-46B0226BF343"; + setAttr ".b" -type "string" ( + "// Maya Mel UI Configuration File.\n//\n// This script is machine generated. Edit at your own risk.\n//\n//\n\nglobal string $gMainPane;\nif (`paneLayout -exists $gMainPane`) {\n\n\tglobal int $gUseScenePanelConfig;\n\tint $useSceneConfig = $gUseScenePanelConfig;\n\tint $nodeEditorPanelVisible = stringArrayContains(\"nodeEditorPanel1\", `getPanel -vis`);\n\tint $nodeEditorWorkspaceControlOpen = (`workspaceControl -exists nodeEditorPanel1Window` && `workspaceControl -q -visible nodeEditorPanel1Window`);\n\tint $menusOkayInPanels = `optionVar -q allowMenusInPanels`;\n\tint $nVisPanes = `paneLayout -q -nvp $gMainPane`;\n\tint $nPanes = 0;\n\tstring $editorName;\n\tstring $panelName;\n\tstring $itemFilterName;\n\tstring $panelConfig;\n\n\t//\n\t// get current state of the UI\n\t//\n\tsceneUIReplacement -update $gMainPane;\n\n\t$panelName = `sceneUIReplacement -getNextPanel \"modelPanel\" (localizedPanelLabel(\"Top View\")) `;\n\tif (\"\" != $panelName) {\n\t\t$label = `panel -q -label $panelName`;\n\t\tmodelPanel -edit -l (localizedPanelLabel(\"Top View\")) -mbv $menusOkayInPanels $panelName;\n" + + "\t\t$editorName = $panelName;\n modelEditor -e \n -camera \"top\" \n -useInteractiveMode 0\n -displayLights \"default\" \n -displayAppearance \"smoothShaded\" \n -activeOnly 0\n -ignorePanZoom 0\n -wireframeOnShaded 0\n -headsUpDisplay 1\n -holdOuts 1\n -selectionHiliteDisplay 1\n -useDefaultMaterial 0\n -bufferMode \"double\" \n -twoSidedLighting 0\n -backfaceCulling 0\n -xray 0\n -jointXray 0\n -activeComponentsXray 0\n -displayTextures 0\n -smoothWireframe 0\n -lineWidth 1\n -textureAnisotropic 0\n -textureHilight 1\n -textureSampling 2\n -textureDisplay \"modulate\" \n -textureMaxSize 16384\n -fogging 0\n -fogSource \"fragment\" \n -fogMode \"linear\" \n -fogStart 0\n -fogEnd 100\n -fogDensity 0.1\n -fogColor 0.5 0.5 0.5 1 \n" + + " -depthOfFieldPreview 1\n -maxConstantTransparency 1\n -rendererName \"vp2Renderer\" \n -objectFilterShowInHUD 1\n -isFiltered 0\n -colorResolution 256 256 \n -bumpResolution 512 512 \n -textureCompression 0\n -transparencyAlgorithm \"frontAndBackCull\" \n -transpInShadows 0\n -cullingOverride \"none\" \n -lowQualityLighting 0\n -maximumNumHardwareLights 1\n -occlusionCulling 0\n -shadingModel 0\n -useBaseRenderer 0\n -useReducedRenderer 0\n -smallObjectCulling 0\n -smallObjectThreshold -1 \n -interactiveDisableShadows 0\n -interactiveBackFaceCull 0\n -sortTransparent 1\n -controllers 1\n -nurbsCurves 1\n -nurbsSurfaces 1\n -polymeshes 1\n -subdivSurfaces 1\n -planes 1\n -lights 1\n -cameras 1\n -controlVertices 1\n" + + " -hulls 1\n -grid 1\n -imagePlane 1\n -joints 1\n -ikHandles 1\n -deformers 1\n -dynamics 1\n -particleInstancers 1\n -fluids 1\n -hairSystems 1\n -follicles 1\n -nCloths 1\n -nParticles 1\n -nRigids 1\n -dynamicConstraints 1\n -locators 1\n -manipulators 1\n -pluginShapes 1\n -dimensions 1\n -handles 1\n -pivots 1\n -textures 1\n -strokes 1\n -motionTrails 1\n -clipGhosts 1\n -greasePencils 1\n -shadows 0\n -captureSequenceNumber -1\n -width 1\n -height 1\n -sceneRenderFilter 0\n $editorName;\n modelEditor -e -viewSelected 0 $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextPanel \"modelPanel\" (localizedPanelLabel(\"Side View\")) `;\n" + + "\tif (\"\" != $panelName) {\n\t\t$label = `panel -q -label $panelName`;\n\t\tmodelPanel -edit -l (localizedPanelLabel(\"Side View\")) -mbv $menusOkayInPanels $panelName;\n\t\t$editorName = $panelName;\n modelEditor -e \n -camera \"side\" \n -useInteractiveMode 0\n -displayLights \"default\" \n -displayAppearance \"smoothShaded\" \n -activeOnly 0\n -ignorePanZoom 0\n -wireframeOnShaded 0\n -headsUpDisplay 1\n -holdOuts 1\n -selectionHiliteDisplay 1\n -useDefaultMaterial 0\n -bufferMode \"double\" \n -twoSidedLighting 0\n -backfaceCulling 0\n -xray 0\n -jointXray 0\n -activeComponentsXray 0\n -displayTextures 0\n -smoothWireframe 0\n -lineWidth 1\n -textureAnisotropic 0\n -textureHilight 1\n -textureSampling 2\n -textureDisplay \"modulate\" \n -textureMaxSize 16384\n -fogging 0\n" + + " -fogSource \"fragment\" \n -fogMode \"linear\" \n -fogStart 0\n -fogEnd 100\n -fogDensity 0.1\n -fogColor 0.5 0.5 0.5 1 \n -depthOfFieldPreview 1\n -maxConstantTransparency 1\n -rendererName \"vp2Renderer\" \n -objectFilterShowInHUD 1\n -isFiltered 0\n -colorResolution 256 256 \n -bumpResolution 512 512 \n -textureCompression 0\n -transparencyAlgorithm \"frontAndBackCull\" \n -transpInShadows 0\n -cullingOverride \"none\" \n -lowQualityLighting 0\n -maximumNumHardwareLights 1\n -occlusionCulling 0\n -shadingModel 0\n -useBaseRenderer 0\n -useReducedRenderer 0\n -smallObjectCulling 0\n -smallObjectThreshold -1 \n -interactiveDisableShadows 0\n -interactiveBackFaceCull 0\n -sortTransparent 1\n -controllers 1\n -nurbsCurves 1\n" + + " -nurbsSurfaces 1\n -polymeshes 1\n -subdivSurfaces 1\n -planes 1\n -lights 1\n -cameras 1\n -controlVertices 1\n -hulls 1\n -grid 1\n -imagePlane 1\n -joints 1\n -ikHandles 1\n -deformers 1\n -dynamics 1\n -particleInstancers 1\n -fluids 1\n -hairSystems 1\n -follicles 1\n -nCloths 1\n -nParticles 1\n -nRigids 1\n -dynamicConstraints 1\n -locators 1\n -manipulators 1\n -pluginShapes 1\n -dimensions 1\n -handles 1\n -pivots 1\n -textures 1\n -strokes 1\n -motionTrails 1\n -clipGhosts 1\n -greasePencils 1\n -shadows 0\n -captureSequenceNumber -1\n -width 1\n -height 1\n -sceneRenderFilter 0\n $editorName;\n modelEditor -e -viewSelected 0 $editorName;\n" + + "\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextPanel \"modelPanel\" (localizedPanelLabel(\"Front View\")) `;\n\tif (\"\" != $panelName) {\n\t\t$label = `panel -q -label $panelName`;\n\t\tmodelPanel -edit -l (localizedPanelLabel(\"Front View\")) -mbv $menusOkayInPanels $panelName;\n\t\t$editorName = $panelName;\n modelEditor -e \n -camera \"front\" \n -useInteractiveMode 0\n -displayLights \"default\" \n -displayAppearance \"smoothShaded\" \n -activeOnly 0\n -ignorePanZoom 0\n -wireframeOnShaded 0\n -headsUpDisplay 1\n -holdOuts 1\n -selectionHiliteDisplay 1\n -useDefaultMaterial 0\n -bufferMode \"double\" \n -twoSidedLighting 0\n -backfaceCulling 0\n -xray 0\n -jointXray 0\n -activeComponentsXray 0\n -displayTextures 0\n -smoothWireframe 0\n -lineWidth 1\n -textureAnisotropic 0\n" + + " -textureHilight 1\n -textureSampling 2\n -textureDisplay \"modulate\" \n -textureMaxSize 16384\n -fogging 0\n -fogSource \"fragment\" \n -fogMode \"linear\" \n -fogStart 0\n -fogEnd 100\n -fogDensity 0.1\n -fogColor 0.5 0.5 0.5 1 \n -depthOfFieldPreview 1\n -maxConstantTransparency 1\n -rendererName \"vp2Renderer\" \n -objectFilterShowInHUD 1\n -isFiltered 0\n -colorResolution 256 256 \n -bumpResolution 512 512 \n -textureCompression 0\n -transparencyAlgorithm \"frontAndBackCull\" \n -transpInShadows 0\n -cullingOverride \"none\" \n -lowQualityLighting 0\n -maximumNumHardwareLights 1\n -occlusionCulling 0\n -shadingModel 0\n -useBaseRenderer 0\n -useReducedRenderer 0\n -smallObjectCulling 0\n -smallObjectThreshold -1 \n -interactiveDisableShadows 0\n" + + " -interactiveBackFaceCull 0\n -sortTransparent 1\n -controllers 1\n -nurbsCurves 1\n -nurbsSurfaces 1\n -polymeshes 1\n -subdivSurfaces 1\n -planes 1\n -lights 1\n -cameras 1\n -controlVertices 1\n -hulls 1\n -grid 1\n -imagePlane 1\n -joints 1\n -ikHandles 1\n -deformers 1\n -dynamics 1\n -particleInstancers 1\n -fluids 1\n -hairSystems 1\n -follicles 1\n -nCloths 1\n -nParticles 1\n -nRigids 1\n -dynamicConstraints 1\n -locators 1\n -manipulators 1\n -pluginShapes 1\n -dimensions 1\n -handles 1\n -pivots 1\n -textures 1\n -strokes 1\n -motionTrails 1\n -clipGhosts 1\n -greasePencils 1\n -shadows 0\n -captureSequenceNumber -1\n" + + " -width 1\n -height 1\n -sceneRenderFilter 0\n $editorName;\n modelEditor -e -viewSelected 0 $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextPanel \"modelPanel\" (localizedPanelLabel(\"Persp View\")) `;\n\tif (\"\" != $panelName) {\n\t\t$label = `panel -q -label $panelName`;\n\t\tmodelPanel -edit -l (localizedPanelLabel(\"Persp View\")) -mbv $menusOkayInPanels $panelName;\n\t\t$editorName = $panelName;\n modelEditor -e \n -camera \"persp\" \n -useInteractiveMode 0\n -displayLights \"default\" \n -displayAppearance \"smoothShaded\" \n -activeOnly 0\n -ignorePanZoom 0\n -wireframeOnShaded 0\n -headsUpDisplay 1\n -holdOuts 1\n -selectionHiliteDisplay 1\n -useDefaultMaterial 0\n -bufferMode \"double\" \n -twoSidedLighting 0\n -backfaceCulling 0\n -xray 0\n -jointXray 0\n" + + " -activeComponentsXray 0\n -displayTextures 0\n -smoothWireframe 0\n -lineWidth 1\n -textureAnisotropic 0\n -textureHilight 1\n -textureSampling 2\n -textureDisplay \"modulate\" \n -textureMaxSize 16384\n -fogging 0\n -fogSource \"fragment\" \n -fogMode \"linear\" \n -fogStart 0\n -fogEnd 100\n -fogDensity 0.1\n -fogColor 0.5 0.5 0.5 1 \n -depthOfFieldPreview 1\n -maxConstantTransparency 1\n -rendererName \"vp2Renderer\" \n -objectFilterShowInHUD 1\n -isFiltered 0\n -colorResolution 256 256 \n -bumpResolution 512 512 \n -textureCompression 0\n -transparencyAlgorithm \"frontAndBackCull\" \n -transpInShadows 0\n -cullingOverride \"none\" \n -lowQualityLighting 0\n -maximumNumHardwareLights 1\n -occlusionCulling 0\n -shadingModel 0\n" + + " -useBaseRenderer 0\n -useReducedRenderer 0\n -smallObjectCulling 0\n -smallObjectThreshold -1 \n -interactiveDisableShadows 0\n -interactiveBackFaceCull 0\n -sortTransparent 1\n -controllers 1\n -nurbsCurves 1\n -nurbsSurfaces 1\n -polymeshes 1\n -subdivSurfaces 1\n -planes 1\n -lights 1\n -cameras 1\n -controlVertices 1\n -hulls 1\n -grid 1\n -imagePlane 1\n -joints 1\n -ikHandles 1\n -deformers 1\n -dynamics 1\n -particleInstancers 1\n -fluids 1\n -hairSystems 1\n -follicles 1\n -nCloths 1\n -nParticles 1\n -nRigids 1\n -dynamicConstraints 1\n -locators 1\n -manipulators 1\n -pluginShapes 1\n -dimensions 1\n -handles 1\n -pivots 1\n -textures 1\n" + + " -strokes 1\n -motionTrails 1\n -clipGhosts 1\n -greasePencils 1\n -shadows 0\n -captureSequenceNumber -1\n -width 1227\n -height 838\n -sceneRenderFilter 0\n $editorName;\n modelEditor -e -viewSelected 0 $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextPanel \"outlinerPanel\" (localizedPanelLabel(\"ToggledOutliner\")) `;\n\tif (\"\" != $panelName) {\n\t\t$label = `panel -q -label $panelName`;\n\t\toutlinerPanel -edit -l (localizedPanelLabel(\"ToggledOutliner\")) -mbv $menusOkayInPanels $panelName;\n\t\t$editorName = $panelName;\n outlinerEditor -e \n -docTag \"isolOutln_fromSeln\" \n -showShapes 1\n -showAssignedMaterials 0\n -showTimeEditor 1\n -showReferenceNodes 1\n -showReferenceMembers 1\n -showAttributes 0\n -showConnected 0\n -showAnimCurvesOnly 0\n -showMuteInfo 0\n" + + " -organizeByLayer 1\n -organizeByClip 1\n -showAnimLayerWeight 1\n -autoExpandLayers 1\n -autoExpand 0\n -showDagOnly 1\n -showAssets 1\n -showContainedOnly 1\n -showPublishedAsConnected 0\n -showParentContainers 0\n -showContainerContents 1\n -ignoreDagHierarchy 0\n -expandConnections 0\n -showUpstreamCurves 1\n -showUnitlessCurves 1\n -showCompounds 1\n -showLeafs 1\n -showNumericAttrsOnly 0\n -highlightActive 1\n -autoSelectNewObjects 0\n -doNotSelectNewObjects 0\n -dropIsParent 1\n -transmitFilters 0\n -setFilter \"defaultSetFilter\" \n -showSetMembers 1\n -allowMultiSelection 1\n -alwaysToggleSelect 0\n -directSelect 0\n -isSet 0\n -isSetMember 0\n -isUfeItem 0\n -displayMode \"DAG\" \n -expandObjects 0\n" + + " -setsIgnoreFilters 1\n -containersIgnoreFilters 0\n -editAttrName 0\n -showAttrValues 0\n -highlightSecondary 0\n -showUVAttrsOnly 0\n -showTextureNodesOnly 0\n -attrAlphaOrder \"default\" \n -animLayerFilterOptions \"allAffecting\" \n -sortOrder \"none\" \n -longNames 0\n -niceNames 1\n -showNamespace 1\n -showPinIcons 0\n -mapMotionTrails 0\n -ignoreHiddenAttribute 0\n -ignoreOutlinerColor 0\n -renderFilterVisible 0\n -renderFilterIndex 0\n -selectionOrder \"chronological\" \n -expandAttribute 0\n $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextPanel \"outlinerPanel\" (localizedPanelLabel(\"Outliner\")) `;\n\tif (\"\" != $panelName) {\n\t\t$label = `panel -q -label $panelName`;\n\t\toutlinerPanel -edit -l (localizedPanelLabel(\"Outliner\")) -mbv $menusOkayInPanels $panelName;\n" + + "\t\t$editorName = $panelName;\n outlinerEditor -e \n -showShapes 0\n -showAssignedMaterials 0\n -showTimeEditor 1\n -showReferenceNodes 0\n -showReferenceMembers 0\n -showAttributes 0\n -showConnected 0\n -showAnimCurvesOnly 0\n -showMuteInfo 0\n -organizeByLayer 1\n -organizeByClip 1\n -showAnimLayerWeight 1\n -autoExpandLayers 1\n -autoExpand 0\n -showDagOnly 1\n -showAssets 1\n -showContainedOnly 1\n -showPublishedAsConnected 0\n -showParentContainers 0\n -showContainerContents 1\n -ignoreDagHierarchy 0\n -expandConnections 0\n -showUpstreamCurves 1\n -showUnitlessCurves 1\n -showCompounds 1\n -showLeafs 1\n -showNumericAttrsOnly 0\n -highlightActive 1\n -autoSelectNewObjects 0\n -doNotSelectNewObjects 0\n -dropIsParent 1\n" + + " -transmitFilters 0\n -setFilter \"defaultSetFilter\" \n -showSetMembers 1\n -allowMultiSelection 1\n -alwaysToggleSelect 0\n -directSelect 0\n -displayMode \"DAG\" \n -expandObjects 0\n -setsIgnoreFilters 1\n -containersIgnoreFilters 0\n -editAttrName 0\n -showAttrValues 0\n -highlightSecondary 0\n -showUVAttrsOnly 0\n -showTextureNodesOnly 0\n -attrAlphaOrder \"default\" \n -animLayerFilterOptions \"allAffecting\" \n -sortOrder \"none\" \n -longNames 0\n -niceNames 1\n -showNamespace 1\n -showPinIcons 0\n -mapMotionTrails 0\n -ignoreHiddenAttribute 0\n -ignoreOutlinerColor 0\n -renderFilterVisible 0\n $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"graphEditor\" (localizedPanelLabel(\"Graph Editor\")) `;\n" + + "\tif (\"\" != $panelName) {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Graph Editor\")) -mbv $menusOkayInPanels $panelName;\n\n\t\t\t$editorName = ($panelName+\"OutlineEd\");\n outlinerEditor -e \n -showShapes 1\n -showAssignedMaterials 0\n -showTimeEditor 1\n -showReferenceNodes 0\n -showReferenceMembers 0\n -showAttributes 1\n -showConnected 1\n -showAnimCurvesOnly 1\n -showMuteInfo 0\n -organizeByLayer 1\n -organizeByClip 1\n -showAnimLayerWeight 1\n -autoExpandLayers 1\n -autoExpand 1\n -showDagOnly 0\n -showAssets 1\n -showContainedOnly 0\n -showPublishedAsConnected 0\n -showParentContainers 0\n -showContainerContents 0\n -ignoreDagHierarchy 0\n -expandConnections 1\n" + + " -showUpstreamCurves 1\n -showUnitlessCurves 1\n -showCompounds 0\n -showLeafs 1\n -showNumericAttrsOnly 1\n -highlightActive 0\n -autoSelectNewObjects 1\n -doNotSelectNewObjects 0\n -dropIsParent 1\n -transmitFilters 1\n -setFilter \"0\" \n -showSetMembers 0\n -allowMultiSelection 1\n -alwaysToggleSelect 0\n -directSelect 0\n -displayMode \"DAG\" \n -expandObjects 0\n -setsIgnoreFilters 1\n -containersIgnoreFilters 0\n -editAttrName 0\n -showAttrValues 0\n -highlightSecondary 0\n -showUVAttrsOnly 0\n -showTextureNodesOnly 0\n -attrAlphaOrder \"default\" \n -animLayerFilterOptions \"allAffecting\" \n -sortOrder \"none\" \n -longNames 0\n" + + " -niceNames 1\n -showNamespace 1\n -showPinIcons 1\n -mapMotionTrails 1\n -ignoreHiddenAttribute 0\n -ignoreOutlinerColor 0\n -renderFilterVisible 0\n $editorName;\n\n\t\t\t$editorName = ($panelName+\"GraphEd\");\n animCurveEditor -e \n -displayValues 0\n -snapTime \"integer\" \n -snapValue \"none\" \n -showPlayRangeShades \"on\" \n -lockPlayRangeShades \"off\" \n -smoothness \"fine\" \n -resultSamples 1\n -resultScreenSamples 0\n -resultUpdate \"delayed\" \n -showUpstreamCurves 1\n -stackedCurvesMin -1\n -stackedCurvesMax 1\n -stackedCurvesSpace 0.2\n -preSelectionHighlight 0\n -constrainDrag 0\n -valueLinesToggle 1\n -highlightAffectedCurves 0\n $editorName;\n" + + "\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"dopeSheetPanel\" (localizedPanelLabel(\"Dope Sheet\")) `;\n\tif (\"\" != $panelName) {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Dope Sheet\")) -mbv $menusOkayInPanels $panelName;\n\n\t\t\t$editorName = ($panelName+\"OutlineEd\");\n outlinerEditor -e \n -showShapes 1\n -showAssignedMaterials 0\n -showTimeEditor 1\n -showReferenceNodes 0\n -showReferenceMembers 0\n -showAttributes 1\n -showConnected 1\n -showAnimCurvesOnly 1\n -showMuteInfo 0\n -organizeByLayer 1\n -organizeByClip 1\n -showAnimLayerWeight 1\n -autoExpandLayers 1\n -autoExpand 0\n -showDagOnly 0\n -showAssets 1\n -showContainedOnly 0\n -showPublishedAsConnected 0\n" + + " -showParentContainers 0\n -showContainerContents 0\n -ignoreDagHierarchy 0\n -expandConnections 1\n -showUpstreamCurves 1\n -showUnitlessCurves 0\n -showCompounds 1\n -showLeafs 1\n -showNumericAttrsOnly 1\n -highlightActive 0\n -autoSelectNewObjects 0\n -doNotSelectNewObjects 1\n -dropIsParent 1\n -transmitFilters 0\n -setFilter \"0\" \n -showSetMembers 0\n -allowMultiSelection 1\n -alwaysToggleSelect 0\n -directSelect 0\n -displayMode \"DAG\" \n -expandObjects 0\n -setsIgnoreFilters 1\n -containersIgnoreFilters 0\n -editAttrName 0\n -showAttrValues 0\n -highlightSecondary 0\n -showUVAttrsOnly 0\n -showTextureNodesOnly 0\n -attrAlphaOrder \"default\" \n" + + " -animLayerFilterOptions \"allAffecting\" \n -sortOrder \"none\" \n -longNames 0\n -niceNames 1\n -showNamespace 1\n -showPinIcons 0\n -mapMotionTrails 1\n -ignoreHiddenAttribute 0\n -ignoreOutlinerColor 0\n -renderFilterVisible 0\n $editorName;\n\n\t\t\t$editorName = ($panelName+\"DopeSheetEd\");\n dopeSheetEditor -e \n -displayValues 0\n -snapTime \"integer\" \n -snapValue \"none\" \n -outliner \"dopeSheetPanel1OutlineEd\" \n -showSummary 1\n -showScene 0\n -hierarchyBelow 0\n -showTicks 1\n -selectionWindow 0 0 0 0 \n $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"timeEditorPanel\" (localizedPanelLabel(\"Time Editor\")) `;\n\tif (\"\" != $panelName) {\n" + + "\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Time Editor\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"clipEditorPanel\" (localizedPanelLabel(\"Trax Editor\")) `;\n\tif (\"\" != $panelName) {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Trax Editor\")) -mbv $menusOkayInPanels $panelName;\n\n\t\t\t$editorName = clipEditorNameFromPanel($panelName);\n clipEditor -e \n -displayValues 0\n -snapTime \"none\" \n -snapValue \"none\" \n -initialized 0\n -manageSequencer 0 \n $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"sequenceEditorPanel\" (localizedPanelLabel(\"Camera Sequencer\")) `;\n\tif (\"\" != $panelName) {\n\t\t$label = `panel -q -label $panelName`;\n" + + "\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Camera Sequencer\")) -mbv $menusOkayInPanels $panelName;\n\n\t\t\t$editorName = sequenceEditorNameFromPanel($panelName);\n clipEditor -e \n -displayValues 0\n -snapTime \"none\" \n -snapValue \"none\" \n -initialized 0\n -manageSequencer 1 \n $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"hyperGraphPanel\" (localizedPanelLabel(\"Hypergraph Hierarchy\")) `;\n\tif (\"\" != $panelName) {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Hypergraph Hierarchy\")) -mbv $menusOkayInPanels $panelName;\n\n\t\t\t$editorName = ($panelName+\"HyperGraphEd\");\n hyperGraph -e \n -graphLayoutStyle \"hierarchicalLayout\" \n -orientation \"horiz\" \n -mergeConnections 0\n -zoom 1\n -animateTransition 0\n -showRelationships 1\n" + + " -showShapes 0\n -showDeformers 0\n -showExpressions 0\n -showConstraints 0\n -showConnectionFromSelected 0\n -showConnectionToSelected 0\n -showConstraintLabels 0\n -showUnderworld 0\n -showInvisible 0\n -transitionFrames 1\n -opaqueContainers 0\n -freeform 0\n -imagePosition 0 0 \n -imageScale 1\n -imageEnabled 0\n -graphType \"DAG\" \n -heatMapDisplay 0\n -updateSelection 1\n -updateNodeAdded 1\n -useDrawOverrideColor 0\n -limitGraphTraversal -1\n -range 0 0 \n -iconSize \"smallIcons\" \n -showCachedConnections 0\n $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"hyperShadePanel\" (localizedPanelLabel(\"Hypershade\")) `;\n" + + "\tif (\"\" != $panelName) {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Hypershade\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"visorPanel\" (localizedPanelLabel(\"Visor\")) `;\n\tif (\"\" != $panelName) {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Visor\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"nodeEditorPanel\" (localizedPanelLabel(\"Node Editor\")) `;\n\tif ($nodeEditorPanelVisible || $nodeEditorWorkspaceControlOpen) {\n\t\tif (\"\" == $panelName) {\n\t\t\tif ($useSceneConfig) {\n\t\t\t\t$panelName = `scriptedPanel -unParent -type \"nodeEditorPanel\" -l (localizedPanelLabel(\"Node Editor\")) -mbv $menusOkayInPanels `;\n\n\t\t\t$editorName = ($panelName+\"NodeEditorEd\");\n nodeEditor -e \n -allAttributes 0\n" + + " -allNodes 0\n -autoSizeNodes 1\n -consistentNameSize 1\n -createNodeCommand \"nodeEdCreateNodeCommand\" \n -connectNodeOnCreation 0\n -connectOnDrop 0\n -copyConnectionsOnPaste 0\n -connectionStyle \"bezier\" \n -defaultPinnedState 0\n -additiveGraphingMode 0\n -settingsChangedCallback \"nodeEdSyncControls\" \n -traversalDepthLimit -1\n -keyPressCommand \"nodeEdKeyPressCommand\" \n -nodeTitleMode \"name\" \n -gridSnap 0\n -gridVisibility 1\n -crosshairOnEdgeDragging 0\n -popupMenuScript \"nodeEdBuildPanelMenus\" \n -showNamespace 1\n -showShapes 1\n -showSGShapes 0\n -showTransforms 1\n -useAssets 1\n -syncedSelection 1\n -extendToShapes 1\n -editorMode \"default\" \n" + + " -hasWatchpoint 0\n $editorName;\n\t\t\t}\n\t\t} else {\n\t\t\t$label = `panel -q -label $panelName`;\n\t\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Node Editor\")) -mbv $menusOkayInPanels $panelName;\n\n\t\t\t$editorName = ($panelName+\"NodeEditorEd\");\n nodeEditor -e \n -allAttributes 0\n -allNodes 0\n -autoSizeNodes 1\n -consistentNameSize 1\n -createNodeCommand \"nodeEdCreateNodeCommand\" \n -connectNodeOnCreation 0\n -connectOnDrop 0\n -copyConnectionsOnPaste 0\n -connectionStyle \"bezier\" \n -defaultPinnedState 0\n -additiveGraphingMode 0\n -settingsChangedCallback \"nodeEdSyncControls\" \n -traversalDepthLimit -1\n -keyPressCommand \"nodeEdKeyPressCommand\" \n -nodeTitleMode \"name\" \n -gridSnap 0\n -gridVisibility 1\n -crosshairOnEdgeDragging 0\n" + + " -popupMenuScript \"nodeEdBuildPanelMenus\" \n -showNamespace 1\n -showShapes 1\n -showSGShapes 0\n -showTransforms 1\n -useAssets 1\n -syncedSelection 1\n -extendToShapes 1\n -editorMode \"default\" \n -hasWatchpoint 0\n $editorName;\n\t\t\tif (!$useSceneConfig) {\n\t\t\t\tpanel -e -l $label $panelName;\n\t\t\t}\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"createNodePanel\" (localizedPanelLabel(\"Create Node\")) `;\n\tif (\"\" != $panelName) {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Create Node\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"polyTexturePlacementPanel\" (localizedPanelLabel(\"UV Editor\")) `;\n\tif (\"\" != $panelName) {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"UV Editor\")) -mbv $menusOkayInPanels $panelName;\n" + + "\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"renderWindowPanel\" (localizedPanelLabel(\"Render View\")) `;\n\tif (\"\" != $panelName) {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Render View\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextPanel \"shapePanel\" (localizedPanelLabel(\"Shape Editor\")) `;\n\tif (\"\" != $panelName) {\n\t\t$label = `panel -q -label $panelName`;\n\t\tshapePanel -edit -l (localizedPanelLabel(\"Shape Editor\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextPanel \"posePanel\" (localizedPanelLabel(\"Pose Editor\")) `;\n\tif (\"\" != $panelName) {\n\t\t$label = `panel -q -label $panelName`;\n\t\tposePanel -edit -l (localizedPanelLabel(\"Pose Editor\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n" + + "\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"dynRelEdPanel\" (localizedPanelLabel(\"Dynamic Relationships\")) `;\n\tif (\"\" != $panelName) {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Dynamic Relationships\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"relationshipPanel\" (localizedPanelLabel(\"Relationship Editor\")) `;\n\tif (\"\" != $panelName) {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Relationship Editor\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"referenceEditorPanel\" (localizedPanelLabel(\"Reference Editor\")) `;\n\tif (\"\" != $panelName) {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Reference Editor\")) -mbv $menusOkayInPanels $panelName;\n" + + "\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"componentEditorPanel\" (localizedPanelLabel(\"Component Editor\")) `;\n\tif (\"\" != $panelName) {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Component Editor\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"dynPaintScriptedPanelType\" (localizedPanelLabel(\"Paint Effects\")) `;\n\tif (\"\" != $panelName) {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Paint Effects\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"scriptEditorPanel\" (localizedPanelLabel(\"Script Editor\")) `;\n\tif (\"\" != $panelName) {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Script Editor\")) -mbv $menusOkayInPanels $panelName;\n" + + "\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"profilerPanel\" (localizedPanelLabel(\"Profiler Tool\")) `;\n\tif (\"\" != $panelName) {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Profiler Tool\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"contentBrowserPanel\" (localizedPanelLabel(\"Content Browser\")) `;\n\tif (\"\" != $panelName) {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Content Browser\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\tif ($useSceneConfig) {\n string $configName = `getPanel -cwl (localizedPanelLabel(\"Current Layout\"))`;\n if (\"\" != $configName) {\n\t\t\tpanelConfiguration -edit -label (localizedPanelLabel(\"Current Layout\")) \n\t\t\t\t-userCreated false\n\t\t\t\t-defaultImage \"vacantCell.xP:/\"\n" + + "\t\t\t\t-image \"\"\n\t\t\t\t-sc false\n\t\t\t\t-configString \"global string $gMainPane; paneLayout -e -cn \\\"single\\\" -ps 1 100 100 $gMainPane;\"\n\t\t\t\t-removeAllPanels\n\t\t\t\t-ap false\n\t\t\t\t\t(localizedPanelLabel(\"Persp View\")) \n\t\t\t\t\t\"modelPanel\"\n" + + "\t\t\t\t\t\"$panelName = `modelPanel -unParent -l (localizedPanelLabel(\\\"Persp View\\\")) -mbv $menusOkayInPanels `;\\n$editorName = $panelName;\\nmodelEditor -e \\n -cam `findStartUpCamera persp` \\n -useInteractiveMode 0\\n -displayLights \\\"default\\\" \\n -displayAppearance \\\"smoothShaded\\\" \\n -activeOnly 0\\n -ignorePanZoom 0\\n -wireframeOnShaded 0\\n -headsUpDisplay 1\\n -holdOuts 1\\n -selectionHiliteDisplay 1\\n -useDefaultMaterial 0\\n -bufferMode \\\"double\\\" \\n -twoSidedLighting 0\\n -backfaceCulling 0\\n -xray 0\\n -jointXray 0\\n -activeComponentsXray 0\\n -displayTextures 0\\n -smoothWireframe 0\\n -lineWidth 1\\n -textureAnisotropic 0\\n -textureHilight 1\\n -textureSampling 2\\n -textureDisplay \\\"modulate\\\" \\n -textureMaxSize 16384\\n -fogging 0\\n -fogSource \\\"fragment\\\" \\n -fogMode \\\"linear\\\" \\n -fogStart 0\\n -fogEnd 100\\n -fogDensity 0.1\\n -fogColor 0.5 0.5 0.5 1 \\n -depthOfFieldPreview 1\\n -maxConstantTransparency 1\\n -rendererName \\\"vp2Renderer\\\" \\n -objectFilterShowInHUD 1\\n -isFiltered 0\\n -colorResolution 256 256 \\n -bumpResolution 512 512 \\n -textureCompression 0\\n -transparencyAlgorithm \\\"frontAndBackCull\\\" \\n -transpInShadows 0\\n -cullingOverride \\\"none\\\" \\n -lowQualityLighting 0\\n -maximumNumHardwareLights 1\\n -occlusionCulling 0\\n -shadingModel 0\\n -useBaseRenderer 0\\n -useReducedRenderer 0\\n -smallObjectCulling 0\\n -smallObjectThreshold -1 \\n -interactiveDisableShadows 0\\n -interactiveBackFaceCull 0\\n -sortTransparent 1\\n -controllers 1\\n -nurbsCurves 1\\n -nurbsSurfaces 1\\n -polymeshes 1\\n -subdivSurfaces 1\\n -planes 1\\n -lights 1\\n -cameras 1\\n -controlVertices 1\\n -hulls 1\\n -grid 1\\n -imagePlane 1\\n -joints 1\\n -ikHandles 1\\n -deformers 1\\n -dynamics 1\\n -particleInstancers 1\\n -fluids 1\\n -hairSystems 1\\n -follicles 1\\n -nCloths 1\\n -nParticles 1\\n -nRigids 1\\n -dynamicConstraints 1\\n -locators 1\\n -manipulators 1\\n -pluginShapes 1\\n -dimensions 1\\n -handles 1\\n -pivots 1\\n -textures 1\\n -strokes 1\\n -motionTrails 1\\n -clipGhosts 1\\n -greasePencils 1\\n -shadows 0\\n -captureSequenceNumber -1\\n -width 1227\\n -height 838\\n -sceneRenderFilter 0\\n $editorName;\\nmodelEditor -e -viewSelected 0 $editorName\"\n" + + "\t\t\t\t\t\"modelPanel -edit -l (localizedPanelLabel(\\\"Persp View\\\")) -mbv $menusOkayInPanels $panelName;\\n$editorName = $panelName;\\nmodelEditor -e \\n -cam `findStartUpCamera persp` \\n -useInteractiveMode 0\\n -displayLights \\\"default\\\" \\n -displayAppearance \\\"smoothShaded\\\" \\n -activeOnly 0\\n -ignorePanZoom 0\\n -wireframeOnShaded 0\\n -headsUpDisplay 1\\n -holdOuts 1\\n -selectionHiliteDisplay 1\\n -useDefaultMaterial 0\\n -bufferMode \\\"double\\\" \\n -twoSidedLighting 0\\n -backfaceCulling 0\\n -xray 0\\n -jointXray 0\\n -activeComponentsXray 0\\n -displayTextures 0\\n -smoothWireframe 0\\n -lineWidth 1\\n -textureAnisotropic 0\\n -textureHilight 1\\n -textureSampling 2\\n -textureDisplay \\\"modulate\\\" \\n -textureMaxSize 16384\\n -fogging 0\\n -fogSource \\\"fragment\\\" \\n -fogMode \\\"linear\\\" \\n -fogStart 0\\n -fogEnd 100\\n -fogDensity 0.1\\n -fogColor 0.5 0.5 0.5 1 \\n -depthOfFieldPreview 1\\n -maxConstantTransparency 1\\n -rendererName \\\"vp2Renderer\\\" \\n -objectFilterShowInHUD 1\\n -isFiltered 0\\n -colorResolution 256 256 \\n -bumpResolution 512 512 \\n -textureCompression 0\\n -transparencyAlgorithm \\\"frontAndBackCull\\\" \\n -transpInShadows 0\\n -cullingOverride \\\"none\\\" \\n -lowQualityLighting 0\\n -maximumNumHardwareLights 1\\n -occlusionCulling 0\\n -shadingModel 0\\n -useBaseRenderer 0\\n -useReducedRenderer 0\\n -smallObjectCulling 0\\n -smallObjectThreshold -1 \\n -interactiveDisableShadows 0\\n -interactiveBackFaceCull 0\\n -sortTransparent 1\\n -controllers 1\\n -nurbsCurves 1\\n -nurbsSurfaces 1\\n -polymeshes 1\\n -subdivSurfaces 1\\n -planes 1\\n -lights 1\\n -cameras 1\\n -controlVertices 1\\n -hulls 1\\n -grid 1\\n -imagePlane 1\\n -joints 1\\n -ikHandles 1\\n -deformers 1\\n -dynamics 1\\n -particleInstancers 1\\n -fluids 1\\n -hairSystems 1\\n -follicles 1\\n -nCloths 1\\n -nParticles 1\\n -nRigids 1\\n -dynamicConstraints 1\\n -locators 1\\n -manipulators 1\\n -pluginShapes 1\\n -dimensions 1\\n -handles 1\\n -pivots 1\\n -textures 1\\n -strokes 1\\n -motionTrails 1\\n -clipGhosts 1\\n -greasePencils 1\\n -shadows 0\\n -captureSequenceNumber -1\\n -width 1227\\n -height 838\\n -sceneRenderFilter 0\\n $editorName;\\nmodelEditor -e -viewSelected 0 $editorName\"\n" + + "\t\t\t\t$configName;\n\n setNamedPanelLayout (localizedPanelLabel(\"Current Layout\"));\n }\n\n panelHistory -e -clear mainPanelHistory;\n sceneUIReplacement -clear;\n\t}\n\n\ngrid -spacing 5 -size 12 -divisions 5 -displayAxes yes -displayGridLines yes -displayDivisionLines yes -displayPerspectiveLabels no -displayOrthographicLabels no -displayAxesBold yes -perspectiveLabelPosition axis -orthographicLabelPosition edge;\nviewManip -drawCompass 0 -compassAngle 0 -frontParameters \"\" -homeParameters \"\" -selectionLockParameters \"\";\n}\n"); + setAttr ".st" 3; +createNode script -n "sceneConfigurationScriptNode"; + rename -uid "240E4CFA-489A-59AF-89B4-BA80205539EA"; + setAttr ".b" -type "string" "playbackOptions -min 1 -max 120 -ast 1 -aet 200 "; + setAttr ".st" 6; +select -ne :time1; + setAttr ".o" 1; + setAttr ".unw" 1; +select -ne :hardwareRenderingGlobals; + setAttr ".otfna" -type "stringArray" 22 "NURBS Curves" "NURBS Surfaces" "Polygons" "Subdiv Surface" "Particles" "Particle Instance" "Fluids" "Strokes" "Image Planes" "UI" "Lights" "Cameras" "Locators" "Joints" "IK Handles" "Deformers" "Motion Trails" "Components" "Hair Systems" "Follicles" "Misc. UI" "Ornaments" ; + setAttr ".otfva" -type "Int32Array" 22 0 1 1 1 1 1 + 1 1 1 0 0 0 0 0 0 0 0 0 + 0 0 0 0 ; + setAttr ".fprt" yes; +select -ne :renderPartition; + setAttr -s 2 ".st"; +select -ne :renderGlobalsList1; +select -ne :defaultShaderList1; + setAttr -s 5 ".s"; +select -ne :postProcessList1; + setAttr -s 2 ".p"; +select -ne :defaultRenderingList1; +select -ne :initialShadingGroup; + setAttr ".ro" yes; +select -ne :initialParticleSE; + setAttr ".ro" yes; +select -ne :defaultRenderGlobals; + addAttr -ci true -h true -sn "dss" -ln "defaultSurfaceShader" -dt "string"; + setAttr ".dss" -type "string" "lambert1"; +select -ne :defaultResolution; + setAttr ".pa" 1; +select -ne :hardwareRenderGlobals; + setAttr ".ctrs" 256; + setAttr ".btrs" 512; +connectAttr ":time1.o" "proxyShape1.tm"; +relationship "link" ":lightLinker1" ":initialShadingGroup.message" ":defaultLightSet.message"; +relationship "link" ":lightLinker1" ":initialParticleSE.message" ":defaultLightSet.message"; +relationship "shadowLink" ":lightLinker1" ":initialShadingGroup.message" ":defaultLightSet.message"; +relationship "shadowLink" ":lightLinker1" ":initialParticleSE.message" ":defaultLightSet.message"; +connectAttr "layerManager.dli[0]" "defaultLayer.id"; +connectAttr "renderLayerManager.rlmi[0]" "defaultRenderLayer.rlid"; +connectAttr "defaultRenderLayer.msg" ":defaultRenderingList1.r" -na; +// End of ballset.ma diff --git a/test/lib/ufe/test-samples/groupBalls/ballset.usda b/test/lib/ufe/test-samples/groupBalls/ballset.usda new file mode 100644 index 0000000000..9db4659c88 --- /dev/null +++ b/test/lib/ufe/test-samples/groupBalls/ballset.usda @@ -0,0 +1,56 @@ +#usda 1.0 + +( + defaultPrim = "Ball_set" + upAxis = "Y" +) + +def Xform "Ball_set"( + assetInfo = { + asset identifier = @ballset.usda@ + string name = "Ball_set" + } + kind = "assembly" +) +{ + def Xform "Props" ( + kind = "group" + ) + { + def Sphere "Ball_1" + { + double3 xformOp:translate = (-5, 2.8575, 0) + uniform token[] xformOpOrder = ["xformOp:translate"] + } + + def Sphere "Ball_2" + { + double3 xformOp:translate = (-0.0506648173719331, 2.8575, -2.8575) + uniform token[] xformOpOrder = ["xformOp:translate"] + } + + def Sphere "Ball_3" + { + double3 xformOp:translate = (-0.0506648173719331, 2.8575, 2.8575) + uniform token[] xformOpOrder = ["xformOp:translate"] + } + + def Sphere "Ball_4" + { + double3 xformOp:translate = (4.89867036525613, 2.8575, -5.715) + uniform token[] xformOpOrder = ["xformOp:translate"] + } + + def Sphere "Ball_5" + { + double3 xformOp:translate = (4.89867036525613, 2.8575, 0) + uniform token[] xformOpOrder = ["xformOp:translate"] + } + + def Sphere "Ball_6" + { + double3 xformOp:translate = (4.89867036525613, 2.8575, 5.715) + uniform token[] xformOpOrder = ["xformOp:translate"] + } + } +} diff --git a/test/lib/ufe/testGroupCmd.py b/test/lib/ufe/testGroupCmd.py index 3823dbb50e..a50fd80deb 100644 --- a/test/lib/ufe/testGroupCmd.py +++ b/test/lib/ufe/testGroupCmd.py @@ -20,10 +20,9 @@ import maya.cmds as cmds -from pxr import Sdf - from ufeTestUtils import usdUtils, mayaUtils, ufeUtils import ufe +import mayaUsd.ufe import unittest @@ -35,20 +34,20 @@ class GroupCmdTestCase(unittest.TestCase): ''' pluginsLoaded = False - + @classmethod def setUpClass(cls): if not cls.pluginsLoaded: cls.pluginsLoaded = mayaUtils.isMayaUsdPluginLoaded() - + def setUp(self): ''' Called initially to set up the Maya test environment ''' # Load plugins self.assertTrue(self.pluginsLoaded) - - # Open top_layer.ma scene in test-samples - mayaUtils.openTopLayerScene() - + + # Open ballset.ma scene in test-samples + mayaUtils.openGroupBallsScene() + # Clear selection to start off cmds.select(clear=True) @@ -56,37 +55,43 @@ def setUp(self): def testUsdGroup(self): '''Creation of USD group objects.''' - ball25Path = ufe.Path([ - mayaUtils.createUfePathSegment("|world|transform1|proxyShape1"), - usdUtils.createUfePathSegment("/Room_set/Props/Ball_25")]) - ball25Item = ufe.Hierarchy.createItem(ball25Path) + mayaPathSegment = mayaUtils.createUfePathSegment("|world|transform1|proxyShape1") - ball35Path = ufe.Path([ - mayaUtils.createUfePathSegment("|world|transform1|proxyShape1"), - usdUtils.createUfePathSegment("/Room_set/Props/Ball_35")]) - ball35Item = ufe.Hierarchy.createItem(ball35Path) + usdSegmentBall5 = usdUtils.createUfePathSegment("/Ball_set/Props/Ball_5") + ball5Path = ufe.Path([mayaPathSegment, usdSegmentBall5]) + ball5Item = ufe.Hierarchy.createItem(ball5Path) - ufeSelectionList = ufe.Selection() - ufeSelectionList.append(ball25Item) - ufeSelectionList.append(ball35Item) + usdSegmentBall3 = usdUtils.createUfePathSegment("/Ball_set/Props/Ball_3") + ball3Path = ufe.Path([mayaPathSegment, usdSegmentBall3]) + ball3Item = ufe.Hierarchy.createItem(ball3Path) - parentPath = ufe.Path([ - mayaUtils.createUfePathSegment("|world|transform1|proxyShape1"), - usdUtils.createUfePathSegment("/Room_set/Props")]) + usdSegmentProps = usdUtils.createUfePathSegment("/Ball_set/Props") + parentPath = ufe.Path([mayaPathSegment, usdSegmentProps]) parentItem = ufe.Hierarchy.createItem(parentPath) parentHierarchy = ufe.Hierarchy.hierarchy(parentItem) - parentChildrenPre = parentHierarchy.children() - self.assertEqual(len(parentChildrenPre), 35) + self.assertEqual(len(parentChildrenPre), 6) newGroupName = ufe.PathComponent("newGroup") + # get the USD stage + stage = mayaUsd.ufe.getStage(str(mayaPathSegment)) + + # set the edit target to balls.usda + layer = stage.GetLayerStack()[1] + self.assertEqual("ballset.usda", layer.GetDisplayName()) + stage.SetEditTarget(layer) + + ufeSelectionList = ufe.Selection() + ufeSelectionList.append(ball5Item) + ufeSelectionList.append(ball3Item) + groupCmd = parentHierarchy.createGroupCmd(ufeSelectionList, newGroupName) groupCmd.execute() parentChildrenPost = parentHierarchy.children() - self.assertEqual(len(parentChildrenPost), 34) + self.assertEqual(len(parentChildrenPost), 5) # The command will now append a number 1 at the end to match the naming # convention in Maya. @@ -95,26 +100,25 @@ def testUsdGroup(self): childPaths = set([child.path() for child in parentChildrenPost]) self.assertTrue(newGroupPath in childPaths) - self.assertTrue(ball25Path not in childPaths) - self.assertTrue(ball35Path not in childPaths) + self.assertTrue(ball5Path not in childPaths) + self.assertTrue(ball3Path not in childPaths) groupCmd.undo() parentChildrenUndo = parentHierarchy.children() - self.assertEqual(len(parentChildrenUndo), 35) + self.assertEqual(len(parentChildrenUndo), 6) childPathsUndo = set([child.path() for child in parentChildrenUndo]) self.assertTrue(newGroupPath not in childPathsUndo) - self.assertTrue(ball25Path in childPathsUndo) - self.assertTrue(ball35Path in childPathsUndo) + self.assertTrue(ball5Path in childPathsUndo) + self.assertTrue(ball3Path in childPathsUndo) groupCmd.redo() parentChildrenRedo = parentHierarchy.children() - self.assertEqual(len(parentChildrenRedo), 34) + self.assertEqual(len(parentChildrenRedo), 5) childPathsRedo = set([child.path() for child in parentChildrenRedo]) self.assertTrue(newGroupPath in childPathsRedo) - self.assertTrue(ball25Path not in childPathsRedo) - self.assertTrue(ball35Path not in childPathsRedo) - + self.assertTrue(ball5Path not in childPathsRedo) + self.assertTrue(ball3Path not in childPathsRedo) diff --git a/test/lib/ufe/testParentCmd.py b/test/lib/ufe/testParentCmd.py index 74e21e714c..38df4399dc 100644 --- a/test/lib/ufe/testParentCmd.py +++ b/test/lib/ufe/testParentCmd.py @@ -20,7 +20,7 @@ from ufeTestUtils.testUtils import assertVectorAlmostEqual import ufe - +import mayaUsd.ufe import maya.cmds as cmds import unittest @@ -51,7 +51,7 @@ class ParentCmdTestCase(unittest.TestCase): '''Verify the Maya parent command on a USD scene.''' pluginsLoaded = False - + @classmethod def setUpClass(cls): if not cls.pluginsLoaded: @@ -85,6 +85,17 @@ def testParentRelative(self): [shapeSegment, usdUtils.createUfePathSegment("/pCylinder1")]) cylinderItem = ufe.Hierarchy.createItem(cylinderPath) + # get the USD stage + stage = mayaUsd.ufe.getStage(str(shapeSegment)) + + # check GetLayerStack behavior + self.assertEqual(stage.GetLayerStack()[0], stage.GetSessionLayer()) + self.assertEqual(stage.GetEditTarget().GetLayer(), stage.GetSessionLayer()) + + # set the edit target to the root layer + stage.SetEditTarget(stage.GetRootLayer()) + self.assertEqual(stage.GetEditTarget().GetLayer(), stage.GetRootLayer()) + # The cube is not a child of the cylinder. cylHier = ufe.Hierarchy.hierarchy(cylinderItem) cylChildren = cylHier.children() @@ -169,6 +180,17 @@ def testParentAbsolute(self): [shapeSegment, usdUtils.createUfePathSegment("/pCylinder1")]) cylinderItem = ufe.Hierarchy.createItem(cylinderPath) + # get the USD stage + stage = mayaUsd.ufe.getStage(str(shapeSegment)) + + # check GetLayerStack behavior + self.assertEqual(stage.GetLayerStack()[0], stage.GetSessionLayer()) + self.assertEqual(stage.GetEditTarget().GetLayer(), stage.GetSessionLayer()) + + # set the edit target to the root layer + stage.SetEditTarget(stage.GetRootLayer()) + self.assertEqual(stage.GetEditTarget().GetLayer(), stage.GetRootLayer()) + # The cube is not a child of the cylinder. cylHier = ufe.Hierarchy.hierarchy(cylinderItem) cylChildren = cylHier.children() @@ -244,57 +266,36 @@ def testParentToProxyShape(self): "|world|mayaUsdProxy1|mayaUsdProxyShape1") shapePath = ufe.Path([shapeSegment]) shapeItem = ufe.Hierarchy.createItem(shapePath) - + spherePath = ufe.Path( [shapeSegment, usdUtils.createUfePathSegment("/pCylinder1/pCube1/pSphere1")]) sphereItem = ufe.Hierarchy.createItem(spherePath) - + + # get the USD stage + stage = mayaUsd.ufe.getStage(str(shapeSegment)) + + # check GetLayerStack behavior + self.assertEqual(stage.GetLayerStack()[0], stage.GetSessionLayer()) + self.assertEqual(stage.GetEditTarget().GetLayer(), stage.GetSessionLayer()) + + # set the edit target to the root layer + stage.SetEditTarget(stage.GetRootLayer()) + self.assertEqual(stage.GetEditTarget().GetLayer(), stage.GetRootLayer()) + # The sphere is not a child of the proxy shape. shapeHier = ufe.Hierarchy.hierarchy(shapeItem) shapeChildren = shapeHier.children() self.assertNotIn("pSphere1", childrenNames(shapeChildren)) - + # Get its world space transform. sphereT3d = ufe.Transform3d.transform3d(sphereItem) sphereWorld = sphereT3d.inclusiveMatrix() sphereWorldListPre = matrixToList(sphereWorld) - + # Parent sphere to proxy shape in absolute mode (default), using UFE - # path strings. - cmds.parent("|mayaUsdProxy1|mayaUsdProxyShape1,/pCylinder1/pCube1/pSphere1", "|mayaUsdProxy1|mayaUsdProxyShape1") - - # Confirm that the sphere is now a child of the proxy shape. - shapeChildren = shapeHier.children() - self.assertIn("pSphere1", childrenNames(shapeChildren)) - - # Undo: the sphere is no longer a child of the proxy shape. - cmds.undo() - - shapeChildren = shapeHier.children() - self.assertNotIn("pSphere1", childrenNames(shapeChildren)) - - # Redo: confirm that the sphere is again a child of the proxy shape. - cmds.redo() - - shapeChildren = shapeHier.children() - self.assertIn("pSphere1", childrenNames(shapeChildren)) - - # Confirm that the sphere's world transform has not changed. Must - # re-create the item, as its path has changed. - sphereChildPath = ufe.Path( - [shapeSegment, usdUtils.createUfePathSegment("/pSphere1")]) - sphereChildItem = ufe.Hierarchy.createItem(sphereChildPath) - sphereChildT3d = ufe.Transform3d.transform3d(sphereChildItem) - - sphereWorld = sphereChildT3d.inclusiveMatrix() - assertVectorAlmostEqual( - self, sphereWorldListPre, matrixToList(sphereWorld), places=6) - - # Undo. - cmds.undo() - - shapeChildren = shapeHier.children() - self.assertNotIn("pSphere1", childrenNames(shapeChildren)) + # path strings.Expect the exception happens + with self.assertRaises(RuntimeError): + cmds.parent("|mayaUsdProxy1|mayaUsdProxyShape1,/pCylinder1/pCube1/pSphere1", "|mayaUsdProxy1|mayaUsdProxyShape1") @unittest.skipIf(os.getenv('UFE_PREVIEW_VERSION_NUM', '0000') < '2013', 'testIllegalChild only available in UFE preview version 0.2.13 and greater') def testIllegalChild(self): @@ -328,6 +329,17 @@ def testAlreadyChild(self): parent = ufe.Hierarchy.hierarchy(parentItem) childrenPre = parent.children() + # get the USD stage + stage = mayaUsd.ufe.getStage(str(shapeSegment)) + + # check GetLayerStack behavior + self.assertEqual(stage.GetLayerStack()[0], stage.GetSessionLayer()) + self.assertEqual(stage.GetEditTarget().GetLayer(), stage.GetSessionLayer()) + + # set the edit target to the root layer + stage.SetEditTarget(stage.GetRootLayer()) + self.assertEqual(stage.GetEditTarget().GetLayer(), stage.GetRootLayer()) + # The sphere is not a child of the cylinder self.assertNotIn("pSphere1", childrenNames(childrenPre)) diff --git a/test/lib/ufe/ufeTestUtils/mayaUtils.py b/test/lib/ufe/ufeTestUtils/mayaUtils.py index d221190bb7..5c8379bee9 100644 --- a/test/lib/ufe/ufeTestUtils/mayaUtils.py +++ b/test/lib/ufe/ufeTestUtils/mayaUtils.py @@ -157,6 +157,10 @@ def openAppleBiteScene(): filePath = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "test-samples", "appleBite", "appleBite.ma" ) cmds.file(filePath, force=True, open=True) +def openGroupBallsScene(): + filePath = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "test-samples", "groupBalls", "ballset.ma" ) + cmds.file(filePath, force=True, open=True) + def previewReleaseVersion(): '''Return the Maya Preview Release version. From 23d2f9bac3143198fa23e65fa6d32ea5de56ddf2 Mon Sep 17 00:00:00 2001 From: Hamed Sabri Date: Tue, 21 Jul 2020 11:10:13 -0400 Subject: [PATCH 4/6] put back the test codes that I removed earlier. --- test/lib/ufe/testParentCmd.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/test/lib/ufe/testParentCmd.py b/test/lib/ufe/testParentCmd.py index 38df4399dc..a352219de9 100644 --- a/test/lib/ufe/testParentCmd.py +++ b/test/lib/ufe/testParentCmd.py @@ -297,6 +297,39 @@ def testParentToProxyShape(self): with self.assertRaises(RuntimeError): cmds.parent("|mayaUsdProxy1|mayaUsdProxyShape1,/pCylinder1/pCube1/pSphere1", "|mayaUsdProxy1|mayaUsdProxyShape1") + # Confirm that the sphere is now a child of the proxy shape. + shapeChildren = shapeHier.children() + self.assertIn("pSphere1", childrenNames(shapeChildren)) + + # Undo: the sphere is no longer a child of the proxy shape. + cmds.undo() + + shapeChildren = shapeHier.children() + self.assertNotIn("pSphere1", childrenNames(shapeChildren)) + + # Redo: confirm that the sphere is again a child of the proxy shape. + cmds.redo() + + shapeChildren = shapeHier.children() + self.assertIn("pSphere1", childrenNames(shapeChildren)) + + # Confirm that the sphere's world transform has not changed. Must + # re-create the item, as its path has changed. + sphereChildPath = ufe.Path( + [shapeSegment, usdUtils.createUfePathSegment("/pSphere1")]) + sphereChildItem = ufe.Hierarchy.createItem(sphereChildPath) + sphereChildT3d = ufe.Transform3d.transform3d(sphereChildItem) + + sphereWorld = sphereChildT3d.inclusiveMatrix() + assertVectorAlmostEqual( + self, sphereWorldListPre, matrixToList(sphereWorld), places=6) + + # Undo. + cmds.undo() + + shapeChildren = shapeHier.children() + self.assertNotIn("pSphere1", childrenNames(shapeChildren)) + @unittest.skipIf(os.getenv('UFE_PREVIEW_VERSION_NUM', '0000') < '2013', 'testIllegalChild only available in UFE preview version 0.2.13 and greater') def testIllegalChild(self): '''Parenting an object to a descendant must report an error.''' From 54ed18ab42a4b8586e7d41f0f95f41c7acb7fa80 Mon Sep 17 00:00:00 2001 From: Hamed Sabri Date: Tue, 21 Jul 2020 14:31:06 -0400 Subject: [PATCH 5/6] Make MacOS/Linux compiler happy by changing the initializing order . --- lib/mayaUsd/ufe/UsdUndoInsertChildCommand.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mayaUsd/ufe/UsdUndoInsertChildCommand.cpp b/lib/mayaUsd/ufe/UsdUndoInsertChildCommand.cpp index c6e4db0616..3f3d3240c8 100644 --- a/lib/mayaUsd/ufe/UsdUndoInsertChildCommand.cpp +++ b/lib/mayaUsd/ufe/UsdUndoInsertChildCommand.cpp @@ -56,8 +56,8 @@ UsdUndoInsertChildCommand::UsdUndoInsertChildCommand(const UsdSceneItem::Ptr& pa const UsdSceneItem::Ptr& child, const UsdSceneItem::Ptr& /* pos */) : Ufe::UndoableCommand() - , _ufeSrcItem(child) , _stage(child->prim().GetStage()) + , _ufeSrcItem(child) , _usdSrcPath(child->prim().GetPath()) { const auto& childPrim = child->prim(); From e123bad7942ab2dd0e392e481f18786c79e9e01a Mon Sep 17 00:00:00 2001 From: Hamed Sabri Date: Tue, 28 Jul 2020 08:14:00 -0400 Subject: [PATCH 6/6] change required version to 2018. --- test/lib/ufe/test-samples/groupBalls/ballset.ma | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/lib/ufe/test-samples/groupBalls/ballset.ma b/test/lib/ufe/test-samples/groupBalls/ballset.ma index 5034046995..048d42e33d 100644 --- a/test/lib/ufe/test-samples/groupBalls/ballset.ma +++ b/test/lib/ufe/test-samples/groupBalls/ballset.ma @@ -1,8 +1,8 @@ -//Maya ASCII 2020 scene +//Maya ASCII 2018 scene //Name: ballset.ma //Last modified: Mon, Jul 20, 2020 11:08:40 PM //Codeset: 1252 -requires maya "2020"; +requires maya "2018"; requires -nodeType "mayaUsdProxyShape" -dataType "pxrUsdStageData" "mayaUsdPlugin" "1.0"; currentUnit -l centimeter -a degree -t film; fileInfo "application" "maya";