Scripting Dyverso object parameters

Post here anything related to RealFlow that doesn't specifically belong in any of the forums below
Post Reply
FSchmidt
Posts: 14
Joined: Mon Jan 18, 2016 12:00 pm

Scripting Dyverso object parameters

Post by FSchmidt » Thu Sep 28, 2017 9:32 am

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

Thomas Schlick
Posts: 178
Joined: Tue Aug 29, 2017 12:35 pm

Re: Scripting Dyverso object parameters

Post by Thomas Schlick » Fri Sep 29, 2017 2:59 pm

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

Code: Select all

Sphere01.setParameter("DY Friction", 0.8)
Sphere01.setParameter("DY Bounce", 0.8)
Here's another method:

Code: Select all

obj = scene.getObject("Sphere01")
obj.setParameter("DY Friction", 0.8)
obj.setParameter("DY Bounce", 0.5.0)
And this is the description in the "Object" branch of the scripting reference:
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.

Post Reply