How to access Spline Node Handles with Scripts

   2324   3   1
User Avatar
Member
2041 posts
Joined: Sept. 2015
Offline
Hello,

I was wondering if anyone knows if its possible to access the handles of a spline node?

I thought they might be in the “Handle List” window, but there doesn't seem to be anything there. I've tried doing stuff like dragging and dropping the spline into that window perhaps to make it show up but to no avail.

My set up consists of Fetching a wave form channel created using the animation editor.

When that is run through the spline node with compute knots option off you get the blue boxes ( as in the image below ) that can be grabbed with mouse and quickly moved around ( This is going on in the motionfx window).

Here, we are able to reshape the curve much more quickly than if working in the animation window.

The only “issue” is that if you want to keep the changes you've made you basically have to lock your parameter; and not use those set of nodes again ( like in my image below ). You have to lay down another set of nodes if you want to do the same to another wave form or test other options.

Selecting the compute knots again will cause you to loose your newly changed wave form.

Would be nice if we could write and apply scripts to those spline node handles; thereby having a set of scripts for different changes using only one set of nodes ( like in the image below ).

If you hover the mouse over the boxes a square bracket will show up. Like all the red letter text I've written over the screenshot below.

The first number seems to indicate the list number of the box followed by a blank space before the end braket.

Seems like there is some reference to these “co-ordinates/object of the boxes” but I can't seem to find/figure out a way to access them.

If anyone could chime in with their thoughts its much appreciated.

Thank you

Attachments:
Spline-node-handles-in-motionfx window.jpg (128.7 KB)

User Avatar
Member
8568 posts
Joined: July 2007
Offline
BabaJ

My set up consists of Fetching a wave form channel created using the animation editor
….
Here, we are able to reshape the curve much more quickly than if working in the animation window….

let's take it from other end, while you are still in Animation Editor you can select points/segments on your curve, let's say select all points
then cog menu/Edit/Bake Keyframes On Selected Segments
uncheck Resample Segments
check Refit Segments, Apply, or you can play with tolerance
that will simplify your curves in Animation Editor and maybe you will not need to go to CHOPs
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
2041 posts
Joined: Sept. 2015
Offline
Thanks for this suggestion tamte,

Another way I can use to form my waveforms.

But I am guessing from your reply the answer is no, we can't “access” those “handles” like we can with parameters and scripts?

I can understand why you say I can simplify my curves from the example I gave, but I am actually making a digital asset whereby I have several options to create waveforms in specific and “repeatable” ways.

The image I provided of my Chop is but one group of nodes I was working on at the moment. Other groups of nodes I have lend themselves to each leaning towards creating certain types of waveform patterns. So I'm not neccessarily trying to simplify waveforms, but rather looking at creating specific forms.

This particular group I was working on was to include making use of the forms I can get with the Animation Editor, by itself and in conjunction with Chop nodes like, cycle, sequence, limit, filter, etc.

The benefit of using the chop nodes is that they have parameters that with the set ups I am making I can adjust the waveform patterns through those paramters with scripts.

This gives me the control I want in that the scripts can act like “presets”, and I can alter those presets or even return to them through Python functions.

The waveforms I am making are not “one-ups” so this ability to script the values that control my waveforms is important for my intended purposes.

The option you gave me was a good addition to explore yet, and this was a question I was going to ask at some point, I cannot seem to find a way to be able to script the values of the curve in the animation editor like the handles and points of a beziers' value, slope and acceleration. I have to do this manually.

This isn't a complaint or even a feature request. I'm just exploring ways to be able to scipt my waveforms entirely if I can through Python functions.

For the animation editor portion of my asset at the moment I am making use of the making clips through MotionFX > Create Clip into a channel node;

Locking down the parameter of that waveform being careful when scoping and copying it ( to make further iterations in another channel ), of not changing it to preserve it's original shape so I can return to using its original form.

Another way I am also using is exporting the waveform from the animation editor into a file using “Export Displayed Channels as…”.

This works in preserving a shape yet when importing it comes back additional handles and control points that are hard to remove without altering the original shape.

So at the moment when using the animation editor of either creating clip or saving to file, I am building a “libray” of different waveforms that I can bring back in and repeatably through different script function arguments change the waveforms through the Chop nodes.

Again, this isn't a complaint but it would be nice to script a wave form in the animation editor like a bezier curve defining the frames, values, slope and acceleration with that script.

Thanks for your feedback and suggestion
User Avatar
Member
2041 posts
Joined: Sept. 2015
Offline
Just posting here as an addendum in case others might be working with waveform shaping and are following this post.

In my “waveform digital asset” tool I am making; In the Chop I start with a “base” waveform. I might start with a wave node that can give me a sine or gaussian form or I could start with a pulse node and define a series of pulse to make a basic shape. Also, as mentioned previously I was currently working with importing through a fetch node or defining a waveform in a channel node with the animation editor.

In all these cases I then run the basic waveform through a series of chop nodes like the cycle, sequence, trim, stretch, shift, envelope, filter, etc. nodes.

Finally it is run into an export node which is connected to my desired object parameter to control its' motion.

I recently started playing with the spline node as part of that “chain” and noticed how quickly I can make changes and easily adjust parts of the wave in conjuction with the other nodes.

From this I explored how I could possibly save the resulting waveform as a “permanent” wave form.

I couldn't simply lock down the spline node, because that would mean I could no longer use that part of the digital asset since, making any changes to the spline node handles means losing it's previous settings other than trying to manualy set it to the way it was before by memory.

Hence the question in the previous posts about how to script the values of the handles.

Another option I explored was seeing if I could from the export node ( which represents my final waveform shape )get it into the animation editor where I could export it as a file, which saves the shape and could be reused and imported back in with a file node into my Chop.

I was stumped at this point since there appears to be no direct way to take a waveform from the motionfx window into the animation editor and no way to save what is shown in the motionfx window.

I tried scoping the objects parameter ( which is in a state of being “overidden” by the export node ) into the animation editor. Although you can get a parameter into the animation editors channel lister, it won't become “scoped” or rather graphed if it is a parameter that is being “driven” by an export node.

And because it's not graphed you can't save it by exporting to a file or creating a clip.

However, there is a short workaround.

Using a temporary “empty” parameter and make a channel reference to the overidden exported paramater, you can take this referenced parameter and scope/graph it in the animation editor.

From there a clip or export to file can be done.
  • Quick Links