Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk 3ds® Max® / MaxScript / help with fn using execute
  RSS 2.0 ATOM  

help with fn using execute
Rate this thread
 
51362
 
Permlink of this thread  
avatar
  • polypic
  • Posted: 16 January 2011 12:55 AM
  • Total Posts: 8
  • Joined: 16 January 2009 05:47 AM

hi there
i have done a script to get back the modifiers for all objects selected & assign values to the properties of it so i just have a problem with this fn the fn should return array with all modifiers properties & another array with the index of the bool values properties

fn Modname sel =
(
if (
sel[1] == undefinedthen (messagebox "plz select objects & press  again"
)
 else(
global 
allmod #()
global modprops #()
global bool_index #()
for obje in sel do 
 (
 for 
m in obje.modifiers do 
 (
 
allmodbefore allmod.count
 
if ((findstring m.name " " )!= undefined ) do
 (
 
filterString m.name " "
 
nametmp ""
 
for 1 to b.count do nametmp += b[i] 
 m
.name nametmp
 
)
 
appendIfUnique allmod m.name
 
if allmod.count != allmodbefore do(
 
modprop getPropNames obje.modifiers [m.name]
 modpropf 
#()
 
indv_boolindex #()
 
for pro in modprop do 
 (
 
obje.modifiers [m.name]
 st 
"a."+(pro as string)
 
pr_val execute (st )
 
 try(
 if  (
pr_val == true or pr_val == false)do(
 
append modpropf pro
 append indv_boolindex modpropf
.count
 
)
 (
pr_val as float )
 
append modpropf pro
 
)catch ()
 )
 
append modprops modpropf
 append bool_index indv_boolindex
 
))
 ))
 return 
bool_index
 
return modprops
 
return allmod
)

when i run the fn frist time when i open the max i get an error in
-- Frame:
-- pr_val: undefined
-- st: “a.BendAngle”
-- a: Bend:Bend
but run the fn again it works fine
why ?



Replies: 1
/img/forum/dark/default_avatar.png
--change this...
st "a."+(pro as string)

--
to...
st "$"+obje.name+"."+a.name+"."+(pro as string)
Author: Anubis

Replied: 16 January 2011 02:22 AM  
avatar
  • polypic
  • Posted: 16 January 2011 04:28 AM

thank u
worked very fine
thanx



Replies: 0