I have objects to load with differents dimensions, and i would like to adapt the "walkloaded" animation to each object, because some of them are flying. How can i do that using the same operator?
I have objects to load with differents dimensions, and i would like to adapt the "walkloaded" animation to each object, because some of them are flying. How can i do that using the same operator?
I don't think you can adjust an existing animation "on the fly". You can however switch between different pre-made animations with a small workaround and some limitations.
I used this in version 20.1, so I can't guarantee that this will work in 19.1.
First, you create the different animations that you want to use. In your case it would probably be easiest to duplicate the "WalkLoaded" and edit the bone positions of the arms, so the hands end up closer together. Next to "Keyframes" click on "Bone Animations" icon and then select "Animate Bones Directly". You can now rotate the bones manually and add keyframes with new bone positions at any point during the animation. In your case, you probably only need to adjust the elbow position at the start of the animation.
After you are done editing the new animations, go through the default animations and add a keyframe with reset bone positions (Bone icon -> Reset Bone Positions) to the start of each one. Otherwise the altered positions might appear in other animations.
Note at which position in the list your new animations are listed, this will be used in the next step.
To have the operator use a different animation from the default one, you simply switch around the names of the animations, so that the animation you want to use is called "WalkLoaded".
This can be done with the following code:
Object operator = "Insert reference to operator here"; treenode Animation = operator.attrs.animationinfo.subnodes[2].subnodes[X]; Animation.name = "NewName";
"X" is the number of the animation whose name you change and synonymous with the list position.
First, you should always rename all animation variants back to their unique default name (for example "WalkLoaded" + the list position to prevent duplicate naming. Then, depending on the item type, you set the name of one of the animation to "WalkLoaded".
It is important that this is done before the operator picks up the item. The animation is loaded as soon as the item is picked and any subsequent change will only take effect when the animation is next loaded, so only when the next item is picked up.
I added one additional animation to your example model and switch between them depending on the item type. The custom hand positions are not really correct for the small box either but it's just a demonstration.
@Felix Möhlmann Thank you so much for your aswer, this is exclatly what i need!
16 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved