PDA

View Full Version : conencting two mesh two single axis of slider one -ve axis and other+ve axis in scrip


akesh.kulmi
02-03-2006, 04:20 AM
hi all
iam in great problem
iam trying to make wiring two targets to - and + of sane

axis with same expression .....

iam taking input from UI for slider range - slmax and SlMin
and for morph target range- Max1 and min1 also taking from

UI
the expression is


substr1+=("paramWire.connect2way $"+name_target1+ attrib2+

"$"+name_slider+ attrib1+"]" + " \"if "+axis1+ ">= "

+(slMax1/2)as string + " then "+(Max1)as string+ " else if

"+axis1+ "<= " +(slMin1/2)as string+ " then " +(Min1)as

string+ " else if "+axis1+" < "+(slMax1/2)as string+" or

"+axis1+ ">=0 then "+axis1+ "* "+(Max1/m)as string+ " else

if "+axis1+ "< 0 or "+axis1+ "> " +(slMin1/2)as string+ "

then "+axis1+ "* " +((Min1/m)as string)+" \"" +"

\""+namstr1+ "*"+(m/(Max1 as float)) as string+" \"");



iam taking the ctrl name --name_slider and

targetname--name_target1 from UI
doing two way wiring to it



1.the problem is when i give first connection and range it

works fine like 0 100 for first target
but when wire 2nd target with same slider same axis giving

-100 t0 0 it popout error like need fn got 1.0 and in

expression
instead ofputting value of (Max1/m)as string it puts 1.#INF

and iam not able to connect both

2.and if iam giving first connection slmin and max as -100

100 and second inbetween this like -50 10 then it works but

for first target it works fine but for second as axis

reaches -49 it gets its max effect not in incresing from -50

to 10 at 10 it should be max but now on -49 it is..
3.this second problem also occur in case we are giving both

range +ve like for first target 0 100 and second 0 50
4. same first problem occour when +ve values like first

target 0 50 and second 50 100..
iam also
------------------------------------------------------------

-------------

the variables are like this taken from UI
name_target1 - name of target morph like target (ex.smile_l)
name_slider -name of ctrl
attrib1--contain axis like

X_position, y_position
attrib2 -- contain

.modifiers[#morpher]+lastselection[1]
slMin1 -- slider minimum value taken

from UI
slMax1 -- slider max value
Min1 -- target min value
Max1 - max range of target
m - sliderMax1 /2 ==>> get computed

in sliderMax
namstr1 --contain name and index of

morph target taken from multilistbox
lastSelection--contain index of

lastselected item target from multilistbox

num_n1 == index of selected item

from dropdown list for slider like x_postion =2 Y_postion=3

num_n2==index of selected item from

dropdown list for target like in list morpher=8


-- this fn iam firing for making connection



fn makeStr name_target1 name_slider slMin1 slMax1 Min1 Max1

m namstr1 lastSelection num_n2 num_n1 msgBox =
(


attrib2=(".modifiers[#Morpher]["+lastSelection[1]as

string+"]")
if num_n1==2 or num_n1==3 or num_n1==4 then
attrit1=".pos.controller[#"
if num_n1==2 then
(
axis1="X_Position"
)
else if num_n1==3 then
(
axis1="Y_Position"
)
else
axis1="Z_Position"
)
attrib1=".pos.controller[#" +axis1

substr1=""



if num_n1==2 or num_n1==3 or num_n1==4 and

num_n2==8 then -- CASE >> the sec obj > tx
(

substr1+=("paramWire.connect2way $"+name_target1+ attrib2+ "$"+name_slider+ ttrib1+"]" + " \"if "+axis1+ ">= " +(slMax1/2) as string + " then "+(Max1)as string+ " else if "+axis1+ <= " +(slMin1/2)as string+ " then " +(Min1)as string+ " else if "+axis1+" < "+(slMax1/2)as string+" or "+axis1+ ">=0 then "+axis1+ "* "+(Max1/m)as string+ " else if "+axis1+ "< 0 or "+axis1+ "> " +(slMin1/2)as string+ " then "+axis1+ "* " +((Min1/m)as string)+" \"" +" \""+namstr1+ "*"+(m/(Max1 as float)) as string+" \"");

)
msgBox.text= substr1;
print substr1
)
)

please give me response soon
akesh

CGTalk Moderation
02-03-2006, 04:20 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.