On 02/03/2014 at 11:39, xxxxxxxx wrote:
Originally posted by xxxxxxxx
When you SetContainer(), the data (not the container itself) is then owned by the parent container
This is confusing to me. Because if I create a new container using: BaseContainer myBc1;
This container doesn't have a parent container. Or does it?
If I create a new container like this in the Execute() method of a CD plugin. And run the plugin.
Will this container then be accessable by other plugins for the current session(until I close C4D)?
Or will the end of the scope in the Execute() method of the CD plugin delete that container?
If the container does indeed get deleted by the scope.
I'm wondering if there's a way to create a container that will persist, and not get deleted when created in a CD plugin. For at least as long as the current session?
Or if creating a sub container inside of doc->GetDataInstance() inside of my Execute() method is the only way we can do this?
I know how to write preferences plugins. And that's so far been my favorite way to create global gizmos that can be used as persistant global variables by any plugin or scripts.
I'm essentially using the gizmos in my custom preferences as global variables, or containers.
But people keep talking about storing data in the document using containers. So I'm trying to get a better grasp on that.
I didn't know they were storing things in a sub container of the document's default container.
-ScottA