Create custom property types?
shoei321
Posts: 113
Is it possible to subclass DzProperty and create my own property types, and customize their presentation in the parameters tab? I need a property that lets the user make a selection of the available morphs on the node that the property resides on. The property would show up in the list of parameters on the object and just display a button, which when clicked would bring up a window listing all the other modifiers on the parent node and let the user make a selection from them. The property would then save the selection of morphs.
What I'm trying to do is very similar to DzNodeProperty, except I want to select morphs/modifiers, not nodes in the scene.
Is this possible?
Thanks
Ivan
Comments
I don't know how to create a custom property type and I imagine getting it to work like native in the UI would be a tough task.
But, I would think you could do what you want with an enum property. At the time your code gets the node of interest, it could clear the property then fill it back up with choices with text taken from the names or labels of the each of the modifiers on the node's object. The node's object also has signals to tell you when the modifiers are added or removed, you would want to connect those to some new method of yours that can do housekeeping on your property to keep it up to date.
[OOPS sorry I missed that you wanted multi-select NM!]
That is totally doable!
1) make your subclass of DzProperty. Works! done! (Well, one step at a time...)
2) make an "edit" function. Basically a DzDialog subclass, that get's called when they click the Settings button
3) Add Styling handling. mesns OnDraw handling I believe, and calling the approprite color/shape style handlers. NO idea what those are, but do know I have glossed over them reading the SDK docs...
Bug dtamm for the intimate details.
absolutely possible though! The SDK is 110% guaranteed to support that. And in more ways than even the Dev's imagined. That's the beauty of how it was designed. One very cool example is the SelectImage button on surfaces - from the drop-menu, you can pick an image file, OR open the LayeredImageEditor to make one... very cool.
How they look is (perhaps?) controlled by the PresenationMgr... ???
or settings to it? Or sending signals to it?
Frankly, I consider my users "lucky" if they get any UI at all.
But yeah, awesome topic! That would be cool! awesome question shoei. I'd also be interested in additional deatils on that!