Two Connected Components -> Parent Animation, Child Animation?

animation

#1

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.


#3

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:


#4

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


#5

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.


#6

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…


#7

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: https://www.dropbox.com/s/wqt896v49zirr8k/Desert%20House.skp?dl=0


#8

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)


#9

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…


#10

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.