question

Sri_vikas K avatar image
0 Likes"
Sri_vikas K asked Jason Lightfoot commented

FluidToItem visual change

Hi Flexsim community,

I wanted to add a trigger on exit to FluidToItem. I changed the visual to BOX.3ds and changed the color to white. The Item color is changed to White and Item shape remains Circle. Is this a bug?


1694424522400.png


Thanks in Advance.

FlexSim 23.1.3
fluid
1694424522400.png (194.8 KiB)
· 1
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 ·

Hi @Sri_vikas K, was Joerg Vogel's answer helpful? If so, please click the "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 comment back to reopen your question.

0 Likes 0 ·

1 Answer

·
Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered Joerg Vogel edited

There is a slight difference between both objects a circle and a box. You can compare both in the tree. The object circle is a billboard 2D object. You need to disable it by flag operation

Please refer to https://answers.flexsim.com/answers/28299/view.html

item.attrs.find("/visual").subnodes.add().name="shape";
item.attrs.find("/visual").subnodes.add().name="shapeindex";
rebindobjectattributes(item.attrs.find("/visual"));
imageindexobject(item).value = 0;
shapeindex(item).value = 0;
set(drawflags(item),get(drawflags(item)) &~ DRAW_FLAG_BILLBOARD_MASK);

I am not sure, if every code line is necessary. I put this in the onExit trigger of FluidToItem object as first behind header declaration.

EDIT: FluidToItem_shaped_Object.fsm

You still need a change of shape and resize involved item, too.


5 |100000

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

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.