Rendering and JScript Command question

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.

Rendering and JScript Command question // Tech Forum

1  |  

Post by ivampretti // Sep 25, 2008, 3:41pm

ivampretti
Total Posts: 151
pic
How to render a scene in model side using Ligthworks with a timer and a Jscript command??? Is there an way to do that without living the timer on during the render?? because it causes many problems in the rendering like more time to render and the image stay blinking (I dont know if write this way sorry my english :D). Or the timer and the jscript command have always to record keyframes to render?? because jscript object are great but I dont know why they take out so much power of the jscript! Like you cant access any of this: RsTime, TsBridge, make a change in a matrix´s values without the conection... I´m very confuse, please help me!

Post by ivampretti // Sep 28, 2008, 3:16pm

ivampretti
Total Posts: 151
pic
am I speaking greek? :D:D:D


nobody say anything... maybe I wrotte something wrong! In the past at least one say that couldn't help!

Post by noko // Sep 28, 2008, 3:25pm

noko
Total Posts: 684
Sounds interesting in any case. Maybe if you post an example scene for the scriptors here to look at and play around with. Then hopefully someone can then give you a good solution.

Post by ivampretti // Sep 28, 2008, 4:53pm

ivampretti
Total Posts: 151
pic
ok, a great example is in introduction to scripting tutorial, the free course in caligari's site. On Part 8 the man uses a jscript command to create a earth orbiting the sun! it has a timer event to make the things move, and the earth stays orbiting there for ever! in realtime at the workspace side its great! But I would like to know how to render a scene like this in the model side with the lightworks?


I tried to sincronize the jscript command with the frames using RsTime.currenttime (is something like this, I dont remember how write) and let the timer event running during the rendering, the result is not so bad, but the picture stay blinking and the time to render is improved, and there is a time that the timer overflow and it stops to function...

Post by ivampretti // Sep 28, 2008, 5:22pm

ivampretti
Total Posts: 151
pic
Here is the object from the course!

Post by Norm // Sep 29, 2008, 5:26am

Norm
Total Posts: 862
pic
The object in question uses no keyframes. It was intended for use in 3d window in realtime. There are methods to create keyframes if you wanted.

RsAnim. namespace has one method called SetKeyFrame(string, variant), which if used somewhere in the code, could create keyframes for objects. Once you ran the scenario for say 10 seconds (or however long you wanted), the keyframes would be created and afterwards you could then do a regular render with Lightworks engine or such.

The difference here is real-time vs render time. Offline renderer is non-real-time, so not very practical to try to create a full render in realtime. Real-time too fast for render to file. Best I can imagine is to create the keyframes and then render afterwards.

Post by Délé // Sep 29, 2008, 6:56am

Délé
Total Posts: 1374
pic
If you replace the Timer Event with a Jscript object and a Watch Dog Event, then you can keyframe with the Jscript object input and it will trigger the Jscript command whenever there is a change.


Here you can see how I have replaced the Timer Event:

15524


Attached is the altered solar system object. You can just keyframe the TimeIN input on the outside of the node and it should work. Using the Watch Dog Event like this allows you to utilize all of the methods that only the Jscript command can do, with the functionality of a Jscript object. ;)

Post by ivampretti // Sep 29, 2008, 1:45pm

ivampretti
Total Posts: 151
pic
Norm, until now, the setkeyframes idea is the best option...


because dele has a great ideia! but the jscript object cant acess RsTime, TsBridge or anithing like it! So to put the jscript object to change the frame and render with lightworks, then I'll need to put a Timer event again! or am I rong Dele?


and Norm, why the jscript object is not so powerfull as the jscript command? I'm loosing my sleep because of this question :p:p

Post by Norm // Sep 30, 2008, 5:17am

Norm
Total Posts: 862
pic
Simple script objects: jscript and vbscript, are stand alone objects that are able to manipulate their own data and state and can respond to requests from other objects in the Link Editor and system itself. There is documentation that refers to them as "nouns".

Command scripts have more power, they are action items or "verbs". They can directly interact with other objects in your scene, requesting modifications or perhaps creating new objects. They can act as direct participants in control-flow within the Link Editor.

There is a need for these two distinct objects in the Link Editor. They allow for a multitude of different scenarios. When combined with other pre-compiled objects like WatchDog Event or such, you begin to find ways to accomplish different tasks.

Why are they different? Imagine only having Command script objects. You have to manually start them or hook them up to control flow scenario. They are very .... dependent on you telling them when to start and run.

Simple script objects just wait for a value to change. When a value changes, they do their thing in the scenario. They are not so dependant on being started manually or in a control-flow circuit. Perhaps they could be described as helpers.

In the end, there are many, many different scenarios you may wish to create in the Link Editor. Having the different types of script allows for the possible number of scenarios to increase dramatically. All of us who began scripting with trueSpace7.0, had same questions. There are many reasons under-surface for this being what it is. Developers go into discussion about the system and threads and safety and such .... they designed it carefully for us even if we do not understand all the reasons why :)


...and Norm, why the jscript object is not so powerfull as the jscript command? I'm loosing my sleep because of this question :p:p

Post by J90 // Oct 1, 2008, 8:17am

J90
Total Posts: 107
here is a scene with a Jscript command.

Just activate the timer and then stop it when you no longer want to keyframe the orbit.

You musth then delete the expanded matrix nodes for each object.

Go into the animation editor and make each track about 180 frames long.


Sorry I can't help anymore I have to go.


i will post better instructions later.
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