MultiJoints + Scripting
MultiJoints + Scripting
Is there a certain reason why MultiJoints aren't supported by RF's Python interface? It's not even possible to switch "Simulation" from "Inactive" to "Active".
Thomas Schlick | Next Limit Technologies
Re: MultiJoints + Scripting
Hi Thomas,
just an advice- recently, I had some troubles keying/ switching "Simulation" (thus not by script but by hand) but everything was working fine when doing this on "Dyn Motion", intead,
just an advice- recently, I had some troubles keying/ switching "Simulation" (thus not by script but by hand) but everything was working fine when doing this on "Dyn Motion", intead,
Re: MultiJoints + Scripting
Thanks for the tip. Unfortunately this won't help with MultiJoints, since they're obviously not implemented in the Python API, but I hope this will be changed with the next patch.
Thomas Schlick | Next Limit Technologies
Re: MultiJoints + Scripting
Hi Thomas,
for that specific purpose, you can use an XML import workaround:
Hope that helps until MultiJoints are finally added for scripting.
for that specific purpose, you can use an XML import workaround:
Code: Select all
import os
import tempfile
def setMultiJointSimulation( mjname, status ):
# Compose XML code
xmlcode = '<?xml version="1.0" encoding="UTF-8"?>'
xmlcode += '<!DOCTYPE rfxml><rfxml version="0.2">'
xmlcode += '<nodes>'
xmlcode += '<node name="'
xmlcode += mjname
xmlcode += '" class="MultiJoint"><parameters>'
xmlcode += '<param name="Simulation"><enum_val><string>'
xmlcode += status
xmlcode += '</string></enum_val></param>'
xmlcode += '</parameters></node></nodes></rfxml>'
# Save to temporary file and import
tmp = tempfile.NamedTemporaryFile(suffix=".xml", delete=False)
tmp.write( xmlcode )
tmp.close()
scene.importFromXML(tmp.name,False,True)
os.remove(tmp.name)
scene.paint()
# Example
setMultiJointSimulation( "MultiJoint01", "Inactive" )
Alex Ribao
RealFlow Team
Next Limit Technologies
RealFlow Team
Next Limit Technologies
Re: MultiJoints + Scripting
Hi Alex,
Many thanks for this clever workaround. I've tested it and it works great.

Many thanks for this clever workaround. I've tested it and it works great.

Thomas Schlick | Next Limit Technologies