Announcement

Collapse
No announcement yet.

Maxscript Vray What does it all mean?

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

  • Maxscript Vray What does it all mean?

    I declare my hand. I'm a very low to intermediate skill level user of max. But I recently started dabbling in maxscript. And I spend a lot of time (after learning to model) tweaking vray settings in max. I was thinking it would be timesaving if I knew something about each of the properties. But there is very little documentation out there. So I was wondering if anyone had a tabulated document that could annotate the following script (my second for maxscript) with value ranges, meanings, and default values.
    here is the script:
    vr = renderers.current
    V_Ray_Adv_1_50_SP1:V_Ray_Adv_1_50_SP1

    showproperties vr
    .imageSampler_type : integer
    .filter_on : boolean
    .filter_kernel : maxObject
    .filter_size : float
    .filter_paramA : float
    ...
    ...
    ...
    (it was too long so Its now an attachement)

    so I demonstrate my ignorance now as I don't know how to compile a list of properties with their current values (so that I can modify them) I know how to set it something, and how to get an array of them but I was wanting to set up some common presets between max machines as presets don't really work as expected and there was some stuff that I like to tweak that presets don't cater for.

    a table such as I am asking for above would be useful for other vray properties, but not as essential as the rendersettings because its pretty easy to work out vraymtl and the like. The rendersettings dialog is so large that I get lost...
    Raj
    Attached Files

  • #2
    Hmm, sounds like a lot of work to me

    For the most part they make pretty good sense and should be pretty obvious as to what roll out to find them in. If there are some you can't find I'd be happy to help.

    You might want to look at Marc's "VRay preset manager" been a while since I looked at the code but if I remember correctly it just dumped all the properties to a text file, probably easier to do that than to pick through them for the more relevant ones.
    Eric Boer
    Dev

    Comment


    • #3
      i guess it is a lot of work, and for people who use vray a lot it would be second nature, but to us noobs its all a bit bewildering. I thought making a pdf would be good for other noobs too read. Otherwise every person would have to learn the default values in this trial and error fashion.

      for instance, just taking the first line:
      .imageSampler_type : integer

      prompts the question: what does each integer mean.
      Sure I and future users could by a process of trial and error work it all out. BUT suffer the little children...

      I don't mind working through it all, and compiling a spreadsheet and printing that to a pdf. At least I'll have it for my own reference when I forget a rarely used item. I would happily make this avaialable to all.

      But I am thinking that this data already exists somewhere in the world of vray?

      anyway thanks for your help
      Raj
      Last edited by rajdarge; 24-12-2007, 03:30 AM.

      Comment


      • #4
        To be perfectly honest with you, if you know what you want from vray, the maxscript hooks and functions are well self-descriptive.
        In any case, turning the macrorecorder on will show you most spinner property name and its value type (VRayLight.halfLength=30, for instance).

        For the renderer menu, you can "inspect" the values by doing the next step from the one you did listing all properties.

        Code:
        renderers.current.imageSampler_type = integer
        ,for instance, means that parameter can only accept values of Integer type, ie. 0, 1, 2 and so on.
        if you now watch VRay's sampler type pulldown, you'll notice that typing

        Code:
        renderers.current.imageSampler_type = 0
        will change it to fixed sampling.
        in the same way, change it in the rollout, and type

        Code:
        renderers.current.imageSampler_type
        to read what value corresponds to which option of the rollout.

        There are more than one issue with writing something like you propose, that i can see from afar:
        (*)Retro-compatibility with vray versions: names have changed, as well as options added in the latest releases.
        This writes off the idea of simply dumping data blindly, and would force you to write checks in the code.
        (*)Bitmap handling in hand saving presets: I find it very messy, on the maxscript side, with plenty of exceptions. VRay only follows the rules, but in doing so inherits all the maxscript issues.
        Then again, this may be my own ineptitude.
        Lele
        Trouble Stirrer in RnD @ Chaos
        ----------------------
        emanuele.lecchi@chaos.com

        Disclaimer:
        The views and opinions expressed here are my own and do not represent those of Chaos Group, unless otherwise stated.

        Comment


        • #5
          .

          Originally posted by ^Lele^ View Post
          In any case, turning the macrorecorder on will show you most spinner property name and its value type (VRayLight.halfLength=30, for instance).
          The macro recorder doesn't work for the render dialog window . It does work for lights and things in the scene which is good. But generally those setting are pretty descriptive. Its the render settings window where I get lost cause its so enormous.

          Originally posted by ^Lele^ View Post
          For the renderer menu, you can "inspect" the values by doing the next step from the one you did listing all properties.
          Code:
          renderers.current.imageSampler_type = 0
          will change it to fixed sampling.
          see now both you and I know this now, and I know its only a small thing. But when you have hundreds of small things to learn... it gets a bit overwhelming. Especially as you have to commit them all to memory rather than have a searchable table to reference. I am 99% sure that such a table or database exists in vraydom. Surely the programmers kept records of the maxscript changes and commands for each of the different versions?

          Originally posted by ^Lele^ View Post
          There are more than one issue with writing something like you propose, that i can see from afar:
          (*)Retro-compatibility
          (*)Bitmap handling in hand saving presets: I find it very messy, on the maxscript side, with plenty of exceptions. VRay only follows the rules, but in doing so inherits all the maxscript issues.
          Then again, this may be my own ineptitude.
          Speaking of ineptitude did I mention that I was a noob? I guess I'll find out what "maxscript issues" means soon enough. At the moment I am having a lot of fun with maxscript, but I know that situation will change (as I experienced when I tried and failed to learn visual basic). The problem I had with visual basic was not the logic of the code, but dealing with the os and how much of it all was undocumented. In my work I deal every day with jargon, and I try and cut through all the rubbish to get to the meat of an issue for those people that come to me for advice. I would like to reveal the mystery to those that come after me, just a little, if I can.

          Oh dear, I sound earnest ... smacks self in head

          Raj
          Last edited by rajdarge; 24-12-2007, 12:18 PM.

          Comment


          • #6
            Raj,
            I guess what I don't understand is if you're learning VRay's settings, why not just learn them in the UI? It seems counterintuitive to learn them in maxscript if you don't need to know the maxscript equivalents.

            If you want some suggestions for test settings and why they are test settings we could certainly give you some suggestions.

            -Colin
            Colin Senner

            Comment


            • #7
              Thanks for you reply moondoggie (colin) and seasons greetings.
              The UI is very useful for discovering what functions maxscript has when it comes to vray lights, cameras, materials etc
              I can turn on the macrorecorder and watch my UI settings change. and discover a lot about each setting

              But this doesn't work for the render dialogue window.

              So to discover what a particular command does you need to know its name and interrogate that value to figure out what each one means. The names don't always correspond well with the UI name. and there are around 250 different commands just for this interface.

              So the process would involve starting at the top, interrogating each value working out which UI setting each command corresponds to finding out the range of values either by the UI or by putting values in the setting command until one returns an error. Recording this and so on and so forth.

              This would be done 250 times and some values only change dependant on other values being set (for instance vray.gi_on is required before vray.gi_primary_type has any meaning). This processes would have to be done for every new user of vray and maxscript and I am sure every old hand at vray scripting would know it all off by heart.

              I wanted to shorten that time between starting and knowing. And having a searchable reference would also be useful for developers of maxscripts: especially if it had information about previous versions of vray. This could be used for version checking and perhaps backwards compatibility.

              sorry to drone on. I have started my own table so far. But it only works for vray 1.5 sp1 cause that is the only version I have installed.

              Raj
              Last edited by rajdarge; 26-12-2007, 01:25 PM.

              Comment


              • #8
                I certainly hope your season is well. Thank you.

                I'm pretty sure the way we all learned VRay was just playing around with the render settings. We didn't need to know that renderers.current.gi_on turns on Indirect Illumination. We just clicked it in the render rollout. Playing around and reading the vray manual helped us all learn.

                Here is the manual hosted on spot3d: http://www.spot3d.com/vray/help/150R1/

                Going through and finding out what things do is essential to learning. If you were looking for some draft/final quality settings, it can vary a bit depending on your scene.

                Here is my rough draft setting for quick test renders

                global switches:
                ----------------
                displacement unchecked

                antialiasing:
                ------------
                fixed: 1, filter off

                Indirect Illumination
                --------------------
                on, primary bounce: Irradiance map
                secondary: light cache

                Irradiance Map
                ---------------
                min: -5
                max: -3

                light cache:
                ------------
                subdivs: 250
                store direct light checked
                use light cache for glossy rays checked

                settings:
                --------
                adaptive amount: .97
                noise threshold: .2

                -Colin
                Colin Senner

                Comment


                • #9
                  Indeed my season is well. A trifle hot and I could do with some more rain...

                  I know the only way to learn is the hard way. I am not trying to shorten that time. But its better I understand from the outset what a command is meant to do and how far I can push it without having to learn every time that the red button on the oven turns it on. It usually has a little thing in the manual that says that, And a warning that ovens get hot.

                  Yes, the manual is a very useful beast, but the vray one has very little reference to maxscript. The names in maxscript are at times inconsistent with their use in the UI. Vlado has explainied this in another post. I can understand the reasons why, but a translator would be useful.

                  and as far as test renders go: I usually have both primary and secondary renders as light cache, with subdivisions set at 200 and I have store direct light off cause it does wierd things if you start using renderelements and have transparency mapped hair or any objects like this. All the rest is more or less the same. The noise threshold I usually leave alone, but i will play around with it.

                  My first project is going to be a bracketing renderer but I got to learn a lot more first
                  Raj

                  Comment


                  • #10
                    I put my bracketing exposure on hold because i aint smart enough yet. If I eat my cornflakes and practice I might get smarter and learn enough

                    Anyways I have a new problem. Kinda vray related and was wondering if anyone knew the answer:

                    I am making a VrayfastSSS material via script and it needs to work in real-world human units.

                    Now i have my system setup in 3dsMax8 with 1 GU (generic unit) = 1cm
                    and I want to set my depths in world units to 0.1 cm (for instance)

                    I use a line:
                    $.material.shallow_radius = 0.1

                    now because I am using 1GU = 1CM it works.
                    But if I change the default units to 1GU = 1M or 1GU = 1 inch then the object I am applying this material to will look vastly different because of the absolute difference in the depth of light penetration.

                    I know I can check the units setting of the system and then make a lookup array to do the conversion with a simple function. But is there a built in function that will do the conversion for me? Or is there a way of entering data into max script and be able to specifiy the units used. I usually work in mm so I would like to be able to do something like

                    $.material.shallow_radius = 1 mm

                    (yes I know this line gives me an error).

                    thanks in advance for your help.

                    (I also posted this at CGtalk if you can see it over there. And thanks for the help so far hear. I just wish I knew more so I woudln't have to ask these stupid questions)

                    Comment


                    • #11
                      You can use the following:
                      Code:
                      $.material.shallow_radius=units.decodeValue "1mm"
                      This will convert 1 mm to whatever internal units 3ds Max is currently using. This works in 3ds max 9, not sure about 8 though.

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

                      Comment


                      • #12
                        thanks : 8 )

                        that fixed it for me. I kept scouring the help file, but never stumbled across that one line and in max 8 there is only one line that describes what that does. I have to error trap it though. Damn
                        thanks again vlado.
                        Raj

                        Comment


                        • #13
                          OK I've run into another problem
                          TO make up the texture for a female face
                          I use a base texture map and add mix layer textmaps for makeup, shiny lips etc.
                          I do this manually at the moment and link all the texmaps as a tree with the texture map mix .map1 value.

                          the number of mix layers can vary from 1 to 12
                          so to build up an ordered 2d array of all the relevant values (4 per mix texmap) I have to collect values for .mask values and texture maps this way

                          map1.map1.map1.map1.map1....filename = "facetext.png"

                          the number of map1's is regulated by how many branches I have iterated along

                          so then I have to collect text strings and concantenate and then execute this textstring and attach it to a variable. This sounds a bit like self modifying code and the alarm bells start ringing.

                          first I don't know how to execute a text literal as a line of commands
                          second Is there any other way people can think of doing this

                          It has partial relavance to vray because at the top of the stack it becomes the diffuse value for a vraymtl. (yes I know I am clutching at straws but for my first script I feel like I'm giving birth with complications and am waiting for the foreceps to arive )

                          I uploaded a screengrab of the nodejoe interface that illustrates the structure of what i am trying to achieve. this nested mix map has only a few layers. I have some with many more.
                          problem is that I dont know how many layers there are to start with.
                          Raj
                          here is the link
                          http://www.comcen.com.au/~raj/NodeJoey.jpg

                          I dont know how to upload a pic so that it is viewable here.
                          sorry.
                          Last edited by rajdarge; 09-01-2008, 01:49 AM.

                          Comment


                          • #14
                            It is not necessary to do the self-modifying thing; it is quite easy to write this in a recursive way:

                            Code:
                            fn setFile t = (
                            	if t!=undefined then (
                            		if (classof t==BitmapTexture) then (
                            			-- set the bitmap file name here
                            			t.filename="test.png"
                            		) else if (classof t==Mix) then (
                            			-- recurse into the mix map
                            			setFile t.map1
                            		)
                            	)
                            )
                            
                            fn test mtl = (
                            	setFile mtl.diffuseMap
                            )
                            This piece of code will recurse into all the map1.map1.map1... etc levels until it finds a bitmap, and replaces the name of this bitmap. You can expand this as necessary to change other maps as well.

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

                            Comment


                            • #15
                              that is SOOOO elegant.
                              but isn't a function calling itself dangerous

                              Ok here is the final code:

                              /*
                              collect from a series of nested mix maps specific values and write them to a text file
                              */

                              global indxmk = 1 --index counter for the 1st dimension of a 2d array used below = p

                              fn CollectMIXValues t =
                              (
                              if t != undefined do
                              (
                              if (classof t == BitmapTexture) then
                              (
                              -- set the bitmap file name here
                              -- bitmap is not needed as that is set later with another function
                              ) else if (classof t == Mix) do
                              (
                              -- make array (p) with values at each level
                              p[indxmk]= #(t.color2 , t.mask.output.output_amount , t.mask.filename, t.name)
                              indxmk += 1 --iterate
                              setFile t.map1 -- recurse into the mix map by parseing the current map, submap 1 of it
                              )
                              )
                              )

                              CollectMIXValues (meditmaterials[11])
                              print p


                              and here is the output

                              1
                              CollectMIXValues()
                              undefined
                              #((color 154 0 0), 0.47, "Y:\3DResources...RajDarge\LPK_03.jpg", "Lipstick")
                              #((color 65 21 0), 0.21, "Y:\3DResources...RajDarge\LK_Ria_Blurred.jpg" , "LipLiner")
                              #((color 17 0 80), 1.0, "Y:\3DResources...RajDarge\ELK_01.jpg", "EyeLiner")
                              #((color 43 44 45), 0.2, "Y:\3DResources...RajDarge\EM_01.jpg", "EyeShadowLiner")
                              #((color 12 41 137), 0.44, "Y:\3DResources...RajDarge\ESK_02.jpg", "EyeShadow")
                              #((color 179 54 54), 0.5, "Y:\3DResources...RajDarge\BLK_03.jpg", "Blush")
                              #((color 255 12 0), 1.0, "Y:\3DResources...RajDarge\FMK_01.jpg", "FACEMASK")
                              OK
                              OK
                              I don't know where the "undefined" in the output is coming from , not quite sure why its printing out if t =! undefined.

                              I suppose the reason I didnt arrive at anything near this conclusion is that I'm still not used to parsing a whole material array as a variable. I suppose I'm still used to only parsing the names as variables. Powerful and difficult concept to grasp if your new to programming.
                              anyway thanks heaps with that.
                              I will now be able to make a gui and all.... I havent worked out file managment but I think from reading the maxscript helpfile I can just print to a file.

                              PS is there anywhere I can find out how to format my messages and how to turn HTML on?

                              Raj

                              Comment

                              Working...
                              X