ZBrushCentral

Evolving/Scanning Texture Transparency

Hello again, I am attempting to create a series of textures resulting from black plane3d sweep. But I keep running into syntax errors. I’m still fairly new at coding can someone help me?


[VarDef,utilDllPath,"ZSTARTUP_ZPLUGS/ZFileUtils.dll"]

[VarDef,name,"pass"]
[VarDef,hset,0]
[VarDef,hbeg,0]
[VarDef,err.""]
[VarDef,c,[IGet, Document:Width]*17/24]
[VarDef,a,[IGet, Document:Width]/5]
[VarDef,b,[IGet, Document:Width]]
[VarDef,wang,cos(a/c)]		


	[RoutineDef,stasis,
		[VarSet,hset,b/25*f]
		[VarSet,hbeg,b+b/25*f]
		[CanvasClick, hset,[IGet, Document:Height]/2,hbeg,[IGet, Document:Height]]
		[IPress,Texture:GrabDoc]
		[VarSet, err, [FileExecute, [Var,utilDLLPath], "RenameTexture", #name]]
		f,name,hset,hbeg,err,utilDLLPath,b
		]
			
	[RoutineDef,evolve,
		[VarSet,hyp,cos((a/5*f-20)/c)]
		[VarSet,pyh,cos((a/5*26-f)/c)]
		[ISet,Tool:Deformation:Rotate,hyp]
		[CanvasClick, hset,[IGet, Document:Height]/2,hbeg,[IGet, Document:Height]]
		[ISet,Tool:Deformation:Rotate,-hyp]
		[ISet,Tool:Deformation:Rotate,pyh]
		[CanvasClick,[IGet, Document:Width]- hset,[IGet, Document:Height]/2,[IGet, Document:Width]-hbeg,[IGet, Document:Height]]
		[ISet,Tool:Deformation:Rotate,pyh]
		[IPress,Texture:GrabDoc]
		[VarSet, err, [FileExecute, [Var,utilDLLPath], RenameTexture, name]]
		,f,name,hset,hbeg,hyp,pyh
		]


[IButton,Zplugin:Array:Scan,Scan,

		[IPress,Tool:Plane3d]
		[ISet,,Tool:Deformation:Rotate,wang]
		[Loop,25,
		[If,f<=20,
			[VarSet,name,[StrMerge,"pass",f]]
			[RoutineCall,stasis,f,name,hset,hbeg,err,utilDLLPath]
			,
			[VarSet,name,[StrMerge,"pass",f]]
			[RoutineCall,evolve,f,name,hset,hbeg,hyp,pyh]
		]
		,f]

,,,,"D:\Documents and Settings\Owner\My Documents\Zbrush\scripts\Button\scan.bmp"]

The main problem I think is that you are passing global variables to your routines. That’s not necessary, providing the global variables are declared beforehand. The Loop iteration variable can throw up problems so in that case you can use a local variable in the routine and pass in the value of the loop iteration. Note the use of [Val,f] in the StrMerge.

For the ZFileUtils you need to put the dll in a data folder special to your plugin and then test for the file with [FileExists before any calls. The reason for this is that some users may have older versions of the dll that don’t support the function you’re calling and checking the dll is actually there is a useful safeguard. You can use the same data folder for your button image, using a local path in the button code: “PluginDataFolder\Button.psd”.

When creating a plugin you need to create the plugin subfolder using the ISubPalette command.

Apart from that there are a few typos, such as the period instead of a comma when you declare the Err variable. :slight_smile:

HTH,

You cannot control the weather, but you can change your mood.

wholesale costume fashion jewelry
chinese jewelry on sale
pearl collar wedding necklace
cheap gemstone beads
cheat codes for pokemon diamond