ScriptSpot

Forum topic · General Scripting

Add Interations NURMS Subdivision with button

By Michele71 · 2011-03-02

Description

Hi all boys :)

How create more or less iterations Nurms with button?

I want to create two button on my toolbar that allows me to increase or decrease
the interations NURMS Subdivision in editpoly.

Now, with spinner I don't have problem... example:


on sp1 changed val do obj.iterations = sp1.value --- max 10 interations

but with the button as I do?

I try but I can't understand...

Example of rollout (just to better understand)


rollout test "More or Less" width:104 height:88
(
	groupBox grp1 "" pos:[8,0] width:88 height:80
	checkbox chk1 "On/Off" pos:[16,16] width:56 height:16 
	button btn1 "<" pos:[16,48] width:32 height:24
	button btn2 ">" pos:[56,48] width:32 height:24
)

Createdialog test

Thanks in advance
Michele

Comments (2)

Michele71 · 2011-03-03

Ciao Garp! :)

Thanks for your reply! It worked great ;)

I tried with this solution "obj.iterations += 1" but it gave me an error...mah!

I do not know why...

Thanks again Garp

Ciao
Michele

Hi Michele :)

Garp · 2011-03-03

With obj as an Editable Poly.

on btn1 pressed do obj.iterations += 1
on btn2 pressed do obj.iterations -= 1

for display and

on btn1 pressed do obj.renderIterations += 1
on btn2 pressed do obj.renderIterations -= 1

for render.