Three-option hidden components

Hi all-

I am trying to make a theatrical light called a Source Four which comes in different beam widths. Currently, I have three different translucent “light beam” options in the model, and I would like to unhide one at a time from a drop-down list. I’ve seen plenty of examples of hide/unhide options, but not for managing three or more options.

I attached the file I’m working on if that helps.


Source Four Dyn.skp (374.4 KB)

make the 3 light beam in 3 different layers and u can hide and unhide which beam u wantSource Four Dyn.skp (351.3 KB)

I altered your component to cycle between the three angles. It’s not a drop down, but is almost as quick to change angles:
Source Four Dyn1-cycle.skp (345.3 KB)

I created a custom field to hold the “desired angle”, altered the “OnClick” behavior to cycle between the three options, then altered each “deg” subcomponent’s “Hidden” attribute to hold an appropriate formula.

1 Like

On mobile, so can’t check file.

You can make each light beam it’s own components nested in the overall
parent component. Each one has their hidden attribute to 1. Create a custom
attribute with dropdown options. And for the one that gets selected, it’s
hidden attribute gets changed to 0, if not selected, keep at 0.

Something like that

Actually, you can do both - an “onClick” behavior AND a drop down list. Each has their good and bad points:
onClick behavior: User must select the “interact” tool to change the angle - and many users may not know to even try this! Once selected, click immediately changes the angle - you might need two clicks to get to the desired angle.

Drop Down: Must have the “Component Options” window open (screen clutter). You can directly choose the desired angle, but you have to then click “Apply” to see your change reflected in the model.

I’ve updated my component to work with either method:
Source Four Dyn1-cycle.skp (355.2 KB)

1 Like

Thanks everyone! I wanted to go with a drop-down for selecting the beam
because I want to reserve the click for turning the light on and off.
Opening the menu isn’t a big deal since once I add the light to the model,
I won’t have to change the beam again.

I’ll try it out in a bit and see if I have any issues.

Thanks to all who helped, the drop down list work great (Yay!). Now I have a different set of problems:

I want to be able to turn the light off by clicking on it. What I did is put the “visible light” components, 19, 26, and 36 angle beams into a group called “Light” and set an OnClick parameter to turn it off as such: SET(“Light!Hidden”,0,1). When I try it, I get an error “ERROR: Invalid entry to animate (Light!Hidden).” I checked my spelling and everything and can’t figure out why it won’t work.

Also, I had an issue where if I copy the fixture and change the options on one of them, they all update. I tried to make the component unique, same problem. Then, I went though and made all of the internal components into groups which is when the OnClick issue above popped up and when I tried to use rotate parameters, it scaled and skewed instead of rotated until I set everything back to components.

Am I really asking too much of this model? Thanks again for the help.


Source 4 Test.skp (469.2 KB)

In your “Source 4 Test.skp”, something funny is going on with groups. In the outliner, I can’t find any evidence of the enclosed components - only groups. So I’m going to start with my earlier “Source Four Dyn1-Cycle.skp”

Since you’ve gone with drop down only for the angle, why not:
Forget about the container “Light”
Have OnClick for Box set a custom variable to a value:
Change the formula for the “Hidden” attribute of each “deg” option to consider consider both of your custom variables (one set by dropdown and one set by OnClick) to arrive at the answer, like this for the “Hidden” attribute of “19deg”:

Here’s how it works: Source Four Dyn1-2 Controls.skp (328.9 KB)

One problem with even the model I just made is that you have to “dig” down to the “body” internal component to use either the drop down or the OnClick. Whatever else happens, I’d suggest putting ALL user selectable controls (and their custom attributes) in the outermost enclosing component. This will necessitate changing the “parent” in my formulas to the name of the outermost enclosing component.

I suspect that part of your rotation problems relate to axis placement of the internal components that are being rotated. I haven’t tried to fix this - mostly because I’m not sure what - exactly - you’re trying to do with your rotations.

And I won’t even TRY to address the problems related to multiple component instances with different user selected values until you’ve got rid of all the groups (in favor of components).

One thing I WOULD suggest is that you solve all control/tilt/turn problems with just one component before you address multiple copies.

Sorry for the lax in response- I’m busy with other projects for school.

The reason I converted the guts of the component to groups was to try to stop problems I had when using multiple instances, which obviously didn’t work. All the rotation attributes work fine when components and not groups are used.

I used your formula to combine the hidden functions into one and it works great! I also think I know why the components weren’t acting on their own when I copied them. I had some of the user defined attributes in nested components and when I moved everything to the outermost component, as you suggested, it all worked exactly like it’s supposed to.

Thanks so much for your help! This will make my lighting plots so much easier, and I’m going to make other components based on this one for different types of fixtures.

Source Four Dyn Test3.skp (477.2 KB)

You’re quite welcome. Happy to help!

One thing on your model: Since the fixture is hung from a rail, I presume it’s normally fairly high up. Consequently, when I tried to tilt it, I expected positive numbers to tilt it down. If it were my component, I’d relabel the component option “Down Tilt” and multiply the user supplied value by -1 in the formula.