Recording Keyframes of LightParameters

About Truespace Archives

These pages are a copy of the official truespace forums prior to their removal somewhere around 2011.

They are retained here for archive purposes only.

Recording Keyframes of LightParameters // Tech Forum

1  |  

Post by ivampretti // Aug 17, 2008, 1:27pm

ivampretti
Total Posts: 151
pic
Hi There, as the title says, I whould like to know if is possible to record in keyframes in model side the color light parameter variation controled by an script in the LE.


I want to do an weld process animation, with the intensity of the light controled by a random number, I did the script, is quite simple, but when I tried to record in keyframes, nothing happends. I could see the light variating in the real time render of the model side..


please help - me!

Post by Jack Edwards // Aug 17, 2008, 1:37pm

Jack Edwards
Total Posts: 4062
pic
Keep in mind that Model side (legacy) and Workspace side (new) are really two separate programs that communicate via the bridge and not really compatible. It's generally better to pick one side or the other for your project.

Workspace animations, scripting, and keyframing can be rendered in model side by selecting "Workspace" in the Animation drop down of Model side's render to file dialog. Stan's got a screen shot that he's posted a few times on the forum. But trying to combine Workspace and Model side keyframes is not recommended. If the light animation is already showing up in your realtime display then you should be ok for rendering it via Lightworks (model side) simply by setting the Animation drop down to "Workspace" from "Current Frame Only".

Also keep in mind that if you've used a timer for your script it's not going to be synced to your animation frames. I'm not sure if anyone has written a brick that returns the current frame yet, and the function call escapes me at the moment. Hopefully one of the other scripter guys can post some sample code for syncing to the current animation frame.

Post by ivampretti // Aug 17, 2008, 1:53pm

ivampretti
Total Posts: 151
pic
ok... but the biggest problem is that even in the workspace side there are no keyframes recorded... it stay only in the real time...


I used a HDRColor object to put the color in the punctual light, and a jscript comand with a timer to generate random numbers between 0.5 and 1.5...


I tried to put manual values in the HDRColor and tried to record, but the progrmam doesn´t accept....

Post by frootee // Aug 17, 2008, 2:03pm

frootee
Total Posts: 2667
pic
Check this out, Post #2. There are other items in the thread as well.

In post #2, I attached a paused activity loop. In that loop is a script node which sets the keyframe for the object (the cylinder) based on a time value input.


http://forums1.caligari.com/truespace/showthread.php?t=5832


The RsAnim.SetKeyFrame function will set a keyframe for the object of interest. I have not tried it with lights:


RsAnim.SetKeyFrame(Space.CurrentScene()+ '/Cylinder', keytime*10);

Post by ivampretti // Aug 17, 2008, 2:28pm

ivampretti
Total Posts: 151
pic
so, its just put this line in my jscript comand and incrementing the number of the keyframe that it goes recording the action?


I'm using the .scn scenes, not roseta, it will work the same way?


RsAnim.SetKeyFrame(Space.CurrentScene()+ '/myobjectnamehere', keytime*[my desired keyframe]);


I was using the tSBridge.PutCurrentKeyFrame(' ', keyframenumber);

its not the same but for all scene?

Post by Jack Edwards // Aug 17, 2008, 5:19pm

Jack Edwards
Total Posts: 4062
pic
To keyframe the light values you need to activate them for recording using the Keying panel. Once that is done, you should be able to change their values then record a key at that value.

I'd be leary of saving Workspace objects (scripts) in .scn format. SCN format is the old 6.6 scene format, I'm not sure it understands or correctly saves Workspace objects... Objects specific to Workspace side should be saved as a Workspace format, RsObj or RsScn.

Post by Jack Edwards // Aug 17, 2008, 5:37pm

Jack Edwards
Total Posts: 4062
pic
Ok, I tested it and it worked no probs and no scripting needed. :)

