Notifications
Clear all

[Closed] Spinner value changed with joystick not working

Say I have a parameter attached to a spinner in a CA.I wire it up to , say,a bone rotation. Then I want to create a joystick control to alter that spinner value, which in turn makes the bone rotate. Sounds straightforward but it doesn’t work. The spinner, when changed manually, affects the bone rotation but although the joystick changes the parameter value, no rotation occurs. Not entirely sure why.

2 Replies
 PEN

Would have to see what you are doing to connect all this and what the joystick is. Is this a floating spline in the viewport or a dotNet joystick type control?

Paul – thnx for response. If you open the attached file, you see three objects – circle spline with cas on it, a bone and a free spline. Running this line:


paramWire.connect $Circle001.modifiers[#Attribute_Holder].Eyelid[#UprLid] $Bone001.rotation.controller[#Z_Rotation] "degtorad UprLid"
 

yields a connection between the parameter uprlid and the bone…now running this:


 
fn   connectParamcontrC  caname  paramName minV maxV index    controlspline	 = 
 
 
 
 
 
(   	ctrlobj = getnodebyname controlspline;
 
 
	ctrlobjcont = ctrlobj.pos.controller
 
 
  outerspline = ctrlobj.parent
 
 
 out = outerspline.width.controller;
 
 
$Circle001.modifiers[1].Eyelid.UprLid.controller = float_list ()
 
 
flsc = float_script ()	
 
 
$Circle001.modifiers[1].Eyelid.UprLid.controller[1].controller  = flsc
 
 
	local ctrlf = $Circle001.modifiers[1].Eyelid.UprLid.controller[1].controller
 
 
	ctrlf.addtarget outerspline.name  out;
 
 
	ctrlf.addtarget  ctrlobj.name ctrlobjcont;
 
 
	ctrlf.addconstant "minV" minV;
 
 
	ctrlf.addconstant "maxV" maxV;
 
 
str =   "X = "+ctrlobj.name+"[1]/"+outerspline.name+"*2;
 percent=(minV-maxV)*(X+1)/2 + maxV  "
 
 
	ctrlf.setexpression str
 
 
	)
 
 
 
 
 
	connectParamcontrC "eyelid" "UprLid" 0 100 2 "basehead_fr"
 

makes the bone the slave of the joystick controller but changing the ca attribute parameter manually no longer has an effect. What I want to do I to be able to retain the control via the param and also allow access via the joystick controller.

What I’m trying to do is make as many variables and parameters as possible controllable by the joystick, and I want the user to just be able to pick a parameter that is being used, say a mix amount in a material, or whatever, and make it controllable with the joystick. Scripting it directly is a headache…so I found the simplest way is just to place that parameter on a spline, then run a script like the one above.