-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add a getter function to access _AttrValueWriterMap #1038
Add a getter function to access _AttrValueWriterMap #1038
Conversation
…nvenient to debug it's data.
Filed as internal issue #USD-5705 |
Hi Hamed, Thanks, |
Hi Spiff, No worries and thank you for your comment. Sure, it does make sense. A little busy for the next couple of days but will have the new changes soon after. Thanks, |
- Added a new getter function called GetSparseAttrValueWriters that would return a new std::vector of copies of UsdUtilsSparseAttrValueWriter populated from the map.
pxr/usd/usdUtils/sparseValueWriter.h
Outdated
@@ -279,10 +279,24 @@ class UsdUtilsSparseValueWriter { | |||
} | |||
|
|||
USDUTILS_API | |||
const _AttrValueWriterMap& GetAttrValueWriterMap() const { | |||
_AttrValueWriterMap GetAttrValueWriter() const { |
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.
Thanks @HamedSabri-adsk -- I think @spiffmon (and please correct me here, Spiff) meant that we'd like to not expose _AttrValueWriterMap (a private type) in the public API at all. Folks can now use GetSparseAttrValueWriters that you provided (that's nice, I think!), and the other suggestion was to maybe add an accessor that can provide a single UsdUtilsSparseAttrValueWriter given a name.
@c64kernal Ugh I see. I believe I misunderstood it. In my recenet change, GetAttrValueWriter() returns a copy of _AttrValueWriterMap and thought having it shouldn't be problematic. But sure, I can remove it if _AttrValueWriterMap is not supposed to be exposed at all in the public API.
If I understood this correctly, you would like to have an accessor that takes an UsdAttribute that one can pass to look up _AttrValueWriterMap and return a single UsdUtilsSparseAttrValueWriter if found? |
Yes, exactly - we don't want to expose the type itself in the public interface. Thanks!
That's right (a copy of the held UsdUtilsSparseAttrValueWriter)! It's also fine if you only want to add GetSparseAttrValueWriters() for now if that suits your needs. |
- Add a short description for GetSparseAttrValueWriters function.
@spiffmon Thank you for the feedback. GetAttrValueWriter() is removed. I also thought it may be useful to expose GetSparseAttrValueWriters() to python and add some simple logics in testUsdUtilsSparseValueWriter.py to test it. wrapSparseValueWriter.cpp
This code compiles but when I try to invoke this function in python, I get a "TypeError: No to_python (by-value)" which I am trying to understand what I am doing wrong. testUsdUtilsSparseValueWriter.py
|
Thanks @HamedSabri-adsk -- this looks good. There are a few issues with the formatting and we should out-of-line the function, but I'll take care of those through the merge. Thanks again! Should hopefully land in dev in not too long. |
…erMap Add a getter function to access _AttrValueWriterMap (Internal change: 2039907)
Add a getter function to access _AttrValueWriterMap which makes it convenient to debug it's data.