Announcement

Collapse
No announcement yet.

Vraylight size0, size1, size2 value class is worldunits. Shouldn't it be float?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Vraylight size0, size1, size2 value class is worldunits. Shouldn't it be float?

    If I do "classof $.size0" to a selected vraylight, the class returned is "float", but when I do "showproperties $" it shows ".size0 : WorldUnits"

    I can't find anything about worldUnits in the maxscript documentation :http://docs.autodesk.com/3DSMAX/14/E...20Help%202012/

    The script I'm currently working on relies on grabbing the value types from the output of the showproperties command; so I need the parameter data types to be correct (more or less... I can obviously catch special cases like this... but would prefer not to)

    Is there any particular reason for specifying "worldunits" when the vraylight is called by showproperties? If not, then can this be changed to "float"?

    Thanks
    p.
    Patrick Macdonald
    Lighting TD : http://reformstudios.com Developer of "Mission Control", the spreadsheet editor for 3ds Max http://reformstudios.com/mission-control-for-3ds-max/




  • #2
    I think the reason is that when the V-Ray light was created, the only way to show units for a value was to declare it as TYPE_WORLD. The ability to have it as TYPE_FLOAT, but just specify that it should be displayed as world units was added in a later 3ds Max version and things sort of stayed that way.

    I will see if there's a way to change it without breaking old scenes.

    Best regards,
    Vlado
    I only act like I know everything, Rogers.

    Comment


    • #3
      Ah, that's interesting. So this is a SDK/C++ thing, given this distinction is not apparent from a maxscript POV.
      Don't worry about it. I'm sure it's more hassle than it's worth to change. I've already got a working workaround.

      It's not the only issue I've had like this, I think a parametric light has it's type as .enabled(on) which obviously doesn't works with get/setproperty either! Oh the joys of maxscript!

      //edit
      Thanks!!
      Patrick Macdonald
      Lighting TD : http://reformstudios.com Developer of "Mission Control", the spreadsheet editor for 3ds Max http://reformstudios.com/mission-control-for-3ds-max/



      Comment


      • #4
        Changing VRayLight's size type to Float may have some undesired consequences - or example this will change the behavior of the Rescale World Units utility and the corresponding rescaleWorldUnits maxscript function.

        According maxscript documentation "worldUnits specify that a parameter holds a world distance value, kept internally as a system units float". I agree that the this is not very clear - Float parameters may also represent world distance values and be internally stored as a system units, but Float values are not affected by rescaleWorldUnits.

        Some size values in 3ds max use worldUnits type, including photometric lights.
        V-Ray for 3ds Max developer

        Comment


        • #5
          Thanks for the explanation Vasil, that clears things up nicely.
          It's odd that you can't cast a worldUnits value as float, or vice-versa.... but that's maxscript for you!
          Thanks again
          Patrick.
          Patrick Macdonald
          Lighting TD : http://reformstudios.com Developer of "Mission Control", the spreadsheet editor for 3ds Max http://reformstudios.com/mission-control-for-3ds-max/



          Comment


          • #6
            I am not sure that I understand the exact problem. worldUnits properties contain floating point values and you can usually use VRayLight.size0 as any other float value.
            Probably we will change all worldUnits parameters to float but even in this case - how would you deal with "RGB color", "boolean", "node array", etc. parameters?
            Maxscript makes difference between type name and type class and changing worldUnits to float will be a partial solution. It still could be useful though.
            Not the best solution but probably you could somehow use classof to obtain the parameter type:
            for i in getpropnames $ do print (classof (getproperty $ i))
            V-Ray for 3ds Max developer

            Comment


            • #7
              Patrick, WorldUnits is correct, it's for float values that are linked to scale. Without it when you rescale a scene max wouldn't know whether to resize that object or not.
              Maxscript made easy....
              davewortley.wordpress.com
              Follow me here:
              facebook.com/MaxMadeEasy

              If you don't MaxScript, then have a look at my blog and learn how easy and powerful it can be.

              Comment


              • #8
                When you create a maxscript spinner control you can specify it to be:

                spinner spn_a "A" range:[0,100,0] type:#float
                spinner spn_a "A" range:[0,100,0] type:#integer
                spinner spn_a "A" range:[0,100,0] type:#worldUnits
                Maxscript made easy....
                davewortley.wordpress.com
                Follow me here:
                facebook.com/MaxMadeEasy

                If you don't MaxScript, then have a look at my blog and learn how easy and powerful it can be.

                Comment


                • #9
                  Yes, there are plenty other special cases.
                  Unfortunately, I can't use classof, as some properties don't have a value until one is set, and in these situations, my script would crash (although I am sure I could handle this situation more gracefully); hence the reason for obtaining the classes of the properties by parsing the output of showproperties. It does work well, but there is some work to get usable parameter names for some things.

                  Dave, thanks for that. I know I'm probably doing things a little strange, but in my bid for efficiency, my script is gathering all the scene classes, and their datatypes and caching this prior to querying the actual objects to populate the datagridview. Also, as mentioned above, the real showstopper is that sometimes values aren't defined in a class (ie empty texture slots) so doing a classof would not return a useful value with which I could create a column of the correct datatype.

                  Oh i need a beer...
                  Patrick Macdonald
                  Lighting TD : http://reformstudios.com Developer of "Mission Control", the spreadsheet editor for 3ds Max http://reformstudios.com/mission-control-for-3ds-max/



                  Comment


                  • #10
                    Your best option is then to pass the ShowProperties to a filter and build your own database of values. I've done it for materials... it's a pain I know!
                    Maxscript made easy....
                    davewortley.wordpress.com
                    Follow me here:
                    facebook.com/MaxMadeEasy

                    If you don't MaxScript, then have a look at my blog and learn how easy and powerful it can be.

                    Comment


                    • #11
                      Yup, that's pretty much what I'm doing.
                      Patrick Macdonald
                      Lighting TD : http://reformstudios.com Developer of "Mission Control", the spreadsheet editor for 3ds Max http://reformstudios.com/mission-control-for-3ds-max/



                      Comment


                      • #12
                        Another float type you've probably not come across yet is 'angle' it's in the VRayHDRI node I think....
                        Maxscript made easy....
                        davewortley.wordpress.com
                        Follow me here:
                        facebook.com/MaxMadeEasy

                        If you don't MaxScript, then have a look at my blog and learn how easy and powerful it can be.

                        Comment


                        • #13
                          Hah, yes, probably. Thanks for the pointer!
                          Cheers
                          p.
                          Patrick Macdonald
                          Lighting TD : http://reformstudios.com Developer of "Mission Control", the spreadsheet editor for 3ds Max http://reformstudios.com/mission-control-for-3ds-max/



                          Comment

                          Working...
                          X