question

Ralf Gruber avatar image
0 Likes"
Ralf Gruber asked Ralf Gruber commented

How to change a single crane component's color?

Hi guys,

I want to be able to change the color of only a component of the crane, e.g. the hook object, to be able to use it as a status indicator. Finding the object in the drawsurrogates node and changing its color by script does not seem to have an impact. In the animation creator, selecting the hook and trying to change its color by using the drop down menu of its color field causes an error message.

I assume, this is caused somehow by the components inheriting the color from the owner object of the draw surrogate objects? Same applies to the robot.

My current (ugly) solution is to add another drawsurrogate with the animation creator, that is moving with the hook. For that one, I can change the color by script, but I have an extra object moving around with the crane hook. Is there a better solution to this?

Thanks

FlexSim 20.1.0
flexsim 20.1.0crane color
5 |100000

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

1 Answer

Phil BoBo avatar image
1 Like"
Phil BoBo answered Ralf Gruber commented

The surrogate objects will use the main object's color if their color attribute does not have any subnodes.

If you want to change a surrogate object that is configured that way to have its own color instead of using the object's color, just add subnodes with number data under the color attribute of that surrogate object:


1587572346598.png (564.2 KiB)
· 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.

Phil BoBo avatar image Phil BoBo ♦♦ commented ·

The "hook" is the main object. It isn't a surrogate object. The crane's main shape is Hook.3ds and it uses the main object's color.

You want to change all the other components (frame, bridge, trolley, runner, etc.) to not follow the main object's color and specify specific colors for those other components.

0 Likes 0 ·
Phil BoBo avatar image Phil BoBo ♦♦ commented ·

I added a case to the dev list to consider updating quick properties for surrogate components to behave like the People Visuals Color picker that lets you specify “Use Object Color” in a checkbox:

That should fix the exception you get when you try to set the color on a component that uses the main object's color.

0 Likes 0 ·
1587573714267.png (8.6 KiB)
Ralf Gruber avatar image Ralf Gruber ♦ Phil BoBo ♦♦ commented ·

Thanks a lot, Phil.

0 Likes 0 ·