Two Connected Components -> Parent Animation, Child Animation?

I’m fairly new to sketchup… so apologies for any poor use of lingo.

I’m trying to animate a moving wall and it’s door in a house. I want the wall and the door to move to a new location when the wall is clicked, and I want the door to open when the door is clicked at both possible locations of the door. Is this possible?

I’ve managed to get the wall and door animating properly on their own, just need to get a way to tie the door to the wall! Any tips would be awesome.

The onclick formulas has to be set on the (child) level, if you want control multiple actions in the parent level, you can seperate them with ‘;’
Check this example:

1 Like

Awesome, thanks for the tip. I’ll try it tonight.

So I’m trying to understand the (child) level and I’m not grasping what needs to be done.

The example you provided is for a sequence of animation and my brain isn’t able to figure out how the coding is applicable to my situation. Let me try and explain my goal a bit better.

Here is a screencap of my small home that I’m designing and trying to learn sketchup with:


Note how I have the Bedroom Wall component, within that is the Door and Bedroom closet. I’m envisioning the murphy bed swinging up, the Bedroom Wall component sliding over and making the living room area larger. I’d like to be able to click the pocket door within the Bedroom Wall Component and have it open and close as well also having it move along with the wall as it animates.

The animation code for the pocket door works on the other door that I have in the model, but within the bedroom wall component I’m unable to click on the door within it as a separate item to trigger the door only animation.

I’ve googled like crazy for help on this (dynamic, child, parent, animate, etc) but nothing useful comes up at all.

Any pointers would be greatly appreciated.

If you hover over the main component, animate will perform the highest level (bedroom wall)
It overrides the ones below (door)
So, you must flatten the organisation of the three, do not indent by absorbing the door and closet into the wall, leave them seperate, or combine them in a new component (eg bedroom) and do not add an onclick attribute to that component, only in the three.

Pls upload the file for some of us can investigate further…

Thanks for trying to help me Mike, I understand most of what you say but you lose me when you say “and do not add an onclick attribute to that component, only in the three.”

Here is the file: Dropbox - File Deleted

basically, get rid of the onclick of the parent and let the children decide::grinning:

So when you think of the wall as the big sister of the door, tell the door to move as well when his sister is moving:
ANIMATE(Y,198,238,300.5);ANIMATE(DOOR!Y,198,238,300.5)

btw, purging the file (Window->Model Info-Statistics->Purge Unused) reduced the file with 10 MB or so:

Desert House.skp (244.4 KB)

Thanks a bunch for doing this.

There is some odd behaviour going on with the two elements, but I’m pretty sure I can work through it.

Time to move on and start adding more elements/details to this…

In general, when working with DC’s and testing, purging gets rid of component definitions etc. and while at it, I always click the ‘fix problems’ as well. This helps to get rid of loose ID’s (each object has an unique identifier under the hood)

Most often, starting over is quicker then trying to fix things.

There has to be a simple solution for this. I’m trying to animate a cabinet door swing which has a latch component embedded in its group. The latch makes the door deeper than just the wood of the door alone. If I animate without the latch, it rotates as needed at the wood edge. When I add the latch, the group rotates on the edge group (offset from the wood edge) and not what I want. I don’t see a way in Windows version to change the axis of rotation placement. How do I fix this?

The simple thing is to make the object a component and set the components origin at the desired center of rotation during it’s creation or right click on the component and choose Change Axes. If you open the group for editing you can move the group’s axes.

1 Like

That happens because when you group two elements, the origin is by default put on the bottom front left corner of the new group or component, that can be fixed like Dave suggested, creating a new component or editing the origin of the component you already have.

1 Like

Thanks…I’m working on my group and component management and that has solved the problem. Next up is creating an animation control panel with clickable buttons that control simultaneous component animations outside the control panel. I want two different components to rotate differently at the same time and then those same two components to slide the same distance (Y axis) at the same time. A third button will cause a separate set of components to rotate.

Got it…thanks!

With Dave’s and your help (and Loom), I was able to make two vids showing animations within my SketchUp model. Both are posted to my YT channel. For each I used dynamic components, scenes, and tags to simulate movement of furniture components within my camper van design. Check it out: Eiger-3 Camper pivot table animation - YouTube

The animations are a little jerky due to RAM/GPU issues with my current laptop…working on that.