PDA

View Full Version : Is there a "if else node"?



3DGFXStudios
03-09-2012, 08:52 AM
Is there a "if else node"? Would be handy I there was :thumbsup:
If not... Can someone make it :hey:

Celshader
03-09-2012, 08:56 AM
Is there a "if else node"? Would be handy I there was :thumbsup:
If not... Can someone make it :hey:

For the Node Editor, please consider the Logic node (Add Node->Math->Scalar->Logic). There's an example of its use here:
http://lightwiki.net/wiki/How_to_assign_different_properties_to_each_side_of _a_doublesided_surface

Scroll down to the "Assigning different indexes of refraction to each side of a doublesided surface" section.

3DGFXStudios
03-10-2012, 05:10 PM
Oh nice that was what I was looking for. Thanks! :)

3DGFXStudios
03-11-2012, 03:17 PM
What I actually need right now is a Logic node with more operations. What I need is an AND + OR option. Like this for example: A Equal to B OR C OR D etc. Can someone make such a node? ;) Would be nice to have the option to dynamically add the amount of options A B C D E F G etc

evenflcw
03-11-2012, 04:03 PM
Obviously you could use several logic nodes but I get that you want to avoid that. So how do you imagine or prefer this node to work? Should it add a new input so there is always one unoccupied available?

XswampyX
03-11-2012, 04:15 PM
http://www.lwplugindb.com/Plugin.aspx?id=95ec157b

AS Math Node has two nodes. Logic1 and Logic2. Don't know what they do as they are 32bit.

Might be what your after?

Lightwolf
03-11-2012, 05:05 PM
What I actually need right now is a Logic node with more operations. What I need is an AND + OR option. Like this for example: A Equal to B OR C OR D etc. Can someone make such a node? ;) Would be nice to have the option to dynamically add the amount of options A B C D E F G etc
I've got one like that... unfortunately it is a part of the (commercial) shaderMeister (in this case designed to ease filtering depending on a variety of criteria, but a generic boolean node is included as well)..

Cheers,
Mike

3DGFXStudios
03-11-2012, 06:02 PM
Here a quick mockup I did. I'm a bit sleepy a the moment so maybe I made stupid mistake. Feel free to tell me if I did ;), but I think this would be very handy. The logic node is really nice especially in the nodal motion editor.

3DGFXStudios
03-11-2012, 06:04 PM
I've got one like that... unfortunately it is a part of the (commercial) shaderMeister (in this case designed to ease filtering depending on a variety of criteria, but a generic boolean node is included as well)..

Cheers,
Mike

Oh Mike! You are a hero again. Does it do something similar to what I made up in Photoshop just yet? Seems like you read my mind even before I did.;) I'll check it tomorrow :hey:

Lightwolf
03-11-2012, 06:21 PM
Oh Mike! You are a hero again. Does it do something similar to what I made up in Photoshop just yet? Seems like you read my mind even before I did.;) I'll check it tomorrow :hey:
No, a lot simpler. But since you can chain them together...

It is also meant to be used in conjunction with the filter node, which is essentially an if ... else.

Cheers,
Mike

evenflcw
03-11-2012, 07:27 PM
Wow, that AS_Math_Nodes has alot of goodies! Thanks for mentioning it.

His Logic2 node allow two comparisons. So you'd still be one short and need to use a secondary node for the last one.

3DGFXStudios
03-12-2012, 03:30 AM
http://www.lwplugindb.com/Plugin.aspx?id=95ec157b

AS Math Node has two nodes. Logic1 and Logic2. Don't know what they do as they are 32bit.

Might be what your after?

Unfortunately I don't use a 32bit version of lightwave.

3DGFXStudios
03-12-2012, 03:41 AM
Hey Mike, your node also only makes one comparison right? What I'd like to do is compare a lot of different value's in one single node. It's a lot easier to see whats going on when it's all happening in one node. I need at least 12 comparisons ;)

Lightwolf
03-12-2012, 04:20 AM
Hey Mike, your node also only makes one comparison right?
Yup... you want more then you can daisy chain them... which also allows you to change the order quickly.

What I'd like to do is compare a lot of different value's in one single node.
It would make the user interface a real pain to design as it's quite tricky to dynamically add controls to a XPanels GUI (which is the one that allows for embedding).
Unless there's a pop-up to select on of the x comparisons and a common area to edit the individual operation.

