batchmaterial

hi everybody

I wrote one script "batchmaterial-ok.ms" It works

I entered edittext "(if iskindof m vraymtl then
(m.reflection_maxDepth = 16)

)"

In order to link shortcut key,
I only added 2 lines(line1 and line83 in the script):"batchmaterial-not-ok.ms"

It dosn't work and show"Call needs function or class, got: undefined"

What may I do ?

AttachmentSize
batchmaterial-ok.ms2.54 KB
batchmaterial-not-ok.ms2.54 KB

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
miauu's picture

.

macroScript MaterialBatchModify 
Category:"M Tools(material)" 
toolTip:"MaterialBatchModify" 
buttontext:"MaterialBatchModify"
(
 
 
 
	Rollout MaterialBatchModifyrollout "MaterialBatchModify" width:186 height:600
	(
		groupBox grp1 "material batch modify" pos:[7,12] width:170 height:579
		radioButtons rdo1 "material type" pos:[48,39] width:59 height:78 labels:#( "medit", "scene") --default:1
		editText edt1 "" pos:[15,387] width:148 height:166
		label lbl1 "modify" pos:[67,366] width:33 height:17
		button btn1 "OK" pos:[37,559] width:103 height:22
	   checkbox chk1 "all" pos:[32,146] width:39 height:18
		spinner spn1 "" pos:[31,185] width:43 height:16 range:[0,999999,0] type:#integer
		spinner spn2 "" pos:[110,185] width:43 height:16 range:[0,999999,0] type:#integer
		label lbl3 "to" pos:[88,186] width:12 height:15
		groupBox grp2 "range" pos:[16,125] width:154 height:94
		groupBox grp4 "array" pos:[16,229] width:154 height:114
		spinner spn3 "" pos:[23,259] width:38 height:16 range:[0,999999,0] type:#integer
		spinner spn4 "" pos:[72,259] width:38 height:16 range:[0,999999,0] type:#integer
		spinner spn5 "" pos:[121,259] width:38 height:16 range:[0,999999,0] type:#integer
		spinner spn6 "" pos:[23,283] width:38 height:16 range:[0,999999,0] type:#integer
		spinner spn7 "" pos:[72,283] width:38 height:16 range:[0,999999,0] type:#integer
		spinner spn8 "" pos:[121,283] width:38 height:16 range:[0,999999,0] type:#integer
 
 
 
		groupBox grp13 "range" pos:[22,166] width:139 height:42
 
	 on edt1 entered txt do  execute ("fn mtlbatmodify M = " +(edt1.text) )
 
 
		on btn1 pressed  do
	(          case rdo1.state of
		(
		1: (materialtype = meditmaterials ; mtlcount = meditmaterials.count
			)
		2: (materialtype = scenematerials; mtlcount = scenematerials.count
			)
 
		  )
 
 
 
 
		if spn1.value != 0 and spn2.value != 0 then
 
		(for i = spn1.value to spn2.value do mtlbatmodify materialtype[i])
 
		if chk1.checked !=  false then
		( 
			for i = 1 to mtlcount do mtlbatmodify materialtype[i]
		)
 
		if spn3.value != 0 then
		(
		 mtlbatmodify materialtype[spn3.value]
		)
 
		if spn4.value != 0 then
		(
		  mtlbatmodify materialtype[spn4.value]
		)
 
		if spn5.value != 0 then
		(
		  mtlbatmodify materialtype[spn5.value]
		)
 
		if spn6.value != 0 then
		(
		  mtlbatmodify materialtype[spn6.value]
		)
 
 
 
 
 
	)
	)
 
 
 
 createDialog MaterialBatchModifyRollout 196 620
)  

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.