question

Martin K6 avatar image
0 Likes"
Martin K6 asked Martin K6 commented

How to add custom animation to model?

Hi,

I would like to ask how can I add a custom animation to model? The idea is to add "signal" animation to dispatcher in the .fbx file. I have attached the .fbx file for the example. If I open the animation properties of dispatcher, I am not able to load this file. I would like to have the signal animation around the dispatcher object.


Does anyone knows how to deal with this?


Thank you a lot.

signal.fbx

FlexSim 22.1.0
animationdispatchercustomtasksequence queuesignal
signal.fbx (60.6 KiB)
· 12
5 |100000

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

Jason Lightfoot avatar image Jason Lightfoot ♦ commented ·

It loads without problem for me but is just a sphere. Same in 3DSMax.

0 Likes 0 ·
Martin K6 avatar image Martin K6 Jason Lightfoot ♦ commented ·
Can you share me a model with this implementation please?
0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ Martin K6 commented ·
0 Likes 0 ·
1647869693063.png (24.6 KiB)
signal.fsm (143.8 KiB)
Show more comments

1 Answer

·
Jason Lightfoot avatar image
1 Like"
Jason Lightfoot answered Martin K6 commented

You can add this code to the draw trigger of the dispatcher:

double maxRadius=2;
double expansionRate=0.3; //  m/sec
Dispatcher disp=current;
if (disp.taskSequences.length>0) {
double radius=Math.fmod(time()*expansionRate,maxRadius);
drawtomodelscale(current);
drawsphere(00.65,-0.43,2.88,radius,0,255,0,0.5);
}

Which gives you this effect when there are jobs queued:

dispatchersignal.gif

dispatcherQonDraw2.fsm


· 2
5 |100000

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

Jason Lightfoot avatar image Jason Lightfoot ♦ commented ·

With the dispatcher highlighted the Properties panel (usually on the right) will have a triggers section where you can add triggers.

1648127230570.png

Once you've added the OnDraw trigger, just open the code using the script icon and paste the code beneath the green comment about the function returning true.

0 Likes 0 ·
Martin K6 avatar image Martin K6 Jason Lightfoot ♦ commented ·
Yes, I found that. Thank you a lot.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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