Cheers,
Mike

3DGFXStudios
03-12-2012, 05:07 AM
Yup... you want more then you can daisy chain them... which also allows you to change the order quickly.

It would make the user interface a real pain to design as it's quite tricky to dynamically add controls to a XPanels GUI (which is the one that allows for embedding).
Unless there's a pop-up to select on of the x comparisons and a common area to edit the individual operation.

Cheers,
Mike

It's not really necessary to add the comparisons dynamically, a pop-up will do fine. I just thought of it as a screen space saver. It could work like the DP_Extra buffer nodes do with a pop-up that gives you access to 1-10 11-20 21-31 or something like that.

Chaining logic nodes in a way that they work like a AND OR really confuses
me even just with one extra comparison 8~ :D

Lightwolf
03-12-2012, 05:43 AM
Chaining logic nodes in a way that they work like a AND OR really confuses
me even just with one extra comparison 8~ :D
Once you start to have an input for the extra variable to check against per operation (which is sourced by another node), I'd think that a single operator node would be a lot less confusing.
Mainly because you wouldn't need to click through the GUI to find out which input is used with which operator.

Cheers,
Mike

3DGFXStudios
03-12-2012, 06:31 AM
Once you start to have an input for the extra variable to check against per operation (which is sourced by another node), I'd think that a single operator node would be a lot less confusing.
Mainly because you wouldn't need to click through the GUI to find out which input is used with which operator.

Cheers,
Mike

Yes exactly! :agree: That's why we need this node :D
Who has the time to make it :hey:

Lightwolf
03-12-2012, 06:52 AM
Yes exactly! :agree:
Erm... those were arguments against a single monster node... :D

Cheers,
Mike

3DGFXStudios
03-12-2012, 07:10 AM
Erm... those were arguments against a single monster node... :D

Cheers,
Mike

Oh woops :D But clicking true for example 12 single operator nodes isn't really a clear way of organizing things imo.
For example: I have 9 controllers that based on their position trigger an other motion in the scene. How would I do that with single nodes? Add the values and use and other Logic node to compare that value?

3DGFXStudios
03-12-2012, 07:12 AM
I like monsters like this ;)

Lightwolf
03-12-2012, 07:33 AM
I like monsters like this ;)
Now, try a second mockup of the respective node flow... with the twelve nodes that go into the operators.

Cheers,
Mike

Lightwolf
03-12-2012, 07:34 AM
Oh woops :D But clicking true for example 12 single operator nodes isn't really a clear way of organizing things imo.
For example: I have 9 controllers that based on their position trigger an other motion in the scene. How would I do that with single nodes? Add the values and use and other Logic node to compare that value?
Well, we are talking boolean logic here, aren't we?
I suppose the best option for what you'd want is a proper expressions node.

Cheers,
Mike

3DGFXStudios
03-12-2012, 07:39 AM
Well, we are talking boolean logic here, aren't we?
I suppose the best option for what you'd want is a proper expressions node.

Cheers,
Mike

An expression node is a better idea. However I suck at making them.
Now you mention expressions... I did a little test with Logic operators but they don't seem to work? I even used the expression builder in the graph editor but even then I didn't work. Is this broken or am I just a pancake? :question:

3DGFXStudios
03-12-2012, 08:21 AM
Now, try a second mockup of the respective node flow... with the twelve nodes that go into the operators.

Cheers,
Mike

Here I a quick mockup of how the node flow would look.

Lightwolf
03-12-2012, 08:47 AM
Here I a quick mockup of how the node flow would look.
Interestingly enough that wouldn't work.
For a start, it only allows you to seal with scalars. True/false values within LW are integer based though.

Looking at the whole shebang, what you'd really want here is indeed an expressions node (which doesn't exist, and is tricky to create as well). Which could not only be inherently more flexible than what you have here but also easier to suss out.
After all, your monster GUI is nothing but a bunch of nested if clauses with the downside of not allowing for any flow control beyond that - and also the problem if not being able to re-arrange them (which will come up more quickly than you'd think).

Cheers,
Mike

3DGFXStudios
03-12-2012, 09:05 AM
I forgot the "vector scalar" node between the item info and the true. I added that vector scalar node and it works now with the standard logic node of course. Not that it is doing something useful yet other than limiting a rotation channel, but it works. So the true output is some float value of course not a vector but a single channel.