PDA

View Full Version : material plugin button


Galleon
12-23-2010, 07:09 AM
Hi,everyone

I would like to place a button in material plugin,
and change the button text when pressed it.

The problem is that while i leave the rollout ,The text will
turn back againt.

It's necessary defines a set of parameters?
Any ideas, how to fix this?

Thanks a lot

code:
--------------------------------------------------
plugin material Test
name:"Test"
classID:#(695425,446581)
extends:Standard
replaceUI:true
(
parameters main rollout:params
(
)
rollout params "Test Parameters"
(
button theButton "Old name"
on theButton pressed do theButton.text="New name"
)
on create do
(
)
)
------------------------------------------------

lo
12-23-2010, 08:18 AM
A rollout is recreated everytime you select the material or reopen the material editor window. You need to keep a parameter that remembers the button state and check it on the 'on open' handler and change the text accordingly.

Galleon
12-23-2010, 11:14 AM
it works!!

thanks Rotem

CGTalk Moderation
12-23-2010, 11:14 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.