-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[usdMaya] Adding an attribute converter for UsdGeom purpose. #215
[usdMaya] Adding an attribute converter for UsdGeom purpose. #215
Conversation
Filed as internal issue #147140. |
25e7a00
to
6d49352
Compare
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.
Passing along some notes from our sets team. Thanks!
@@ -0,0 +1,84 @@ | |||
// | |||
// Copyright 2016 Pixar |
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.
2018 :)
|
||
TF_DEFINE_PRIVATE_TOKENS( | ||
_tokens, | ||
(USDGeom_purpose) |
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.
We think naming the attribute just "USD_purpose" would be preferable, since it'd be more consistent with the other attributes the importer and exporter look for. Is it important that we indicate that this is a UsdGeom schema thing in the name of this token?
@@ -0,0 +1,83 @@ | |||
#!/pxrpythonsubst | |||
# | |||
# Copyright 2016 Pixar |
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.
2018
|
||
def testImport(self): | ||
""" | ||
Tests that the built-in metadata attribute converters can import |
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.
Could we update the docstring here as well?
from pxr import Usd, UsdGeom | ||
|
||
|
||
class testUsdMetadataAttributeConverters(unittest.TestCase): |
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.
Could we update the test fixture name to match the test name?
|
||
# Testing that there is no authored attribute | ||
geom4 = UsdGeom.Imageable(newUsdStage.GetPrimAtPath('/World/pCube4')) | ||
self.assertEqual(geom4.GetPurposeAttr().HasAuthoredValueOpinion(), False) |
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.
Same as above, this could be: self.assertFalse(geom4.GetPurposeAttr().HasAuthoredValueOpinion()
self.assertEqual(cmds.getAttr('pCube3.USDGeom_purpose'), 'proxy') | ||
|
||
# pCube4 does not have a purpose attribute | ||
self.assertEqual(cmds.objExists('pCube4.USDGeom_purpose'), False) |
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.
Could we change this to use self.assertFalse(...)
instead?
Signed-off-by: Pal Mezei <palm@lumapictures.com>
6d49352
to
64948e5
Compare
@sunyab thanks for the feedback! I addressed all the concerns, please let me know if you need anything else change. |
[usdMaya] Adding an attribute converter for UsdGeom purpose.
This is great! I just ran into this feature by accident. Could it be added to the documentation? |
Hi Tim!
Good call. You should find documentation for it in the 0.8.4 user docs,
which we'll be pushing out soon.
…--spiff
On Tue, Feb 27, 2018 at 4:36 PM, Tim Hoff ***@***.***> wrote:
This is great! I just ran into this feature by accident. Could it be added
to the documentation?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#215 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AF7qaFPK_GINEHR-vuw-BhZFn6lLYxqSks5tZJ-dgaJpZM4NnMq3>
.
|
Perfect, thanks Spiff!
|
Description of Change(s)
The change adds an attribute converter for the purpose attribute on UsdGeomImageable. This makes setting up proxies for usdview / katana way simpler, and users don't have to implement it for themselves.