question

Abhijeet P avatar image
0 Likes"
Abhijeet P asked Ryan Clark commented

How to crate animation of flow item for multiple pass through processor ?

How to create animation for flow item as it is passes three times in to & fro direction over processor length during cycle time? Thanks in advance for reply.

FlexSim 18.0.10
flexsim 18.0.10animation creator
· 3
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Joerg Vogel avatar image Joerg Vogel commented ·
You want to watch an animation of conveying an item three times instead of the default animation of one pass?
0 Likes 0 ·
Abhijeet P avatar image Abhijeet P commented ·

Yes same i want to do the same animation.

0 Likes 0 ·
Ryan Clark avatar image Ryan Clark commented ·

Hi @abhijeet.p, was Felix Möhlmann's answer helpful? If so, please click the red "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

Felix Möhlmann avatar image
2 Likes"
Felix Möhlmann answered Ryan Clark commented

I built a small sample model to demonstrate how this can be done.

AnimationOnProcessor_18_0_fm.fsm

I took the following steps:

- Add a simple setup of Source -> Processor -> Sink

- Duplicate the basic "Box" item in the FlowItem Bin. I renamed it "BoxAnimated".

- Open the properties and click "Edit" under "Visuals/Animations" in the General tab.

1630924306144.png

- In the window that opens, drag a "Cube" from the library into the model and resize it to be the same size as the original item and place it in the same location as well. This shape will visually replace the actual item later on.

- In the "Animations and Components" bar at the bottom add a new animation.

- With the cube selected, add a new "keyframe" at time 0.

1630924503191.png

- Now move the item as far as it should travel on the processor and add a new keyframe at a later time (I chose 1s).

- Then, I move the cube back and add a third keyframe at 2s. When you hit run now, the cube should move back and forth between the two positions.

1630924815951.png

- In the properties on the right, under "Animation1" (or whatever else you named your animation), set the repeat type to "Repeat Set Number" and set the value to 3.

1630924782870.png

- Back in the properties window of the flow item, delete the path under "3D Shape", so only the cube you just added is drawn.

1630925946481.png

- Now we switch to the properties window of the processor. First, uncheck the "Convey Items Across Processor Length" option in the top right.

- Next, add two things to the "OnEntry" trigger: Set the x-position of the item to 0, and the other two values to the middle of the respective axis of the processor (Set Location). And tell the animation you defined to start (Start Animation).

1630925130947.png

If you now choose to create the newly defined FlowItem in the source, it will run its animation when entering the processor. The time the animation takes will probably not align with the process time though. This could be fixed by moving the keyframes of the animations, so its total time is equal to the process time, but there is an easier way.

When you open the code window of the "OnEntry" trigger, you will find the line

object.animations[/** \nAnimation: *//***tag:animation*//**/"Animation1"/**/].start();

near the bottom. You can add parameters to this command to influence the speed of the animation.

object.animations[/** \nAnimation: *//***tag:animation*//**/"Animation1"/**/].start(SPEED_TYPE_DURATION, getvarnode(current, "cycletime").evaluate()/3);

will set the speed will set the speed so the animation can run exactly 3 times during the process time of the processor.

More info in the documentation:

https://docs.flexsim.com/en/20.2/Reference/CodingInFlexSim/FlexScriptAPIReference/Data/Animation.html#Method-start


· 4
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Abhijeet P avatar image Abhijeet P commented ·

@Felix Möhlmann, Thanks for reply I had tried as per your suggested steps for animation creation. Upto Box animation is ok but, animation not worked on processor in model. I have attached my model for referance please check and suugest how to solve the issue. Want create animation on Red colored processor named "Hot Mill".Taloja Model 09.09.fsm

0 Likes 0 ·
Ryan Clark avatar image Ryan Clark Abhijeet P commented ·

Hello @Abhijeet P,

I was able to fix your problem. It turned out that you were trying to start "Animation 1" with the OnEntry trigger on the HOT MILL, but the animation was actually called "Animation1" with no space. I also adjusted the animation, so it takes up the length of the processor, and I think it works as you wanted now. I hope this helps!

taloja-model-0909-rc.fsm

1 Like 1 ·
Abhijeet P avatar image Abhijeet P Ryan Clark commented ·
Yes This works now as we want. Thanks for your help.
0 Likes 0 ·
Show more comments