|
|
Control Flow Objects
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.
Control Flow Objects // Archive: Tech Forum
Post by 50CalCrazy // Feb 14, 2007, 6:21pm
|
50CalCrazy
Total Posts: 16
|
:confused:
Hi,
I know this is probably elementary stuff that everybody else in the graphics arts world knows, but since I am not a graphic artist I am a little handicapped. I am trying to use procedural animation to animate some robotics that are used at my company. I am in my company's training department and I am the Project Manager over one phase of our online training program. I want to animate our training material and I am trying to use TS7 to do it. Previous to this I was using TS5.5.
I have over 100 hours of study time in right now, but I am still having a lot of struggles using the script objects in the LE. I have already purchased and watched the Procedural Animation Video and it is very good and it helped a lot. However, it did not address Control Flow objects in enough detail to erase the confused look from my face.
I have attached some CF objects to this posting. I simply can not figure out how to use these objects and I have searched the manual and all of the forums. Can anyone explain how to use the objects to me?
Specifically, how do you make these items control anything? |
Post by Emma // Feb 15, 2007, 6:29am
|
Emma
Total Posts: 344
|
Perhaps it is just a matter of interpretation, here is mine. In LE you work with "function blocks" which either are "object blocks" or "command blocks"
Now these blocks as I will call them have input / output and something inside.
object:
I would describe them as "high dynamic", means you construct a rocket that starts on earth and ends on the moon if the gasoline container is filled with 10.000 gallons. Let us say there is a field in the "rocket block" where you just type in a value 10.000 and whooops, the rocket is immediately on the moon, all parameters are dynamically changed. It is similar like a spread sheet, filled with formulas, change one parameter and every dependency has changed too.
command:
I would describe them as "static", means you construct the same rocket, enter the value of 10.000 whow, nothing happens. You have to push some START button or set a control in to a certain status so that the launch will begin.
So control flow perhaps be interpreted as kind of a description for something that needs an initiating impulse to start some activity. That is how I interprete what they say on page 849 by"...they make time an explicit part of trueSpace activities..." Page 140 of the Developer guide makes it even a bit clearer as it states that Control flow is simply a button for start and stop. Must understand this button not only as a simple switch, it can be also a Watch Dog timer, a PhysicsCreateEngine, even a complicated LE construct that you may encapsulate and support with a control in / control out signal as described on page 154/155 of the artists guide. When searching for available "control blocks" already included in trueSpace I think best way is to watch out for the green control links. |
Post by Norm // Feb 15, 2007, 7:49am
|
Norm
Total Posts: 862
|
Developers often comment that you can use the pre-compiled objects to create complex scenarios. For one part, this is reason for their existence.
Where a script type person would code some decisions within a script, developers for instance created the ValueInc. You set the increment value and connect the Input Value to some other object's output value. The result is a value that has been incremented.
Zero condition is checking if the input value equals zero. You have two output connectors, which is paramount to a fork in the road. If zero, control flow triggers an event for true and anything connected to that output control flow connector would begin processing. If value of condition equals false, a control even triggers on that output connector. Again, a script writer would use script to check for a zero condition and use a few if's and elses to control the flow within the script.
The Run Activity is a control button. You click on Run Activity and a control event triggers to control-out. Something else is connected to the control out connector and it recieves this even and begins processing. Pressing stop on the Run Activity puts a hault to the activity. You could have two Run Activity nodes hooked up to the Zero Condition's true/false connectors. Either way, one of the activities would recieve a control event and it would trigger the Run Activity button.
Pause Activity node will take a control event .... wait a period of time .... then send along a control event to its Control Out connector.
Best advice is to test out some of the control flow nodes in simple scenario. Hook a Timer Event into the mix to start the ball rolling. Go straight to a Zero Condition and try to control the flow of what happens using increment node. You can use negative numbers if you wish. You can "load" or preload values in the ValueInc node. One has -10 for increment value, while another can have -20. You can set up traps for values. I went so far as to hook up the scenario to tz location on a cube. You can get the cube moving up and down in z, triggering low values and high values to change direction. But to be honest, much of what you would these items for is easier and less cluttered than a Link Editor full of decision nodes and control flow stuff. |
Post by 50CalCrazy // Feb 15, 2007, 1:05pm
|
50CalCrazy
Total Posts: 16
|
Hi Emma and Norm, thank you for your replies.
I am trying to use what you have told me, but I can not make any kind of changes occur on my control outs for the True/False object.
Question 1: Is the Control Out supposed to do something, and if so, how do I make it do it?
Question 2: What are suitable inputs for the Control In? I can am having a hard time determining what I should plug in here, and how it makes the system work.
Question 3: When I plug into the True/False ouputs, the item being controlled immediatley changes to 0 or 1. But I can not make it change by any kind of input to the Control In or the Condition.
I need some really basic explanations with some pictures and arrows. Right now I feel like I am in kindergarten and the teacher just told me to find the sin of a 45 degree angle.
Here is what I was able to create based on Norm's posting. I don't think it is what he had in mind, but no configuration I tried made any sense, nor did it move the cube.
Thank you for your patience, and your explanations. |
Post by trueBlue // Feb 15, 2007, 4:26pm
|
trueBlue
Total Posts: 1761
|
Look in the My Activities library and there is an example how to use most of what you listed it is called Activity Example. Then in the Animations library there is Wavy Pillar Act that uses Value Inc. |
Post by Wigand // Feb 15, 2007, 6:22pm
|
Wigand
Total Posts: 462
|
If you put connectors together, it is only possible to do
it with the same kind.
Just move the mouse over a connector and you see a tooltip
of what kind of input or output it has.
For example: If you have an array-output it is not possible
to connect it with a string input.
In your house you do not put the telephone direct into
the power connector, don't you. ;-)
If you know a little about computers and electronic,
you may think of the LE-object as they are circuits.
In a PC you have data streams and control streams
and adresses. And in the LE you have simliar things.
Sorry for my english, it is difficult to explain these things
in a foreign language. |
Post by 50CalCrazy // Feb 15, 2007, 6:35pm
|
50CalCrazy
Total Posts: 16
|
Hi Trueblue,
Thank you very much for your help. I did look at the examples you described and I can not see how this is working. There are just too many things that are not explained in the examples. Caligari has not done enough to enable a new user to learn this program.
I have wasted too much of my company's time trying to figure out this program (>100 hours of study time on animation alone!!).
I am just going to call Caligari and talk to a warm body using good old analog conversation. It may not be they way they like to do business, but this is just not working.
Thanks again for trying. |
Post by 50CalCrazy // Feb 15, 2007, 6:42pm
|
50CalCrazy
Total Posts: 16
|
Hi Trueblue,
Thank you very much for your help. I did look at the examples you described and I can not see how this is working. As you can see in the screen capture below, there are just too many things that are not explained in the examples. Caligari has not done enough to enable a new user to learn this program.
I have wasted too much of my company's time trying to figure out this program (>100 hours of study time on animation alone!) and we have purchased 8 tutorials! In the end the basics are still not explained and a beginner like me needs the most basic of explanations so I can understand the reasons behind my actions. I have scoured the manual, I have gone blind on tutorials and videos, and I am getting serious eye strain trying to decipher these examples.
I am just going to call Caligari and talk to a warm body using good old analog conversation. It may not be they way they like to do business, but this is just not working.
Thanks again for trying. |
Post by 50CalCrazy // Feb 15, 2007, 7:02pm
|
50CalCrazy
Total Posts: 16
|
[QUOTE=Wigand;24486]
For example: If you have an array-output it is not possible
to connect it with a string input.]
Hi Wigand, thank you for your help. I am sorry that I am not able to understand this, even with all the help you guys are giving me. However, I do understand that command lines can not be used in data ports.
[If you know a little about computers and electronic,
you may think of the LE-object as they are circuits.
[QUOTE]
This is actually a great explanation of my problem. I could definitley think of the objects on the LE as a circuit board. And like a circuit board, if a person does not have the correct training and a good schematic, they will not be able to determine the function of the circuit board. I need a really good explanation of these functions!
I really don't want to sound like I am trying to be difficult. I am just extremely frustrated with this entire process. I have a lot of technical training in other fields (Nuclear Power, Mechanics, Semiconductor Processes, and Robotics) and I know I coud understand this stuff if I had some basic explanations of how this stuff is working.
Thanks again. |
Post by trueBlue // Feb 15, 2007, 8:56pm
|
trueBlue
Total Posts: 1761
|
Okay let me try to pick this apart. First load up the Activity Example in Default layout. Select the 3D menu and choose 2D in the D3D view. See screen grab. Now you should see two Link Editors. In the Bottom Link Editor enter the Activity Example node from the orange triangle. Position all the nodes/panels so that you can see them in action. In the Upper LE move the slider and watch the values change for the nodes in the Bottom LE. I can see that the slider is connected to the BinaryOP. Move slider all the way to the left and it reads -10.00, in the middle 0, and all the way to the right 10.00. I also see that the BinarOp is connected to the ZeroCondition and when I move the slider these values change as well as mentioned above. Cool we have interaction! I see that the BinaryOp is also connected to two MoveTo nodes, one to the Z value off the SphereCreate and the Y value off the TorusCreate. Again when I move the slider the values also change just like I mentioned above. This is great from one simple slider we can do several things with a push of a button. Button? Ah the Create Primitive button. Okay what makes this tick? In the Upper LE right click the Activity Example's title bar, right click the button, then select Properties from the Button Control panel that just popped up. There we see a simple little jScript command: Activity.Run('%THIS_NAME%/Run Activity, 1') Now look in the Bottom LE and see that we have a node named Run Activity, 1. So we can assume that when we select this button this command will fire a signal to that node to run. %THIS_NAME% is the panel that we are in right now.
Again see screen grab. Cancel everything out and do not save.
Okay we move the slider and select the Create Primitive button which sends a signal to the Run Activity, 1 which sends a signal to the ZeroCondition and depending on ZeroCondition's condition sends a signal to either SphereCreate or TorusCreate which in turn sends a signal to it's MoveTo node. This is all possible by linking ControlOUT to ControlIN with the wires and in this case True or False. Hummmm how in the heck does True or False work? Back to the slider we go. As simple as I can explain it is, you slide the slider to the left of 0 creates negative numbers which equals False which is connected to TorusCreate and slide the slider to the right of 0 creates positive numbers which equals True which is connected to SphereCreate. So this works like a switch.
The Sphere Name is a way to identify which node you want to control. You would not want the MoveTo move a object that you did not want to move and so this is how you would do it. You could exchange the SphereCreate with say a CubeCreate and link it and then only the cube would move.
I feel your frustrations, been there done that and I am still learning by way of examples. If you need me to explain the MoveTo just ask. HTH |
Post by Norm // Feb 16, 2007, 6:29am
|
Norm
Total Posts: 862
|
Here is a simple example of an activity example. Nothing fancy, just showing how control flow works through ZeroCondition node. |
Post by Emma // Feb 16, 2007, 7:03am
|
Emma
Total Posts: 344
|
Oh my gosh,
How did this post fill up with lots of valuable information, wish this would always be the way.:)
Anyway, maybe I didn't read carefully enough. A problem I couldn't solve indeed is what value get's passed on by the triggers. It says
- Interger value, I can see the value of either 1 or 0 (true or false) displayd for the control input.
- But true or false would mean boolean not Integer.
- Changing the Control line by another Command block with Start/Stop doesn't change the displayd value of either 1 or 0, is it happening too fast ?
- couldn't catch the value change either with System.Alert(xxx) cause what is the name of the signal ?
My interest mainly points in the direction of controling Object-scripts by Command scripts or vice versa . One example, there used to be a 6502 CPU simulator on my old Apple II, showing the insides like registers, Accumulator, Fulladder and so on. Starting with something very simple, just a half adder circuitry:
4366
Changing that into an LE layout simulator I tryd something like this
4367
Where I used something to "Control Flow" Bit 0 and Bit 1 are simply usedSelection Changed Event which I thought to use by setting the mark or not so that Control Out would change to either 1 or 0 But as you can see the ....Event,1 is set, but no 1 is shown in my halfadder. Put in a System.Alert to check, but it always says 0 Think 50CalCrazy want's to do a simulation in a similar manner but the information in AGuide and DGuide and also messing around with trueSpace doesn't really show how it works.
Sometimes I have seen a 1 as a result but never could repeat the "momentary effect". It always seemed to me as an "accidential happening"
Script code for half adder, hidden in ANDobject is
4373
The sample with the Zero Condition though shows that 1 and 0 are somewhere and connecting True to Bit0 and Bit1 shows up OK, so question left is True/False real and inverse signal of Control Out or something extra produced |
Post by 50CalCrazy // Feb 16, 2007, 1:58pm
|
50CalCrazy
Total Posts: 16
|
:banana: :jumpy: :banana: :jumpy: :banana: :jumpy: :banana: :jumpy: :banana:
HaHaHAAAAAAAA!!!!!!
EUREKA!!
I was able to Use Trueblue's explanation, Norm's new activity object, and Emma's use of the digital logic along with the help of a friend of mine trained in electronics to gain some serious understanding!!
I actually do get it now and it did take some very basic information to get it. Believe it or not, it was Emma's use of the digital logic that was the key ingredient to my understanding. Not that I know anything about digital logic, but my friend does, and between the two of us we were able to make sense of Trueblue's activity. I don't know why I was getting hung up on the 1's and 0's, but once I could get past that I was able to see how to use the control flow objects.
I have included some of my thoughts in the screen grabs. Could somebody please check my reasoning to see if I am on track?
Once again, thank you very much for your help and patience.:cool: |
|