-
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
EMSUSD-249 Refactors relative path dialog options to be more clear #3195
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,6 @@ class usdFileRelative(object): | |
|
||
kMakePathRelativeCheckBox = 'MakePathRelativeTo' | ||
kUnresolvedPathTextField = 'UnresolvedPath' | ||
kResolvedPathTextField = 'ResolvedPath' | ||
|
||
# We will store whether or not the file can be made relative. Used to know when we need | ||
# to update fields. | ||
|
@@ -79,23 +78,20 @@ def uiCreate(cls, parentLayout, relativeToWhat): | |
|
||
topForm = cmds.columnLayout('actionOptionsForm', rowSpacing=5) | ||
|
||
kFileOptionsStr = getMayaUsdString("kFileOptions") | ||
kRelativePathOptionsStr = getMayaUsdString("kRelativePathOptions") | ||
kMakePathRelativeStr = getMayaUsdString("kMakePathRelativeTo" + relativeToWhat) | ||
kMakePathRelativeAnnStr = getMayaUsdString("kMakePathRelativeTo" + relativeToWhat + "Ann") | ||
kUnresolvedPathStr = getMayaUsdString("kUnresolvedPath") | ||
kUnresolvedPathAnnStr = getMayaUsdString("kUnresolvedPathAnn") | ||
kResolvedPathStr = getMayaUsdString("kResolvedPath") | ||
kResolvedPathAnnStr = getMayaUsdString("kResolvedPathAnn") | ||
|
||
optBoxMarginWidth = mel.eval('global int $gOptionBoxTemplateDescriptionMarginWidth; $gOptionBoxTemplateDescriptionMarginWidth += 0') | ||
cmds.setParent(topForm) | ||
cmds.frameLayout(label=kFileOptionsStr, collapsable=False) | ||
cmds.frameLayout(label=kRelativePathOptionsStr, collapsable=False) | ||
widgetColumn = cmds.columnLayout() | ||
cmds.checkBox(cls.kMakePathRelativeCheckBox, label=kMakePathRelativeStr, ann=kMakePathRelativeAnnStr) | ||
|
||
cmds.checkBox(cls.kMakePathRelativeCheckBox, edit=True, changeCommand=cls.onMakePathRelativeChanged) | ||
cmds.textFieldGrp(cls.kUnresolvedPathTextField, label=kUnresolvedPathStr, ann=kUnresolvedPathAnnStr, editable=False) | ||
cmds.textFieldGrp(cls.kResolvedPathTextField, label=kResolvedPathStr, ann=kResolvedPathAnnStr , editable=False) | ||
cls._haveRelativePathFields = True | ||
|
||
return topForm | ||
|
@@ -142,7 +138,6 @@ def uiInit(cls, parentLayout, canBeRelative, relativeToWhat): | |
showPreviewFields = cmds.file(q=True, exists=True) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the two-lines conditional above can be removed, and the showPreviewFields variable above it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wouldn't we still want to show the unresolved field? (Now called Path Preview) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh sorry, the variable is also usedfor the other field, NVM, I thought it was only for the resolved path. |
||
|
||
cmds.textFieldGrp(cls.kUnresolvedPathTextField, edit=True, visible=showPreviewFields) | ||
cmds.textFieldGrp(cls.kResolvedPathTextField, edit=True, visible=showPreviewFields) | ||
|
||
# Only enable fields when make relative is checked. | ||
makePathRelative = cmds.checkBox(cls.kMakePathRelativeCheckBox, query=True, value=True) | ||
|
@@ -220,7 +215,6 @@ def onMakePathRelativeChanged(cls, checked): | |
return | ||
enableFields = cls._canBeRelative and checked | ||
cmds.textFieldGrp(cls.kUnresolvedPathTextField, edit=True, enable=enableFields, text='') | ||
cmds.textFieldGrp(cls.kResolvedPathTextField, edit=True, enable=enableFields, text='') | ||
if enableFields: | ||
cls.updateFilePathPreviewFields(checked) | ||
|
||
|
@@ -261,7 +255,6 @@ def updateFilePathPreviewFields(cls, makePathRelative=None): | |
elif unresolvedPath: | ||
relativePath = mayaUsdLib.Util.getPathRelativeToMayaSceneFile(unresolvedPath) | ||
cmds.textFieldGrp(cls.kUnresolvedPathTextField, edit=True, text=relativePath) | ||
cmds.textFieldGrp(cls.kResolvedPathTextField, edit=True, text=unresolvedPath) | ||
|
||
@classmethod | ||
def selectionChanged(cls, parentLayout, selection): | ||
|
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 think line 39 should also be removed (where this string is set).