On 24/03/2015 at 06:55, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R16
Platform: Windows ;
Language(s) : C++ ;
---------
Hi all,
I'm working on a c++ plugin which extracts certain types of scene data. Long story short, I have a HairObject from the scene and want the curves for each generated hair strand. For instance, with a hair object that has HAIRSTYLE_HAIR_COUNT = 1000 and HAIRSTYLE_HAIR_SEGMENTS = 3, I'd end up with 4000 points arranged into segments.
If I force generation by setting HAIRSTYLE_GENERATE to HAIRSTYLE_GENERATE_SPLINE (through the hair object's properties panel in C4D) I get the results I want as a LineObject in the hairobject's cache. This data works fine for my purposes. However, I don't want a theoretical user of my plugin to have to do this manually. For one thing, it tends to kill C4D performance on the one large example I have here. I would like to generate this data on demand when the plugin command is launched.
I was hoping the HairObject::GenerateHair function would do the trick, but I haven't been able to pass it any arguments that don't result in a crash. Besides which, it seems to generate a HairGuides object rather than the LineObject I would expect.
Hope this is possible, and that someone out there has experience with this! Thanks in advance,
- Sean