Rendering to picture viewer problem
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 29/06/2011 at 02:11, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R12
Platform:
Language(s) : C++ ;---------
I have an ObjectData plugin (generator object) which works fine in the editor. However, when I render to the picture viewer, my generated objects aren't rendered.On stepping through the code, it appears that data structures in the plugin class which hold data needed to generate the objects have been re-initialised. This is logical: I understand that when rendering to PV, a clone of the document is rendered, which will copy the plugin class and therefore of course call its constructor and Init() function.
So my question is, how do I (or even can I) make sure that I have the data still available in the cloned document? Should I use an invisible tag to store the data - or will that also be re-initialised? I'm a bit puzzled as to how any object generator works when rendering to the PV if it's being reset whenever it is rendered there. Can anyone shed some light on this?
Many thanks,
Steve
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 29/06/2011 at 07:10, xxxxxxxx wrote:
Any data not stored in the BaseContainer (or as Descriptions) as class member variables must be copied manually. You will need to implement CopyTo(), Read(), and Write() to retain that information between copying, cloning, file saving, file loading. The sequence of events for the clone is something like:
Create new cloned instance
Constructor
Init()
...Descriptions and BaseContainer data are 'cloned'
CopyTo() -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 29/06/2011 at 07:58, xxxxxxxx wrote:
Ahh... right, that makes it clear what's happening. Thanks very much for that. I think CopyTo() is all I need because this data doesn't need to be saved to file.
(Is it just me, or do you ever feel that you solve one problem only for another one to bite you hard? This stuff is just so... well, so much of it to learn!)
Thanks again,
Steve
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 29/06/2011 at 09:44, xxxxxxxx wrote:
Originally posted by xxxxxxxx
(Is it just me, or do you ever feel that you solve one problem only for another one to bite you hard? This stuff is just so... well, so much of it to learn!)
Get used to it, this never stops, even after a decade.
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 29/06/2011 at 10:09, xxxxxxxx wrote:
Originally posted by xxxxxxxx
Originally posted by xxxxxxxx
(Is it just me, or do you ever feel that you solve one problem only for another one to bite you hard? This stuff is just so... well, so much of it to learn!)
Get used to it, this never stops, even after a decade.
Sooooo true.
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 29/06/2011 at 10:12, xxxxxxxx wrote:
Originally posted by xxxxxxxx
Ahh... right, that makes it clear what's happening. Thanks very much for that. I think CopyTo() is all I need because this data doesn't need to be saved to file.
Thanks again,
Steve
At one time it was said that you were required to implement all three but I agree that if you are not saving the data to file but need it when the object is cloned or copied, then you only need CopyTo(). If there are any ramifications, you can always implement Read()/Write() and simply return TRUE but I doubt that is even necessary.
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 29/06/2011 at 12:12, xxxxxxxx wrote:
Originally posted by xxxxxxxx
Get used to it, this never stops, even after a decade.
Oh, I can well believe it