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

MAYA-123507 - PluginLight needs to use the Light Icon instead of falling back to Xform icon #2406

Merged
merged 2 commits into from
Jun 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 4 additions & 0 deletions cmake/test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,10 @@ finally:
endif()
endforeach()

# Unset any MAYA_MODULE_PATH as we set all the individual variables
# so we don't want to conflict with a MayaUsd module.
set_property(TEST ${test_name} APPEND PROPERTY ENVIRONMENT "MAYA_MODULE_PATH=")

# set all env vars
foreach(pathvar ${ALL_PATH_VARS})
set_property(TEST "${test_name}" APPEND PROPERTY ENVIRONMENT
Expand Down
1 change: 1 addition & 0 deletions lib/mayaUsd/resources/icons/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ if (CMAKE_UFE_V2_FEATURES_AVAILABLE)
MayaReference
Mesh
NurbsPatch
PluginLight
PointInstancer
Points
Scope
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions lib/mayaUsd/ufe/UsdUIInfoHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ Ufe::UIInfoHandler::Icon UsdUIInfoHandler::treeViewIcon(const Ufe::SceneItem::Pt
{ "ALMayaReference", "out_USD_MayaReference.png" }, // Same as mayaRef
{ "Mesh", "out_USD_Mesh.png" },
{ "NurbsPatch", "out_USD_NurbsPatch.png" },
{ "PluginLight", "out_USD_PluginLight.png" },
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oops realized (after running preflight) that I forgot to add the icon here. This makes it work no matter what the USD version.

{ "PointInstancer", "out_USD_PointInstancer.png" },
{ "Points", "out_USD_Points.png" },
{ "Scope", "out_USD_Scope.png" },
Expand Down
1 change: 0 additions & 1 deletion test/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ add_test(
set_property(TEST ${target} APPEND PROPERTY DISABLED True)
set_property(TEST ${target} APPEND PROPERTY LABELS Debugging)
set_property(TEST ${target} APPEND PROPERTY ENVIRONMENT "MAYA_MODULE_PATH=${CMAKE_INSTALL_PREFIX}")
set_property(TEST ${target} APPEND PROPERTY ENVIRONMENT "MAYAUSD_ENABLE_ADD_MAYA_REFERENCE=TRUE")

#
# -----------------------------------------------------------------------------
Expand Down
16 changes: 11 additions & 5 deletions test/lib/ufe/testUIIcons.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

import ufe
import mayaUsd
from pxr import Usd
from pxr import Usd, Tf

from shiboken2 import wrapInstance
from PySide2.QtGui import QIcon
Expand Down Expand Up @@ -85,9 +85,7 @@ def testUIIcons(self):
# All the prim types to test
usdVer = Usd.GetVersion()
primTypes = [
# Prim Type # Icon file name
('ALExamplePolyCubeNode', 'out_USD_UsdTyped.png'),
('ALFrameRange', 'out_USD_UsdTyped.png'),
# Prim Type # Icon file name
('ALMayaReference', 'out_USD_MayaReference.png'),
Copy link
Contributor

Choose a reason for hiding this comment

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

What about the ALMayaReference? Should it be moved too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The schema for that one is in lib, so its always there.

('Backdrop', 'out_USD_UsdTyped.png'),
('BasisCurves', 'out_USD_UsdGeomCurves.png'),
Expand All @@ -114,7 +112,7 @@ def testUIIcons(self):
('NurbsPatch', 'out_USD_NurbsPatch.png'),
('OpenVDBAsset', 'out_USD_UsdGeomXformable.png'),
('PackedJointAnimation', 'out_USD_SkelAnimation.png'),
('PluginLight', 'out_USD_UsdGeomXformable.png' if usdVer >= (0, 21, 11) else 'out_USD_UsdLuxLight.png'),
('PluginLight', 'out_USD_PluginLight.png'),
('PluginLightFilter', 'out_USD_LightFilter.png'),
('PointInstancer', 'out_USD_PointInstancer.png'),
('Points', 'out_USD_Points.png'),
Expand Down Expand Up @@ -146,6 +144,14 @@ def testUIIcons(self):
('PhysicsSphericalJoint', 'out_USD_UsdTyped.png')
])

# Special case for node types which are in an AL schema.
# They aren't available when compiling without the AL plugin.
if Usd.SchemaRegistry.IsConcrete(Tf.Type.FindByName('AL_usd_FrameRange')):
primTypes.extend([
('ALExamplePolyCubeNode', 'out_USD_UsdTyped.png'),
('ALFrameRange', 'out_USD_UsdTyped.png')
])
Comment on lines +147 to +153
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If you build locally without the AL plugin you won't have the schema that defines these two node types.


for ty,iname in primTypes:
prim = self.stage.DefinePrim('/%s' % ty, ty)
ufeIcon = self._getUIInfoIcon(ty)
Expand Down