You can access the keying panel by right clicking on the record button. Select the light object, then double click on it's color property to activate it for keying.

Attached is a quick DX9 render.
(Note: the color banding is caused by the WMV codec I used for the video file)

I'll go ahead and make a quick tutorial video to achieve this, give me a few mins to record it.

Post by ivampretti // Aug 18, 2008, 12:15am

ivampretti
Total Posts: 151
pic
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOW THANKS MAAAAAAAAAN, THATS GREAT!


I really apreciatte that!!!!:D:D:D:D:D:D:banana::banana::banana::banan a::banana:

Post by ivampretti // Aug 18, 2008, 4:18pm

ivampretti
Total Posts: 151
pic
now, does any body now how to do that control, controled by a script?

because manualy its easy, but I need in a script....


but need to record in keyframes the diferent types of color for the light....

Post by Jack Edwards // Aug 18, 2008, 5:10pm

Jack Edwards
Total Posts: 4062
pic
So are you saying that you want the script to generate keyframes or that you want the script to control the light color by be timed to sync to the current frame/framerate when rendering out the animation?

Post by trueBlue // Aug 18, 2008, 5:21pm

trueBlue
Total Posts: 1761
pic
I am not sure how to script color changes with trueSpace's color picker but you could use this custom Spot Light and change colors by way of scripting very easily. Try the jScript macro recorder on it as an example.

http://forums1.caligari.com/truespace/showpost.php?p=58869&postcount=1 (http://forums1.caligari.com/truespace/showpost.php?p=58869&postcount=1)

function Execute(params)
{
// Macro captured 08/18/08 20:16:03
Node.Value(Space.CurrentScene() + "/Spot", "Red") = 0
Node.Value(Space.CurrentScene() + "/Spot", "Green") = 0
}

Post by mrbones // Aug 18, 2008, 6:04pm

mrbones
Total Posts: 1280
pic
another quick tip is assign a light with a phy prop, then move or adjust the light parameters while the phys sim is running and recording.



That is how I did the lights for this animation.


http://www.youtube.com/watch?v=OxuLObdHch0


Seemed to work well for me.

Post by ivampretti // Aug 19, 2008, 3:16am

ivampretti
Total Posts: 151
pic
I want to render a avi with lightworks in the model side, because I dont have VRay, with the light controled by a script... because I need to do a long video sequency, and it have to look like this:


http://www.youtube.com/watch?v=SYqJxajpK9Q&feature=related


I accept other ideas.


PS: the video is in Portoguese language, because I'm a brasilian person that speak a few english :D

Post by ivampretti // Aug 19, 2008, 5:33am

ivampretti
Total Posts: 151
pic
oh, jack I guess that now I understand what are you asking me. I want to sync to the current frame/framerate when rendering out the animation! because I need to turn on and turn off the solder machine in specifycks frames!!!


sorry, I'm new at these things. I only had used the 3.2 version before the 7.6.....

Post by Jack Edwards // Aug 19, 2008, 6:03am

Jack Edwards
Total Posts: 4062
pic
That's what I needed to know. :)

So you need to read from the current keyframe value in your script:

yourVariableHere = RsTime.CurrentTime();

Post by ivampretti // Aug 19, 2008, 10:01am

ivampretti
Total Posts: 151
pic
jack, I guess that is missing some define file. Because when I go to the visualization of the LE, comes a error messenger saying that the RsTime isn't defined!

Post by Jack Edwards // Aug 19, 2008, 6:00pm

Jack Edwards
Total Posts: 4062
pic
You have to use a JScript Command, JScript Objects are local scope only.

You may have to set up a timer to trigger the Command and then have it export the current frame value. Another way is via Function Sets. But I don't have an example off the top of my head.

Post by ivampretti // Aug 20, 2008, 9:13am

ivampretti
Total Posts: 151
pic
my special thanks jack, your help was excellent!!! now I'm gonna start at the workspace side!
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2024. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn