Spring Joints (February Sample Script)


https://forum.reallusion.com/Topic436290.aspx
Print Topic | Close Window

By Eric C (RL) - 4 Years Ago
Spring Joints ( Sample Script for February 2020)

In the previous Python of the Month, the Reallusion Python Team introduced the
PopcornFX Sequencer sample script exercise which introduces ways to easily and intuitively manage PopcornFX particle emit time and loop status without using the timeline. 

This time, we'd like to introduce our sixth Python of the Month:
 Spring Joints.  Through this course and its subsequent fundamental courses, you will learn how Spring Joints plugin works in animation, allowing you to apply spring physics to designated bones and props in the scene. The spring effect is calculated using an algorithm that takes into account several physics elements such as stiffness, bounciness, and damping. This plug-in is versatile and can turn any existing bone or prop hierarchy into an active physics spring chain. You can also create a prop chain by attaching various props together and apply spring physics using this plug-in.

*

Spring joints can be used to animated mounted drivers and passengers on moving vehicles.  This script operates and updates in near real-time.
  • You can download the script from the Marketplace
  • To explore how it works, please visit the Python Wiki.
  • To get the source code, please visit our GitHub.
Important Notice: iClone 7.7 is Required!
If you have any questions about the plug-in and the sample code, please feel free to let us know by replying to this post.

Relevant Fundamental Courses

Be sure to read this first to help you understand how this sample plug-in works.
You should familiarize yourself with the following fundamental lessons before you proceed:
  • Transform Math - Access recipes for 3D transformational math dealing with spatial calculations.
  • Rotation Math - Access recipes for 3D rotational math dealing with spatial calculations.
  • Error Handling - Learn to handle and debug show-stopping errors in code.
  • Handling Time - Learn to manage complex timeline features by making a special re-usable class.
  • Icons and Images - Learn to deploy icons and images inside a user interface.
For more courses and links to other Python of the Month activities, please visit here.

Enjoy!

Reallusion Python Team
By Kelleytoons - 3 Years Ago
Eric,

I realize this was a while ago (like over a year ago) but I'm just now trying to understand this and clearly I do not.

I don't suppose you'd have time to take a glance at my project.  It's not set up correctly, that much is clear, but I tried to follow the video the best I could (in the video the vehicle is in two parts but I'm not really sure why that should make a difference, although I can make another part if need be).

https://mega.nz/file/F6ZgzRyC#RRYxTpaxFQnh4ndKpW8I4kJHaQOgczWA4emN17u82vM
By Tugpsx - 3 Years Ago
Looks like you have the character working. remember to select the dummies in order to activate them. Loading your scene and selecting simulation without confirming the node selections will not produce the effect you are looking for. once you select the parent nodes you will have the driver swaying as the jeep moves along.

By Kelleytoons - 3 Years Ago
Sorry, but I really don't get what you are saying.

If I have the root dummy selected BEFORE I run the script and try to move it, it doesn't work.  If I then select the jeep and move it, it doesn't work.  If I try selecting it IN the script (highlighting the root dummy) it doesn't work.

Clearly I need the idiot mode instructions here -- can you say EXACTLY what you mean by "selecting the dummies".  I can't see how to select them anymore than I'm already doing.
By Tugpsx - 3 Years Ago
One sec will make a quick video
1) Select root
2) Launch Spring Joint Plugin
3) Expand Root_dummy
4) Select each dummy





iClone Spring Joint Test

By Kelleytoons - 3 Years Ago
Thanks!

For some reason I did NOT see the checkmark box so when you said "select" I didn't get where to select other than highlighting it.

Okay - now this old man FINALLY gets how it works.
By Tugpsx - 3 Years Ago
So now that you know you can add spring to the shocks of the jeep. Setup a bumpy road and have the jeep tires do collision detection to roll over a bump as your figure performs the physics related reactions. BigGrin
By Ascensi - 2 Years Ago
Hi Eric, considering you might know the limitations of the Character Joints and what joints spring effects it is compatible with, is there any possible way for a CC3 character that has been modified to have additional joints along the spine between the head and Pelvis or hip can have spring effects enabled on them in CC4?

I know this works for the eyes, I've created extra joints for them and later applied spring effects - works awesome! but what about along the spine? does CC4 prevent bones from having Spring effects applied because of naming convention? ie "spine, neck or pelvis"?  I'd like to enable spring effects on custom bones and or potentially use constraints in iC8 to limit movement, thanks.