THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 23/08/2010 at 18:14, xxxxxxxx wrote:
Cinema 4D Version: 11.5
Platform: Windows ;
Language(s) : C++ ;
Let's say I create a model in Cinema 4D, I then export the ASCII data from that model out to a text file. Is it possible to then read that data from within my plugin and recreate that model from within my plugin?
On 23/08/2010 at 20:07, xxxxxxxx wrote:
There shouldn't be a reason that this couldn't be done. The main part is that all of the required information/instructions are in the ASCII data of the text file to faithfully recreate the model that you used to export. If you are not using some standard exchange format but instead something of your own then you need to design the file format, keywords, delimiters, and so on very thoughtfully (and always with future expansion in mind!).
Surely you can read the data and recreate the model using a plugin. There are a few exceptional cases where file reading or adding to a document is prohibited. Check the SDK documentation for the main methods where you intend to perform the operations.
And just in case you are talking about Cinema 4D's Import/Export ASCII data, realize that it ONLY outputs point information: polygon object vertices or uvw vertices, spline points and tangents (Bezier). No polygon information, no other information to rebuild the object. You will get a point cloud for a polygon object with no polygon references into the vertices, for instance.
On 24/08/2010 at 03:55, xxxxxxxx wrote:
There's no problem doing this. My free plugin 'ArrowMaker' does it, except that it doesn't write an ASCII file, it uses the BaseFile WriteString(), WriteReal() etc. functions - it's easier and quicker. But it could have saved everything as ASCII, it would just have taken a lot more effort to implement it that way.
As Robert says, what I found was that you have to know exactly what parameters are needed to recreate the object again; just saving a series of point coordinates would not have worked (or even been possible, given the nature of the object). Also, everything worked fine until I developed the plugin further to allow more parameters, then I had to redo the save/load preset functions to handle more than one type of preset. A little bit of forethought would have saved me a lot of effort in that respect.