maxscript morpher channel name

maxscript morpher channel name

Anonymous
Not applicable
790 Views
2 Replies
Message 1 of 3

maxscript morpher channel name

Anonymous
Not applicable

please i want to write maxscript code to set morpher value by using channel name not by channel_index

 

WM3_MC_SetValue $.Morpher 1 20.0

WM3_MC_SetValue $.Morpher $Teapot002 20.0

 

or

 

$.morpher[1].value = 50

$.morpher[Teapot002].value = 50

 

 

0 Likes
791 Views
2 Replies
Replies (2)
Message 2 of 3

davidlanier
Autodesk
Autodesk

Hi,

 

I am not sure this is feasible directly though you could do :

 

--this is pseudo code, I haven't tested it :

function GetIndexFromName name =
(
 index = -1 --Not found yet
 numchannels = WM3_NumberOfChannels ($.morpher)
 for iChannel = 1 to numchannels do(
    string_nodename = WM3_MC_GetName ($.morpher) iChannel
    -- could also use <node>WM3_MC_GetTarget to get the node directly
   if (nodename == name)do (
       index = iChannel
       break
   )
 )
index --This returns the index value
)

idx = GetIndexFromName "Teapot002"
if( idx != -1) do(
  WM3_MC_SetValue $.morpher idx 20
)

Regards,



David Lanier
Principal Software Engineer
3ds Max Rendering Team
0 Likes
Message 3 of 3

Anonymous
Not applicable

thank you for your response

 

the code not working

 

i searched about this function in past time and find a function not documented in maxscript help do this but i can not remember the code now

it was one line or tow lines only

 

please try to find it to me

 

and try to tell developers in Autodesk 3ds max to add this function to morpher class beacuse it very useful

thanyou

 

like this

 

WM3_MC_SetValuebyname $.morpher Teapot002 100

0 Likes