I am trying to make a plugin that toggles between texture off and a texture i load as a reference on the objet i am working on(with flat shader). I managed to make it work as a script, but when i try to make it a plug-in it doesn't work anymore. I need it as a plugin because i want to put a shortcut on it.
Here is the code if anybody has some time...
[CODE] [ISubPalette,Zplugin:ToggleTexture]
//---------- Set the texture to use as a reference
[IButton,"Zplugin:ToggleTexture:Set Ref","Set reference texture",
[IConfig,2.0]
//[ISetHotkey,Zplugin:MorePlugs:Toggle Texture ,'1']
[VarDef,caleTextura,""]
[VarDef,numeTextura,""]
[VarSet, caleTextura,
[FileNameAsk,.psd,]
]
[FileNameSetNext,caleTextura]
[IPress,Texture:Import]
[MemCreate ,ctSetReferenceText ,64]
[If, [MemGetSize, ctSetReferenceText] != 64, // if memory block is not 64 bytes in size then report it.
[Note, "Memory block not created"]
]
[VarSet,numeTextura,
[FileNameExtract, caleTextura, 2]
]
[MemWriteString ,ctSetReferenceText ,numeTextura ,0 ]
//[NoteBar, numeTextura,]
[IShowActions,0]
,,76,]
//---------- Switch between texture off and the reference texture(with flat shader)
[ISwitch,"Zplugin:ToggleTexture:ToggleTexture",,
"Toggle Texture",
[IConfig,2.0]
[VarDef,numeTextura,""]
[MemReadString ,ctSetReferenceText ,numeTextura ,0]
[IPress,Texture:Txtr00]
[IPress,
[StrMerge,"Texture:",numeTextura]
]
[IPress,Material:FastShader]
[IPress,Material:Flat Color]
,
[IConfig,2.0]
[VarDef,numeTextura,""]
[MemReadString ,ctSetReferenceText ,numeTextura ,0]
[IPress,Material:Flat Color]
[IPress,Material:FastShader]
[IPress,
[StrMerge,"Texture:",numeTextura]
]
[IPress,Texture:Txtr00]
,,75
]
[/CODE]
Claudiu