Ah, you mean that kind of (dialog) element.
No , I'm afraid not.
But I can tell you, this element is also on my wish list, quite close to the top.
An alternative could be, to use 2 buttons (+/-) to increment / decrement the rpm
@2 even though this kind of "online" update is probably the second best way,
as for the mentioned alternative it is possible.
Now that I have animated the drum, I want to change the colour of the drum from green to red based on values 0 to 4.
I used following code if value is 0 and color is green:
.Models.Frame._3D.setGraphicMaterial(makeArray(1), 65280, 2697513, 0, 0, 0, 0.199999996996301, "Drum");
But I got error saying the graphic group 'Drum' does not exist.
you would have to change the path to the one of your "drum" class to make it work. This would look similar to the following code:
.Models.Frame.Drum._3D.setGraphicMaterial(makeArray(1), 65280, 2697513, 0, 0, 0, 0.199999996996301, "default");
Here you would have to set for "default" the name of the part of your drum whose color you would like to change. So if the graphic of your drum consists of several parts you would have to address each of those parts separately. You can see the graphical structure of your drum by right clicking on it and selecting "Show Graphic Structure". If your aim is to signal different states of your machine, you could also just create another custom graphic for your drum and change its color, instead of having to change the color of every single part of the drum as a whole.
I have attached the graphic structure of Drum.
When I added the code you @IgorKunjavskij sent, I got error saying "unknown identifier Drum".
So I changed the code to :
.Models.Frame.Assembly1._3D.setGraphicMaterial(makeArray(1), 545354, 2697513, 0, 0, 0, 0.199999996996301, "default"); and gave a print statement. The result was printed in console but the color did not change.
I assume that Assembly1 is the object whose graphics you want to colour.
The code you posted now defines a material on the first direct child graphic (that is what makeArray(1) specifies) of the graphic group default (that is what the string parameter "default" at the end specifies - if you work on the default graphic group, by the way, you can just omit that parameter).
If the graphic is suitably structured and coloured before, you will see that change. Unfortunately, in many graphic files, the materials are not defined on a high level but pretty deep below. That is especially unpleasant if you take into account that the deepest material "wins", meaning that this is the material which is actually used in the visualization. This makes sense, though, as doing it otherwise would render it virtually impossible to create a graphic structure with materials that allows you various colours in different parts of the graphic.
To facilitate use cases in which the material of an entire graphic structure is to be changed, we have a button on the "Material" page of the 3D properties dialog of a graphic. If you press the red-crossed-button, all deeper-defined materials are removed, forcing the material on the graphic node at hand to be used.
You probably have to do this only once (depending on your workflow) as, once the materials are gone, they do not come back on their own.