Quantcast
Channel: Daz Script Developer Discussion - Daz 3D Forums
Viewing all articles
Browse latest Browse all 1036

A script to create a polylines dForce Add-On Modifier for a bouncing ball

$
0
0

In RGincy's excellent dForce thread, I posted an example of a dForce bouncing ball whose polylines Add-On was created in Cinema4D and imported into DAZ Studio via an .obj file.

The attached Add_Structure.dsa script creates and adds the same polylines Add-On, using only DAZ Script - I've posted it here so others can see and use the techniques.  NB: Requires DAZ Studio v4.11.0.236 or later

For this it uses code from the following DAZ Samples (thank you Rob!):

To use this script:

  1. In DAZ Studio v4.11.0.236 or later, open the attached Bouncing_Ball_01b.duf (or create your own equivalent per the instructions in my post in RGincy's thread).
  2. In the Scene Pane, ensure that the "Ball" Node is Selected.
  3. Load the attached Add_Structure.dsa into the Script IDE Pane, and Execute it.

The results should be:

  • An AddOn_Structure.obj file is created (or overwritten!) in the same directory as the .dsa script, and is Imported into DAZ Studio.
  • The new Node "AddOn_Structure" made of polylines is added to the Scene and parented to the "Ball" Node.
  • The new Node has a "dForce Add-On Modifier" added to it.

If you now run the dForce Simulation, you should get the effect shown in the .gif above.

(If you execute the 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 have started a separate thread to ask for help with that).

P.

 


Viewing all articles
Browse latest Browse all 1036

Trending Articles