TheHubbit / PyInventor

3D Graphics in Python with Open Inventor
http://thehubbit.github.io/PyInventor
BSD 3-Clause "New" or "Revised" License
16 stars 8 forks source link

How to access constants (enums) #10

Closed hernot closed 5 years ago

hernot commented 5 years ago

Hi

I'm trying to do more complex openInventor scenegraph programatically to display my data. For this i'm utilizing MaterialBinding and the MaterialBinding has constants like SO_PER_VERTEX_INDEXED or SO_PER_FACE_INDEXED, SO_PER_FACE etc

how can i accesse these constants throun inventor python package?

Similar for IndexedFaceSet how to specifiy SO_END_FACE_INDEX

I know that inventor and PyInventor skip the SO_ prefix but event without it constants are not found.

hernot commented 5 years ago

OK Found it. Thy have to be specified as string not as literal enumeration values. One needs to be get acustomed as to the fact that SO_ prefix is to be ommited and that addChild and removeChild are mapped to += and -= operators and that ref() and unref() calls are handled implicitly via weakref (like semantics)

A more comprehensive manual especially about the differences to clasical inventor and So[Qt,Xt,Win] bindings would be apreciable.

At least QIVWidget is embedable without any flaw compared to PiVy SoExaminerVierwer.

TheHubbit commented 5 years ago

Thank you for the feedback and sharing the work-around for enum fields! I will add some description to the getting started wiki page regarding this. Feel free to add anything else you think is useful. With this wrapper I was trying to create something that is closer to Python than C++, which is why group nodes behave like arrays. Glad you found this project useful.

hernot commented 5 years ago

Hi

Inline Response (answers below questions asked) Message sent on Donnerstag, 11.04.2019, 07:49 -0700 by Thomas Moeller:

Thank you for the feedback and sharing the work-around for enum fields! I will add some description to the getting started wiki page regarding this. Feel free to add anything else you think is useful. With this wrapper I was trying to create something that is closer to Python than C++, which is why group nodes behave like arrays. Glad you found this project useful.

Keep up, as it is woriking out of the box compared to PyVy which throws now an than some strange error from PySide binding. Yours is working out of the box.

Best Xristoph