I posted a thread with an attached Add_Structure.dsa script showing how to add a Polyline dForce Add-On Modifier using just DAZ Script. It works, but uses an intermediate .obj file - which should not be necessary.
If you execute that script while holding down the Alt key, then instead of creating and importing an.obj file, the script uses DzFacetMesh::addPolyline() to create the Add-On - but I cannot get this to work correctly, so I've started this separate thread to ask for help:
It all works OK, except that when DzAddDForceModifierDynamicSurfaceAddOnAction is done on the resulting structure, it adds the "Simulation" section to the Add-On Node's "General" section in the Parameters Pane, but it does not add the "Simulation" section for the Add-On Node in the Surfaces Pane, so Simulation does not work with it.
And doing this manually makes no difference: Edit > Object > Geometry > Add dForce Modifier: Dynamic Surface Add-On.
It seems that there is something in the way the Add-On is being generated in function local_BuildStructureDirectly() that prevents DzAddDForceModifierDynamicSurfaceAddOnAction from working correctly with its output. Perhaps some things need to be done in a different order? I've tried changing things around, with no success.
The function local_BuildStructureDirectly() uses code from these DAZ Samples (Thanks again Rob!) (of course, they work correctly):
- http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/geometry/generate_plane/start
- http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/geometry/generate_polyline_dynamic_surface_addon/start (this link appears to be broken. It is in the Geometry section of this page of the DAZ website: .../referenceguide/scripting/api_reference/samples/start)
For convenience, I've attached to this post the same files as the other thread: Add_Structure.dsa and Bouncing_Ball_01b.duf
Any help or suggestions will be much appeciated.
P.