[MAXScript] Scripted Material Plugin can't create rollout with execute

I am trying to make a material plugin via the scripted plugin system in MAX.

I have been able to create the basic functionality I need using the standard structure explained in the documentation. However, I want to dynamically add content described in the following example with a for loop, either by creating the rollout with an execute function or via the rolloutcreator tool.


plugin material EasyDecal
name:"Easy Decal"
classID:#(695425,446581)
extends:Standard replaceUI:true version:1
--Place no#1
	( 
		parameters main rollout:params
			(
				MBdiff 							type:#texturemap ui:MBdiff
			)
		--Place no#2
		rollout params "Decal Parameters"
			(
				mapbutton 	MBdiff 						pos:[16,16] width:212
			)
	)

The problem seems to be that you cannot use execute or the rolloutcreator at either location described above.

Here is some examples of some things I have tried:

Place no#1


str = "(
parameters main rollout:params
(
MBdiff 							type:#texturemap ui:MBdiff
)
rollout params \"Decal Parameters\"
(
mapbutton 	MBdiff
)
)"
execute str

Place no#2


paramsRCI = rolloutCreator "params" "Decal Parameters"
paramsrci.begin()
paramsRCI.addControl #button #BtnSourceFolder "Show Maps Folder: " paramStr:"align:#left"
paramsRCI.end()

&


str = "rollout params \"Decal Parameters\" (
edittext MapFolderLocation)"
(execute str)

I figure this could just be an issue of scope but I doubt it. I’m guessing that if there is a work around it will be something that isn’t apparent.

Can you put the script up in one hit as I would like to run it and see what errors I get. It may be a compile issue, but if I can help you out, I will.

Look forward to seeing it soon

MJ

I used to do this by first just pre-generating the “material script” into a StringStream and then add it up to the material editor as a rollout. You can use one of the few cool MaxScript tricks like “upgrade” so that all existing properties still remain the same etc when you recompile the “material script”.

SamiV.