-
Notifications
You must be signed in to change notification settings - Fork 202
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
Light linking sync #4046
Light linking sync #4046
Conversation
def getIncludeAll(self): | ||
return self._include.cbIncludeAll.isChecked() | ||
|
||
def setIncludeAll(self, value: bool): | ||
self._include.cbIncludeAll.setChecked(value) | ||
|
||
def onIncludeAllToggle(self): | ||
self._collection.GetIncludeRootAttr().Set(self._include.cbIncludeAll.isChecked()) | ||
def updateUI(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eventually, I expect that we will move all code that directly interact with USD out of the UI code and into a "model" that will also "hold" the DCC-specific code or callbacks. So all code currently in UI classes will move in the future.
return | ||
self._updatingUI = True | ||
for prim in prims: | ||
self._collection.GetIncludesRel().AddTarget(prim.GetPath()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example code like this would move to that data-model class. This is necessary to support things like undo/redo
try: | ||
self._deleteBtn.pressed.disconnect(self.onRemoveSelectionFromInclude) | ||
self._deleteBtn.pressed.disconnect(self.onRemoveSelectionFromExclude) | ||
except: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe only catch Exception, not everyhing should be caught?
raise ValueError("Value must be a float or an int")( | ||
"Error: The dragged object is not in the same stage as the collection. Ensure that objects belong to the same stage before adding them" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw this code and wondered if this was code generated by AI?
In any case, error will have to be reported by going through the data-model class to support DCC-specific error reporting mechanisms.
painter = QPainter(self.viewport()) | ||
painter.setPen(QColor(128, 128, 128)) | ||
painter.drawText(self.rect(), Qt.AlignCenter, kNoObjectFoundLabel) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both the paint-override method and the place-holder label method (which were redundant with each other...) are now removed. What is replacing these the place-holders?
from typing import Sequence | ||
from pxr import Usd | ||
|
||
class Host(object): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eventually, the host class should be moved to another place, not in the UI classes, another Python module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unclear to me what is drawing the place-holder texts now.
Synching up this repo with internal content