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

EMSUSD-1518 As an artist, I want the ability to determine whether a collection includes all objects by default or not #3988

Merged
merged 8 commits into from
Nov 20, 2024

Conversation

barbalt
Copy link
Collaborator

@barbalt barbalt commented Nov 6, 2024

Initial iteration of the new light attributes:

  • Added a new attribute to Usd Lights
  • Lists of included and excluded prims to the light collection
  • Ability to "Include all" which sets the includeRoot light attribute

The main new file is the widget.py under the collection folder. The common folder are for inheriting different Qt classes and themes.

image

@barbalt barbalt force-pushed the barbalt/lights/EMSUSD-1518-include-all branch from 6974ebc to e795d1a Compare November 6, 2024 18:17
@barbalt barbalt self-assigned this Nov 6, 2024
@barbalt barbalt assigned barbalt and unassigned barbalt Nov 6, 2024
### Returns the scaled value.
return float(value) / self.uiScaleFactor

def icon(self, name: str) -> QIcon:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this being used somewhere?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, I can remove the icon function

parentWidget.layout().addWidget(self.widget)

except Exception as ex:
logger.exception(ex)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we need a logger? Can you just use print instead? Maya captures stdout for the Script Editor.

logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)

class LightLinkingCustomControl(object):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please place this in a separate file like all the other custom controls.

Copy link
Collaborator

@seando-adsk seando-adsk left a comment

Choose a reason for hiding this comment

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

custom control should be a separate file.

@barbalt barbalt assigned barbalt and unassigned barbalt Nov 11, 2024
parentWidget.layout().addWidget(self.widget)

except Exception as ex:
print(ex)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not a huge deal but could be a bit more descriptive:
print('Failed to create Light custom control: %s' % (ex))

@barbalt barbalt assigned barbalt and unassigned barbalt Nov 11, 2024
Comment on lines 42 to 58
# Install shared components

set(MAYAUSD_SHARED_COMPONENTS usd-shared-components/src/python/usdSharedComponents)
install(FILES
${MAYAUSD_SHARED_COMPONENTS}/collection/__init__.py
${MAYAUSD_SHARED_COMPONENTS}/collection/widget.py
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/python/usd_shared_components/collection/
)

install(FILES
${MAYAUSD_SHARED_COMPONENTS}/common/__init__.py
${MAYAUSD_SHARED_COMPONENTS}/common/list.py
${MAYAUSD_SHARED_COMPONENTS}/common/persistentStorage.py
${MAYAUSD_SHARED_COMPONENTS}/common/resizable.py
${MAYAUSD_SHARED_COMPONENTS}/common/theme.py
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/python/usd_shared_components/common/
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

As agreed, we won't support this for 2022, so just wrap all this in if(MAYA_APP_VERSION VERSION_GREATER_EQUAL 2023)

@@ -29,6 +29,7 @@ foreach(_SUBDIR ${MAYAUSD_AE_TEMPLATES})
${_SUBDIR}/displayCustomControl.py
${_SUBDIR}/enumCustomControl.py
${_SUBDIR}/imageCustomControl.py
${_SUBDIR}/lightCustomControl.py
Copy link
Collaborator

Choose a reason for hiding this comment

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

Move this one to the section below and just install it only for 2023.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Just remove this one from here (as you have it below).

from .observers import UfeAttributesObserver, UfeConnectionChangedObserver, UsdNoticeListener

import sys
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you need "sys"?

@@ -21,8 +21,10 @@
from .displayCustomControl import DisplayCustomControl
from .materialCustomControl import MaterialCustomControl
from .metadataCustomControl import MetadataCustomControl
from .lightCustomControl import LightLinkingCustomControl
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you could wrap this in a try/except block and set a boolean variable such as lightLinkingSupported. Then at line 649 below only do it when that variable is True.

Copy link
Collaborator

@seando-adsk seando-adsk left a comment

Choose a reason for hiding this comment

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

As agreed we won't support this in 2022.

@barbalt barbalt removed their assignment Nov 19, 2024
@barbalt barbalt self-assigned this Nov 19, 2024
@barbalt barbalt assigned barbalt and unassigned barbalt Nov 20, 2024
@barbalt barbalt added the ready-for-merge Development process is finished, PR is ready for merge label Nov 20, 2024
@seando-adsk seando-adsk added the workflows Related to in-context workflows label Nov 20, 2024
@seando-adsk seando-adsk merged commit eabf4ba into dev Nov 20, 2024
13 of 15 checks passed
@seando-adsk seando-adsk deleted the barbalt/lights/EMSUSD-1518-include-all branch November 20, 2024 15:35
@seando-adsk seando-adsk added shared_components Shared Components (Max / Maya) and removed workflows Related to in-context workflows labels Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge Development process is finished, PR is ready for merge shared_components Shared Components (Max / Maya)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants