Announcement

Collapse
No announcement yet.

Accessing Translucency Parameter from Maxscript

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

  • Accessing Translucency Parameter from Maxscript

    As some of you are probably aware, I am currently writing a material lister maxscript function that allows comparison of multiple material parameters within the same rollout.

    I am trying to add a spinner to control the Translucency Thickness Paramater. The problem is that I can't assign this parameter a controller, so I am unable to link the spinner value with the T.Thickness parameter.

    How do I link the spinner value with a vray material parameter that is 'not animatable' ? I appreciate the fact we don't need the thickness value to be animatable, but I need it to be animatable to be able to assign a spinner to control its value.

    Thanks for any advice

    For the latest version of the script go here :- http://www.chaosgroup.com/forum/phpB...14540&start=25
    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'm not sure how to do this myself, but maybe you can ask on the Autodesk support forum, I'm sure some of the MaxScript guys there would know the answer.

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

    Comment


    • #3
      Thanks vlado, I'll check that out.
      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
        "link" is a bit of a generic term...
        I managed to control any vray material parameter through scripting,and withouth any use of controllers,in a project hopefully to be released sometimes soon...
        An example of the code, and issue, would help...

        Lele

        Comment


        • #5
          Sure, here you go.

          Code:
          -- Create Controller (this isnt possible as the vray parameter isnt animateable)
          
          if (MLister.matIndex[mlister.count].translucency_thickness.controller == undefined) do MLister.matIndex[mlister.count].translucency_thickness.controller = bezier_float ()
          
          -- Define spinner controller to adjust transclucency thickness
          
          
          MLister.vrayMatRC.addControl #spinner (("MatTransThSlide" + MLister.count as string) as name) "" paramStr:(" range:[0,10000," + MLister.Matindex[MLister.count].translucency_thickness as string + "] height:" + MLister.mly as string + " offset:[190," + MLister.mlyo as string + "] width:45 scale:1 type:#integer tooltip:\"Translucency Thickness Amount\" controller:MLister.matIndex[" + MLister.count as string + "].translucency_thickness.controller")
          I'm not a very experienced maxscript coder, so if you can tell me how to map a spinner to a non-animateable parameter, I'd be grateful

          --edit -- I just realised how unintelligable that line of code is.... here's a stripped down version :-

          Code:
          MLister.vrayMatRC.addControl #spinner spinnerName "" paramStr:(" range:[0,10000,curMatTransThickness] height:15 offset:[190,curOffset] width:45 scale:1 type:#integer controller:curMat.translucency_thickness.controller")
          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
            mmmh, i wrote a plugin material, hence extending the original Vray one, and had only to declare aliases to the original vray parameters, as such:

            Code:
            parameters main rollout:params
            (
                 col type:#color default:(color 5 5 5) ui:col
                 on col set val do delegate.Diffuse = val
            )
            where col is the name of the new UI colorpicker item, and delegate is a pointer to the underlying vray material.

            I am not at all familiar (even if i see what you're doing) with the way you are linking things, especially as you have to generate them on the fly, and that isn't what i was doing.
            Even if slower, can't you just add something like
            Code:
            on MLister.Matindex[MLister.count].translucency_thickness changed do "update my spinner"
            ?

            I may be a zillion years off the mark, so an answer ain't needed in ALL cases

            Lele

            Comment


            • #7
              Thanks for the suggestion Lele, I'll try that out, although I have a suspicion that was what I tried initially only to find that the spinner didn't like being created without being tied to an animatable parameter.... I could be wrong though.

              I should get a chance to check it out tomorrow.

              Cheers.
              pat.
              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