Hi, we try to script parameters of a Dyverso object (via Dyverso Domain > Elastic) such as "DY Friction", "DY Bounce" and "DY Interaction factor" (listed in the "Dyverso - Particles Interaction" section of the object). However, neither "object.setParameter("DY Friction", 0.1)" nor "dyversoDomain.setParameter("DY Friction", 0.1)" seems to do the trick (object being the name of the object, dyversoDomain the name of the Dyverso domain in our scene). We also did not find the relevant section in the documentation. Are we missing out something? How can we script the dyverso object parameters?
Thanks, all the best, Filipp
Scripting Dyverso object parameters
-
- Posts: 178
- Joined: Tue Aug 29, 2017 12:35 pm
Re: Scripting Dyverso object parameters
Hmmm... No problem here to modify an object's DY interaction parameters through scripting.
In this case, the setParameter( string, any ) command is a property of the object you want to change, not the domain. For an object, named "Sphere01", the commands are, for example
Here's another method:
And this is the description in the "Object" branch of the scripting reference:
In this case, the setParameter( string, any ) command is a property of the object you want to change, not the domain. For an object, named "Sphere01", the commands are, for example
Code: Select all
Sphere01.setParameter("DY Friction", 0.8)
Sphere01.setParameter("DY Bounce", 0.8)
Code: Select all
obj = scene.getObject("Sphere01")
obj.setParameter("DY Friction", 0.8)
obj.setParameter("DY Bounce", 0.5.0)
setParameter( string, any )
–
Set value for the parameter. The parameter name is the one that can be seen in the user interface. It is not case sensitive. The value can be any type that is accepted for the parameters in the user interface. Care must be taken when using this function about the type of the values and the parameter names, a hard type and name check is done reporting the corresponding errors to the user in any case.
Arguments:
Object's parameter name.
Object's parameter value.
Return:
None.