[Closed] How to know when a value is float or scene units
If I gather the parameters of an object by grabbing the stream from executing “show”, the value types returned are typically float for, for example, position, radius, etc. They are also float for non space value parameters like “hemisphere”.
If I am to show the correct value in my script, I need to take in to account the display units of the scene and convert accordingly.
I’m using dotnet, so unfortunately I can’t use standard max displays which I know take display-units in to account.
So, is there a way to find out programatically whether a parameter value type is simply a float value or a worldunits value?
Thanks!
you can’t get spinner type of a parameter of a parameter block using pure mxs. it’s for sure.
by using SDK you can get it only if parameter in a IParamBlock2…
Thanks Dennis,
Glad to hear I’ve not missed an obvious mxs solution!
Do you think this is something I could do as a runtime compile c# routine? I don’t want to have a compile dll as part of this script.
ie
fn getparamtype class param =
(
– paramtype = call to some c# voodoo
– return paramtype
)
I’ve not had much/any experience writing these runtime routines, so wouldn’t really know where to start. If it’s possible then I’ll get learnin!
you can get parameter type… you can’t get spinner type. with c# sdk you can get it for param block2. and you don’t have to make a dll for that. you can use c# sdk from mxs as i know. i don’t do it but i remember some seen examples.
Yup, sorry, it was the parameter-type (more specific than float, ie is the value a float or world-units float) I needed; I just used the spinner as an example of where max does this automatically under the hood, and which is not possible, as far as I am aware, with a dotnet spinner.
I just want to be able to display values in the correct display-unit space.
The mxs function for doing this seems dog slow, and it doesn’t know whether it SHOULD convert a value into worldunits anyway, so it’s not much use to me.
Do you know if python called from within max is as slow as I would imagine? Apparently I can access types through the paramblocks in python.
Thanks again
p.