Cant save ParicleFX scene's in DUF format...

foleyprofoleypro Posts: 442
edited December 1969 in Daz SDK Developer Discussion

Ok in 4.5 when trying to save a scene in duf format it failes to save any of the ParticleFX components...
"Executing DAZ Script file: C:/Documents and Settings/Brian/My Documents/DAZ 3D/Studio/My Library/Particles/effects/dragonfire/dragonFire.dsa
WARNING: Object::disconnect: Unexpected null parameter
WARNING: Object::disconnect: Unexpected null parameter
WARNING: Object::disconnect: Unexpected null parameter
WARNING: Object::disconnect: Unexpected null parameter
WARNING: Object::disconnect: Unexpected null parameter
WARNING: Object::disconnect: Unexpected null parameter
WARNING: Object::disconnect: Unexpected null parameter
WARNING: Object::disconnect: Unexpected null parameter
WARNING: Object::disconnect: Unexpected null parameter
WARNING: Object::disconnect: Unexpected null parameter
WARNING: Object::disconnect: Unexpected null parameter
WARNING: Object::disconnect: Unexpected null parameter
WARNING: Object::disconnect: Unexpected null parameter
WARNING: Object::disconnect: Unexpected null parameter
WARNING: Object::disconnect: Unexpected null parameter
WARNING: Object::disconnect: Unexpected null parameter
WARNING: Object::disconnect: Unexpected null parameter
WARNING: Object::disconnect: Unexpected null parameter
Loaded image yellowOrangeFireSmooth2.jpg
Loaded image solidFlame1.jpg
Script executed successfully.
Executing DAZ Script file: C:/Documents and Settings/Brian/My Documents/DAZ 3D/Studio/My Library/Particles/effects/dragonfire/gojiraFire.dsa
Ran tdlmake on image C:/Documents and Settings/Brian/My Documents/DAZ 3D/Studio/My Library/Runtime/textures/Particles/dragonfire/yellowOrangeFireSmooth2.jpg
Ran tdlmake on image C:/Documents and Settings/Brian/My Documents/DAZ 3D/Studio/My Library/Runtime/textures/Particles/dragonfire/solidFlame1.jpg
WARNING: Object::disconnect: Unexpected null parameter
WARNING: Object::disconnect: Unexpected null parameter
WARNING: Object::disconnect: Unexpected null parameter
WARNING: Object::disconnect: Unexpected null parameter
WARNING: Object::disconnect: Unexpected null parameter
WARNING: Object::disconnect: Unexpected null parameter
WARNING: Object::disconnect: Unexpected null parameter
WARNING: Object::disconnect: Unexpected null parameter
WARNING: Object::disconnect: Unexpected null parameter
WARNING: Object::disconnect: Unexpected null parameter
WARNING: Object::disconnect: Unexpected null parameter
WARNING: Object::disconnect: Unexpected null parameter
WARNING: Object::disconnect: Unexpected null parameter
WARNING: Object::disconnect: Unexpected null parameter
WARNING: Object::disconnect: Unexpected null parameter
WARNING: Object::disconnect: Unexpected null parameter
WARNING: Object::disconnect: Unexpected null parameter
WARNING: Object::disconnect: Unexpected null parameter
Loaded image WhiteToOrangeGradient.jpg
Loaded image square_halo_8_128.jpg
Script executed successfully.
Ran tdlmake on image C:/Documents and Settings/Brian/My Documents/DAZ 3D/Studio/My Library/Runtime/textures/Particles/GradientTextures/WhiteToOrangeGradient.jpg
Ran tdlmake on image C:/Documents and Settings/Brian/My Documents/DAZ 3D/Studio/My Library/Runtime/textures/Particles/GradientTextures/square_halo_8_128.jpg
Saved image: D:\Particlefx\SourceCode\Projects\Resources\Fire\PFXFire_TEST.duf.png
*** Scene Cleared ***

