Camera switcher triggering group display?

   3035   4   2
User Avatar
Member
56 posts
Joined: March 2006
Offline
I have two cameras, cam_main and cam_hud, fed into a switcher. Objects to be rendered by a given camera belong to a similarly named node group. Is it possible to have group visibility toggle depending on the switcher value? I.e., can I have a change in the camswitch parameter invoke a script to toggle one group of objects on, another group off?

User Avatar
Member
509 posts
Joined: July 2005
Offline
firt thing comes to my mind is to use the ch(“../switcher1/camswitch”) expression in the OBJ/Render tab/Display (you need to switch it on) ..

and in that way you could just trig any other deleteSOP activation with some “if” expression maybe..

hope this helps..
JcN
VisualCortexLab Ltd :: www.visualcortexlab.com
User Avatar
Member
7754 posts
Joined: July 2005
Online
In the parameters of your objects, look for the Display parameter (it's in the Render tab). It's a toggle plus slider. Turn on the toggle and in the slider parameter beside it, put in a ch() expression to your switcher parameter.
eg. (ch(“/obj/switcher1/camswitch”) == 0), (ch(“/obj/switcher1/camswitch”) == 1), (ch(“/obj/switcher1/camswitch”) == 1), etc.
User Avatar
Member
56 posts
Joined: March 2006
Offline
Hi Guys, thanks for the advice. Since I've got the objects grouped, I was trying to avoid entering an expression into every single object's Render tab ‘display’ parameter. For an actual render, it's easy. I'd hoped there was a similar way of using groups for choosing what's displayed in the viewport.

On a related note, is it possible to specify the set of objects to include/exclude within the camera? Again, no problem at render time but it's the real-time views I want to affect. I have a perspective camera for the main view and an ortho camera for the HUD. The objects occupy the area of world space. I'd like for the ‘persp’ camera viewport to only show objects in that group, and the ‘ortho’ camera viewport to only show the HUD geometry. The only way I can see doing this is transforming one camera and its objects to some other place/orientation in world space.
User Avatar
Member
2199 posts
Joined: July 2005
Online
You could use a preframe render script and put an if statement in there that turns on the group of objects you want. Or maybe toggle between two takes (haven't tried that myself though)

edit:
Sorry re-reading this I guess you are talking about the viewport not a render. So this won't help.
The trick is finding just the right hammer for every screw
  • Quick Links