Hello!
While I was reading the article about programmatically creating and assigning specific materials that @nathanletwory wrote (thanks, by the way!), I had a couple questions as a result of PyCharm nagging at me, as well as looking at the actual API documentation.
To be clear - the script I wrote seems to be working just fine, I just had questions. I’m not sure of the best way to organize this post so… here we go!
Material GUIDs
In the article, Rhino.Render.RenderMaterial.PaintMaterialGuid
was referenced, however in my cases I was looking for the emission type - no big deal as I found it in the Rhino.Render.ContentUuids
class.
When passed in as an argument, it’s being seen as a property
vs. the expected RenderContent
type. I’m not the smartest guy, and admittedly I don’t use the @property decorator all that often, but it looks like that decorator is also used in the RenderMaterial
class. Is ithe difference in behavior (no error was thrown when using the PaintMaterialGuid
property) because RenderMaterial
is subclassing RenderContent
?
ShowContentChooserFlags
and ChangeContexts
As for Rhino.Render.RenderContent.ShowContentChooserFlags.None
, that is being viewed as Any
by the method. Doing some investigation, ShowContentChooserFlags
doesn’t show as a member of that class in the stub library. But the thing that confused me was that it doesn’t show as a member of that class in the API documentation either.
Rather, the docs show it as an enumeration called RenderContent.ShowContentChooserFlags
under the Rhino.Render
module/namespace, while in the stub library it just lives as a class under the Rhino.Render
module.
Same situation for RenderContent.ChangeContexts
Is this just a limitation of stubbing out .NET in Python? I did notice that the None
attribute was commented out for ShowContentChooserFlags
, which does make perfect sense.
Hopefully the above doesn’t appear too derpy. I’ve never really done any .NET development, while on the inverse, I use Python almost daily, so this had me scratching my head.
Thanks for any insight!
-Jason