On 30/09/2014 at 03:58, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R14
Platform: Windows ;
Language(s) : C++ ;
---------
What im trying to do at the moment is have my plugin store a polygon object ( just the mesh really ) so that it can be recalled from within the plugin later. Is there an easy way to do this that i
m missing?
What i have at the moment is basically this:
-User clicks a button.
-Plugin iterates through all the points and polygons of the chosen polygon object and stores the vector and index values in base containers.
-Plugin then writes the holding base container to a hyperfile in the plugin directory.
-Object is now stored inside the hyperfile and can be recalled via the plugin at any time.
Next what happens is:
-User clicks another button.
-Plugin reads the holding base container from the hyperfile.
-Plugin iterates through the vectors and indexes stored and applies them to a new PolygonObject ( basically rebuilds the mesh from the data ).
-Plugin inserts this new object into the scene.
This works for the most part although i am working through a couple of issues ( vertex orders i think although i have been careful to recreate all polygons exactly as they were in the original )..
But what i am wondering is, is there an easier way, to just store a PolygonObject to a hyperfile or even inside the plugins BaseContainer? The idea is it has to be retrievable so when the plugin is distributed or used in a different C4D session/document/whatever the objects are available. Is parsing the mesh / rebuilding it in this way the only way to achieve this? Or am i missing an easier way to store an object?