Digital Art Zone

 
   
2 of 3
2
Saving data with new format.
Posted: 01 December 2012 05:41 PM   [ Ignore ]   [ # 16 ]
New Member
Total Posts:  16
Joined  2009-07-27

thanks alot, that helps.

one more question on 1.

Most convenient way to go for me is MyCustomModifier way, but what asset type should I set to it? Modifier has a special constant for it, but my objects are custom and it seems that existing constants do not fit into the model.

IDzSceneAsset::AssetType MyCustomModifier::getAssetType() const
{
 
return ModifierAsset;
Profile
 
 
Posted: 01 December 2012 05:45 PM   [ Ignore ]   [ # 17 ]
Member
Rank
Total Posts:  95
Joined  2010-12-31
Vasily Levin - 01 December 2012 05:41 PM

thanks alot, that helps.

one more question on 1.

Most convenient way to go for me is MyCustomModifier way, but what asset type should I set to it? Modifier has a special constant for it, but my objects are custom and it seems that existing constants do not fit into the model.

IDzSceneAsset::AssetType MyCustomModifier::getAssetType() const
{
 
return ModifierAsset;

return ModifierAsset;

 

Profile
 
 
Posted: 02 December 2012 04:22 PM   [ Ignore ]   [ # 18 ]
New Member
Total Posts:  16
Joined  2009-07-27

still a problem I return owned assets but write write functions are never called; I register my custom type with

DZ_PLUGIN_CLASS_FACTORYParticleConnectorPARTICLE_CONNECTOR );
DZ_PLUGIN_CLASS_GUIDParticleConnectorIO50DC77CD-6780-4EA3-BDC6-08D8C0C32684 );
DZ_PLUGIN_REGISTER_MODIFIER_EXTRA_OBJECT_IO"Particle_connector"ParticleConnectorIOParticleConnector ); 

what am I missing?

thing to note, when it was registered by DZ_PLUGIN_REGISTER_NODE_EXTRA_OBJECT_IO DS crashed on saving scene somewhere on creationg IO object for extra modifier, and there were no any of my functions on stack trace. When I changed this to DZ_PLUGIN_REGISTER_MODIFIER_EXTRA_OBJECT_IO macros crashes gone, but still no writing for those objects.

Profile
 
 
Posted: 02 December 2012 05:20 PM   [ Ignore ]   [ # 19 ]
New Member
Total Posts:  16
Joined  2009-07-27

can I treat

virtual DzError DzAssetExtraObjectIO::finalizeInstanceQObject *object, const DzFileIOSettings *opts ) const; 

as PostLoadFile in previos saving scheme?

Profile
 
 
Posted: 03 December 2012 10:27 AM   [ Ignore ]   [ # 20 ]
Member
Rank
Total Posts:  95
Joined  2010-12-31
Vasily Levin - 02 December 2012 05:20 PM

can I treat

virtual DzError DzAssetExtraObjectIO::finalizeInstanceQObject *object, const DzFileIOSettings *opts ) const; 
as PostLoadFile in previos saving scheme?

It’s is sort of implied by the header file but yes, finalizeInstance is the last thing called.  Like the following

for all
- applyInstanceToObject
for all
- resolveInstance
for all
- finalizeInstance

 

Profile
 
 
Posted: 04 December 2012 11:30 AM   [ Ignore ]   [ # 21 ]
New Member
Total Posts:  16
Joined  2009-07-27

and what about previous question about write functions never called?

maybe you need more details?

Profile
 
 
Posted: 04 December 2012 11:32 AM   [ Ignore ]   [ # 22 ]
Member
Rank
Total Posts:  95
Joined  2010-12-31
Vasily Levin - 04 December 2012 11:30 AM

and what about previous question about write functions never called?

maybe you need more details?

That I will have to investigate.

Profile
 
 
Posted: 08 December 2012 04:14 PM   [ Ignore ]   [ # 23 ]
New Member
Total Posts:  16
Joined  2009-07-27

One more strange thing, after loading saved file hierarchy structure is lost, do I have to store it by hand and restore on load?

Profile
 
 
Posted: 10 December 2012 10:27 AM   [ Ignore ]   [ # 24 ]
Member
Rank
Total Posts:  95
Joined  2010-12-31
Vasily Levin - 08 December 2012 04:14 PM

One more strange thing, after loading saved file hierarchy structure is lost, do I have to store it by hand and restore on load?

I am unsure what you mean by “saved file hierarchy structure”?

Profile
 
 
Posted: 10 December 2012 10:33 AM   [ Ignore ]   [ # 25 ]
New Member
Total Posts:  16
Joined  2009-07-27

I mean that scene I save has Nodes, child nodes, etc, when I load it it flattens to the list of nodes, I do not see how I could screw it since no reparenting is done on load.

So question is is structure is kept automatically and I actually destroy it on load somehow, or I should specifically do something to restore parent-child relations?

Profile
 
 
Posted: 10 December 2012 10:54 AM   [ Ignore ]   [ # 26 ]
Member
Rank
Total Posts:  95
Joined  2010-12-31
Vasily Levin - 10 December 2012 10:33 AM

I mean that scene I save has Nodes, child nodes, etc, when I load it it flattens to the list of nodes, I do not see how I could screw it since no reparenting is done on load.

So question is is structure is kept automatically and I actually destroy it on load somehow, or I should specifically do something to restore parent-child relations?

I just double checked MyCustomNode put into a hierarchy of nodes, it is working.

Are you setting the names of your node to be unique?  use setName on your dznode

Profile
 
 
Posted: 10 December 2012 10:56 AM   [ Ignore ]   [ # 27 ]
Member
Rank
Total Posts:  95
Joined  2010-12-31

it might be helpful to pm me your duf file so I can take a look at it.

Profile
 
 
Posted: 10 December 2012 11:43 AM   [ Ignore ]   [ # 28 ]
New Member
Total Posts:  16
Joined  2009-07-27

from the smallest particle scene resulting file is still big, would not fit into PM, here is dropbox link.

https://dl.dropbox.com/u/21104304/particles.duf

it is big, but when most autogenerated data is folded it is ok to explore.

Profile
 
 
Posted: 10 December 2012 01:08 PM   [ Ignore ]   [ # 29 ]
Member
Rank
Total Posts:  95
Joined  2010-12-31

Search for the lines in the file that look like:

"scene" {
  
"nodes" [
   {
... 

The first node is the camera and looks fine.
The second node looks fine
The third node has no id or name.  I am pretty sure that is the problem.  Please give all the nodes you create a name, it does not have to be unique.

 

Profile
 
 
Posted: 20 December 2012 07:19 PM   [ Ignore ]   [ # 30 ]
New Member
Total Posts:  16
Joined  2009-07-27

I managed to move significantly futher in my save/load code.

Now I have a question, can I control order of finalize calls for sibling nodes? Or maybe there is some guaranteed order of calls to apply instance, finalize instance?

Profile
 
 
   
2 of 3
2