Recommend way to create animated components

advice

#1

I’m a bit new to dynamic components, and wonder if there is a ‘recommended’ or ‘best practise’ for creating animated dynamic components.

Let me explain by the attached example: Animation grouping.skp (93.5 KB), containig six doors (2 red, 2 blue and 2 green).

Each door has a door and frame component, assembled into an assembly group or component.

Each door has an “Opening” variable, and the RotZ = -Opening, so it opens up when Opening is between 0° and 90°.

For the front red door, onClick (attached to the door pane) animates Opening between 0° and 60°.

Now, if I simply copy the RedDoorAssembly, an onClick on any red door animate all red doors. Great, but that’s not how it works (at least not in my house :wink: ).

Now I see two options to solve this:
For the blue doors, the onClick is attached to the Assembly (instead of the door). In this case, SketchUp will automatically make this component unique (make a copy of it).

Another (similar) solution is to make the assembly a group instead of a component instance, as is done for the green doors. In that case it is not possible to attach the onClick to the assembly, but things work just fine when attached to the door.

The disadvantage of the blue and green door is that if I change something about the assembly, I have to change it at each instance (they don’t share a single component definition).

I have three questions:

  • What is the recommended way to do things? The blue or the green door? Or is this a matter of personal preference?
  • Is there a way to have separate animated doors where the assembly shares a single component definition?
  • A bit technical question: Why do the red and green doors behave differently? In both cases, all variables and attributes (RotZ, Opening, onClick) are attached to the door, not to their group or assembly. Why would they behave different depending of where in the Outline hierarchy they are located? With other words, where is the animation ‘state’ (in this case the RotZ state) stored? I assume in the instance of the door.

(This last question surely shows I’m a newbie here, I just try to understand things a bit better).


#2
  1. the red components are instances of one and the same component (the assembly).
    So they must be completely identical at all times. They may have a different location (preferably) in modeling space, even a different orientation etc. but they are (look) the same. The only thing that may be different is their component material (the container) and their scale (also the container). (for the material and scale (on the container) are not part of the component definition)
    Groups however can be different. What is inside (the two door instances of the same door component) can have different locations and/or orientations. So one can rotate while the other in a different group remains as is. As mentioned here about the overall components.

#3

oops
2) If the red doors were to have different instance names then you can achieve independent rotations for the red doors inside an assembly. This is opposed to when omitting the instance name or when their names are identical. You didn’t name them differently.
Sorry, I was looking at two red doors in the same editing context. which is certainly not the case in your red door/frame component assembly. So it is like I wrote in 3). So FAIK the assemblies are identical at all times.


#4

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.