GUI shows M (meters) instead of CM (centimeters) in CUSTOMGUI_VECTOR
-
I programmatically create a vector gui using CUSTOMGUI_VECTOR. I set DESC_UNIT to DESC_UNIT_METER.
However the gui will show CM after the number. And i would like it to display M for meter at the end of the number.
I cant find in the SDK how to do this -
Hey @ECHekman,
Thank you for reaching out to us. Cinema 4D is unitless, you cannot set a value to CM or M. The description flag is meant abstractly, a better name might have been
DESC_UNIT_DISTANCE
, as that is all it will do, enforce that values are decorated with a unit symbol for the chosen unit of distance.I not too long ago explained here how units work in Cinema 4D.
Cheers,
Ferdinand -
Ok that makes a lot of sense. Ill see what i can do on my end then
-
Hey,
it seems I was a bit too tightlipped here. So in more verbose: You cannot customize the chosen unit of a parameter. This is impossible as this is a globally set value (which is also just smoke and mirrors as explained in the link above). There is a UnitScale custom GUI but it does not what you want, it is the field used in the document settings and is not really meant to store a value and unit but just a unit.
When you really-really-really want this, you can implement you own custom GUI, either targeting your own custom data types or existing data types. There you could then do whatever you want. But that might not mesh so well with the rest of Cinema 4D, given that Cinema 4D does not operate like that.
Cheers,
Ferdinand