PDA

View Full Version : Parenting and Motion Modifiers



TonyP
12-17-2003, 06:06 AM
Hi folks, new to LScript with a project using 30 or so groups of 7 connected wheels (ie over 350 objects + nulls) and looks like a good job for LScripting??

Sample scene is: (revised in light of attached diagram below)

null (1) - H set to 45 deg. for attached diagram
- disk (1) - disk with radius = 1 unit
- - null (2) - follows null(1): pos * 0 other chanels * 1
- - - disk (2) - follows disk (1) with X+1.5 and SX & SZ = 0.5
- - - - null (3) - follows null(2): pos * 0 other chanels * 1
- - - - - disk (3) - follows disk (2): all chanels * 1
- - - - - - null (4) - follows null (3): pos * 0 other chanels * 1
- - - - - - - disk (4) - follows disk (3): all chanels * 1

(each level is parented to the level above)

Result is a series of touching disks that rotate about the largest disk (1) - the disks get smaller the further they get down the tree and rotate faster about the parent disk. Works well but too complicated to do 350 of them!!!

In looking through the manuals I have been able to build a test scene with nulls and objects correctly parented but 3 problems/questions have arisen:

1/ can I add a motion modifier to an object when a scene is created using LScript - and if so how?? That is: to add the Follower motion modifier to any of the nodes and set the followed node and other settings.

2/ when each object is created is it assigned (or can it be assigned) a name or ID that is different to the object file name - disk.lwo makes disk(1) disk(2) etc. - and if so, can that can be referenced by LScript.

3/ can I write a variable (object property) to an object that I can refer to later in the script - or in another script.

Thought about creating the basic structure as a scene file and loading that using LScript - but still would require 60 or so additional nodes to do rotaions, offsets and scaling of repeated structures. Would prefer to come up with a scripted solution.

Hope this is not too confusing.

Thanks for any help!!

Tony

http://www.shapes.com.au/LightwaveSceneDescription.gif

mattbolton
12-17-2003, 07:43 AM
Can you post a screenshot demonstrating how these wheels are layed out with each other. I am having a hard time visualizing what you want to do. Thanks.

faulknermano
12-18-2003, 05:37 AM
1/ can I add a motion modifier to an object when a scene is created using LScript - and if so how?? That is: to add the Follower motion modifier to any of the nodes and set the followed node and other settings.

yes. but this is a complicated procedure. if you are starting to lscript, this is very hard to get your head around. but if you are up to it, the solution is the use the IPC or the Queue OA to transfer settings data to and fro the lscript instances attached to the objects. also, you can use a generic or master script to apply the lscripts to a bunch of objects. but again, these things are not that easy to do, especially the changing of settings of instances from outside.



2/ when each object is created is it assigned (or can it be assigned) a name or ID that is different to the object file name - disk.lwo makes disk(1) disk(2) etc. - and if so, can that can be referenced by LScript.

an object instance in layout will have a different ID even if they refer to the same file.


3/ can I write a variable (object property) to an object that I can refer to later in the script - or in another script.

yes, and you can do this in different ways depending on the nature of the variable. if the variable is 'active' meaning it changes, or is subject to change, then you can use the IPC mechanism or the Queue OA to update that variable across the enviornment. but it is only there so as long as the 'host' script that owns that variable is active.

if the variable in question is more 'static' then you can use store() / recall() to save that variable's data into the reigstry or you can use the File Object Agent to write a text file containing your information.

ps: i dont really know what you're trying to do. i'm only trying to answer your question. :D

mattbolton
12-18-2003, 10:19 AM
I'm still having a hard time figuring out what you want to do even with that nice diagram. If the discs continue rotating, they will eventually collide with the one two levels down. If there were a way to parent/un-parent dynamically, then it would be a cakewalk.