Comments

  • rbtwhizrbtwhiz Posts: 2,171
    edited December 1969

    You have to provide the code to support your custom data. Examples for doing so are provided in the SDK samples.

    -Rob

  • Alessandro MastronardiAlessandro Mastronardi Posts: 2,593
    edited December 1969

    In my opinion the SDK examples provided, and especially this one related to saving to .duf's, are unnecessarily complicated. The example provided is supposed to save a simple quad to a .duf file but use a tons of classes and definitions that make it really difficult to understand, at least for me.
    It would be great if samples would show just the very basic operations with a brief description.

  • Alessandro MastronardiAlessandro Mastronardi Posts: 2,593
    edited December 1969

    To add to this, one thing I noticed in the save customelements example, is that the mycustomshape class is subclassing dzShape (for my needs I'd like that to use dzFacetShape instead).
    So I started making the proper modifications, but just to give an example of how difficult it is to modify the sample, I can't figure out how to get rid or modify the MyNurbGeometry class so that instead of using:

    MyNurbShape *tmpShape=new MyNurbShape();
    MyNurbGeometry *tmpGeometry=qobject_cast(tmpShape->getGeometry());
    tmpGeometry->setupExample();

    I could use:

    MyNurbShape *tmpShape=new MyNurbShape();
    tmpShape->setFacetMesh(someFaceMesh);

    This because I should probably edit so many functions (not well documented either) in the mycustomshape files that at this point of development just give me the cripples.

  • Alessandro MastronardiAlessandro Mastronardi Posts: 2,593
    edited December 1969

    Well, can't stop arguing this morning, sorry about that: :)

    To resume what I wrote earlier, there is possibliy a brief description, or pseudo code that would illustrated which minimal steps are needed to save extra geometry?

    I mean, say you have a DzNode->DzObject->DzFacetShape. DzFacetShape has some mesh applied to it (basically some lines, or points or else) through setFacetMesh(someFaceMesh);
    The above node is added to the scene and all shows up properly.
    Now, what are the minimal, necessary steps needed to save such node with all the geometry information attached to it? And that obviously would load back?
    The mycustomshape class has a total of 42 functions, is it possible that those are all needed? I'd have expected a much simpler approach...

  • dtammdtamm Posts: 126
    edited December 1969

    I agree that saving(actually its the reading that is the hard part) is complicated. Dot Duf is a lot better from a users perspective, but not a developers.

    But help me understand what you are trying to do? What are you creating that is custom? What classes are you overriding and what new classes have data members that need to save?

  • Alessandro MastronardiAlessandro Mastronardi Posts: 2,593
    edited December 1969

    dtamm said:

    But help me understand what you are trying to do? What are you creating that is custom? What classes are you overriding and what new classes have data members that need to save?

    I am actually subclassing DzFacetShape so that a DzNode->DzObject->DzFacetShape (this last, again, is subclassed) contains some custom geometry data.
    Studying the SDK sample provided (where BTW the myCustomShape is subclassing DzShape, and not DzFacetShape;), I've not been able to replicate the behaviour of saving such data.

  • dtammdtamm Posts: 126
    edited December 1969

    How complicated is this geometry data? Some parameters or complex data structures?

  • Alessandro MastronardiAlessandro Mastronardi Posts: 2,593
    edited December 1969

    The geometry data are basically lines, and the data is organized in a vector struct.

  • dtammdtamm Posts: 126
    edited December 1969

    In any case, I am pretty sure that you will have to also provide a subclass of DzFacetMesh simply so that you can hook up to DzExtraGeometryIO::createShape

  • Alessandro MastronardiAlessandro Mastronardi Posts: 2,593
    edited December 1969

    I'll try that, thanks.

  • dtammdtamm Posts: 126
    edited December 1969

    I went and compiled the sample projects and noticed that the custom shape one crashes(embarrassingly) when loading something that has the custom shape/mesh. Oops.

    The workaround is to change the following function:

    
    DzGeometry* MyNurbGeometryIO::createGeometry()const
    {
     MyNurbGeometry* geom = new MyNurbGeometry();
     geom->ref();
     return geom;
    }
    
  • dtammdtamm Posts: 126
    edited December 1969

    Ok, it does work to derive from DzFacetMesh. I changed the sample to the following and it works as expected:

    
     class MyNurbGeometry : public DzFacetMesh {
      Q_OBJECT
     friend class MyNurbGeometryIO;
    public:
     MyNurbGeometry();
     ~MyNurbGeometry();
    
     void tesselate(DzFacetMesh*);
    
    public slots:
     void setupExample();
    
    private:
     struct Data;
     Data* m_data;
    };
    
    

    Of course this means that your shape/mesh will save all the information that comes with DzFacetMesh(vertices, facets, groups, uvs, etc).

  • Alessandro MastronardiAlessandro Mastronardi Posts: 2,593
    edited December 1969

    Thanks, will try that!

Sign In or Register to comment.