From f94960dffeda821e4fbd491c14a9d0f8f001f0ae Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Wed, 24 Jul 2013 04:16:00 +0200 Subject: [PATCH] Added the Nel material file selection possibility to the Nel material 3dsmax startup script. --HG-- branch : gsoc2013-dfighter --- .../scripts/startup/nel_material.ms | 82 ++++++++++++------- 1 file changed, 52 insertions(+), 30 deletions(-) diff --git a/code/nel/tools/3d/plugin_max/scripts/startup/nel_material.ms b/code/nel/tools/3d/plugin_max/scripts/startup/nel_material.ms index 06021c45f..efd3ab88b 100644 --- a/code/nel/tools/3d/plugin_max/scripts/startup/nel_material.ms +++ b/code/nel/tools/3d/plugin_max/scripts/startup/nel_material.ms @@ -349,6 +349,7 @@ plugin material NelMaterial cSelfIllumColor type:#color pSelfIllumAmount type:#percent bUseSelfIllumColor type:#boolean + sMaterialFile type:#string default:"" ) parameters main rollout:NelParams @@ -548,6 +549,12 @@ plugin material NelMaterial Label lblNlbpB "http://dev.ryzom.com/" align:#center CheckBox cbTwoSided "2-Sided" checked:false align:#right + group "Material file" + ( + edittext mfEdit + button materialButton "browse" + ) + group "Standard Lighting" ( -- Label lblNlbpslA "Diffuse is the color in light, ambient in the dark." align:#right @@ -574,6 +581,49 @@ plugin material NelMaterial CheckBox cbUseSelfIllumColor "Use Color" checked:false align:#right ) + on materialButton pressed do + ( + fname = getOpenFileName caption:"Open material file" types:"Nel material (*.nelmat)" + if fname == undefined then ( + if mfEdit.text == "" then + sMaterialFile = "" + ) + else + sMaterialFile = fname + + mfEdit.text = sMaterialFile + ) + + on cbTwoSided changed bval do + updateUI false + + on cpAmbient changed cval do + updateUI false + + on cpDiffuse changed cval do + updateUI false + + on spOpacity changed pval do + updateUI false + + on cpSpecular changed cval do + updateUI false + + on spSpecularLevel changed pval do + updateUI false + + on spGlossiness changed pval do + updateUI false + + on cpSelfIllumColor changed cval do + updateUI false + + on spSelfIllumAmount changed bval do + updateUI false + + on cbUseSelfIllumColor changed bval do + updateUI false + Fn updateUI update = ( if (version >= 14) then @@ -581,6 +631,7 @@ plugin material NelMaterial if update == true then ( cbTwoSided.checked = bTwoSided + mfEdit.text = sMaterialFile cpAmbient.color = cAmbient cpDiffuse.color = cDiffuse spOpacity.value = pOpacity @@ -597,6 +648,7 @@ plugin material NelMaterial else ( bTwoSided = cbTwoSided.checked + sMaterial = mfEdit.text cAmbient = cpAmbient.color cDiffuse = cpDiffuse.color pOpacity = spOpacity.value @@ -625,36 +677,6 @@ plugin material NelMaterial ) ) - on cbTwoSided changed bval do - updateUI false - - on cpAmbient changed cval do - updateUI false - - on cpDiffuse changed cval do - updateUI false - - on spOpacity changed pval do - updateUI false - - on cpSpecular changed cval do - updateUI false - - on spSpecularLevel changed pval do - updateUI false - - on spGlossiness changed pval do - updateUI false - - on cpSelfIllumColor changed cval do - updateUI false - - on spSelfIllumAmount changed bval do - updateUI false - - on cbUseSelfIllumColor changed bval do - updateUI false - on nelBasicParameters open do ( updateUI true