Using hide in DC's?
-
Could someone help with the following?
Say i have a component that is a torch and its light beam. I would like this to be a dynamic component that:
a: changes the colour of the beam when the beam is clicked interactively (which I have managed to do)
b: turns on and off (ie a toggle that hides/unhides) the beam when the torch is clicked interactively.Shouldn't be too hard, but I can't get it to work...!
thanks
rabbit
-
You have to give the beam component a hidden attribute and point it back to a onclick in the torch component. The onclick should be toggling between 1 and 0 (or is true and false....). If you still can't get it, upload what you have so far.
Chris
-
Well, I went ahead made a quick mock-up of what you're after. Just the on and off part, not the colors since you said you got that working.
Chris
-
Chris - thanks, thats perfect!
I note you have a custom attribute "on_click_hider" - but this appears to do nothing ie the thing works without it. Is this something you left in when you were experimenting with it?There really needs to be some better documentation on these things...especially for people who are not coders.
How did you learn to do this...?cheers
rabbit -
Yes, that custom attribute is left over from me trying to rememeber how to get it to work.
As for figuring out DC's - it was a painful experience. I recall lots of nagging the development team for better docs. They have a pretty good website now that puts together the possible methods and examples of each method in action. In the Component Attributes window, just click on the functions tab. Then look for the little "more" url link. It brings up this page:
http://sketchup.google.com/support/bin/answer.py?hl=en&answer=108144
And I recommend starting just like you are. Play around with onclicks and hidden variables, then move on to rotation and moving and copies, etc. And good luck!
Chris
Advertisement