DzNodeProperty with multiple selection support?

Is it possible for a DzNodeProperty to support multi-node selections?    I don't see anything in the SDK docs for this, so I assume not.

What is the best way to get a property to store a multiple node selection?     Do I extend DzProperty (or DzNodeProperty)?     Are there any examples of how to extend a DzProperty, and handle persistence of its value on save?  

 

 

Comments

  • shoei321shoei321 Posts: 103

    I've got this mostly worked out now, by extending DzProperty and  DzPropertyWidget.   The one issue I'm now having is that the property type doesn't survive a save/load cycle.    When initially added the property shows up correctly as my custom subclass, but when the scene is saved and reloaded it doesn't instantiate properly and shows up as the base class (I've subclassed DzStringProperty).   

     

    How do I preserve the property's class information through a save/reload?  I've declared the custom property and property widget classes in pluginmain.cpp using the DZ_PLUGIN_CLASS_GUID macro, but this didn't solve the problem.

     

    Thanks

     

  • hphoenixhphoenix Posts: 1,095

    Have a look at the "BlackHole" SDK sample.  It has save/load stuff so the new element type can be saved/loaded from DUF files.

  • shoei321shoei321 Posts: 103
    edited July 2017

    I've looked through all the SDK samples, include Blackhole and the various Saving examples.   There are examples for custom nodes, modifiers, materials, but I'm not seeing one that shows how to handle custom property types.  

    It looks like I need to extend one of the IO classes in dzassetextraobjectio.h, but I'm not finding one that handles read/write of custom properties.    The closest match appears to be DzElementPropertyValueIO, but it doesn't have the methods I'd expect.    I think there should be a method like below to handle instantiation of my custom property class on load, but I'm not seeing it : 

    virtual DzProperty*    createProperty() const = 0;

     

    Any suggestions on how to do this?

     

     

     

     

    Post edited by shoei321 on
Sign In or Register to comment.