[Closed] Linking A Custom Attribute to Another Custom Attribute
Hi guys, long time reader first time poster. I have a pair of eyes with a modeled pupil, iris etc. Now I wanted to control the size of the pupil with a linked xform parented to a point helper, but this didn’t work out. I then decided to use an xform modifier on the faces that built up the pupil and control the gizmo’s scale with a wired parameter…needless to say I spent several hours trying to figure out a way of manipulating the gizmo’s scale…it didn’t work so after searching through the modifiers I thought it would be easier to use the Squeeze modifier and control the squeeze amount with a parameter wired to the point helpers custom attribute.
I’ve done this for both eyes pupils (left eye/squeeze amount ->Ctrl_Both_Eyes/Left_Pupil and right eye/squeeze amount ->Ctrl_Both_Eyes/Right_Pupil) But I want to be able to control both pupils at the same time aswell, so I added another custom attribute to the Ctrl_Both_Eyes helper but can’t figure out how to connect both Left_Pupil and Right_Pupil to Both_Pupils without voiding their previous wirings.
For instance after I wired each eyes pupils, I wired both_Pupils to Left_Pupil and then repeated the process and wired it to Right_Pupil. Now when the slider for both_Pupils is moved…then both pupils contract and expand…but if Left_Pupils or Right_Pupils sliders are manipulated nothing happens as they have been overwritten by the previous wirings…hope that makes sense
So bottom line is. How do you wire one custom attribute to control another but still have it’s dependancy. like a parent-child setup with two bones. you can move the child seperatly but if you move the parent then both move. I’d like one controller to be able to be controlled by the other but still be independant.
Just posting because I’ve left this thread for a while and no-one has replied. Does anyone have a clue how to solve my problem? It’s cropped up again as I have created a a distal, middle, primal and curl attribute on a dummy which controls a finger. now the distal, primary and middle fingers work fine, but I want to link the curl attribute to control the rotations of the distal, middle, and primary joints altogether without using the parameter collector.
It may seem trivial…but I like to have all my controls on the dummy helper as it just save time in the short and long run and is neater. Does anyone know how to solve this…or at least write some sort of script where I can control an attribute with another attribute on the same helper?
Just a quick post before I leave…
Generally I have found that a little bit of max scripting goes a long way and is simpler to use than the wire parameters dialog. Have a look at the Max reference and Max script reference on ‘script controllers’. (Although I have to say that this might be the one area where the max help isn’t that good.)
The script controller is a fantastically powerful tool once you get to grips with it so I recommend learning it.
If you want I try and post an example tomorrow morning (Im in the UK)
good luck
Unfortunately, this can’t be done through the custom attributes editor.
Here’s an example which creates a new custom attribute using maxscript. It has two spinners “Left” and “Right” and a checkbox to link the spinners. The CA is applied to the selected object (see bottom of script).
Cheers,
Martijn
cant you for each ca eg left pupil/right pupil make it a bezier float then add a float list controller on it. Wire it in the first slot then in the available add say a bezier float set that to active.
Its like constraining a point to another point with a pos constraint, but in the available slot add a bezier float so you can still move it around, as well as its being contstrained. So why cant it be done with a ca slider?
Also the way i do iris changes is by wireing the uv coardinates of the iris material to a slider. So essentially it stretches by creating more black.
eek
Hi, sorry I stopped monitoring this post because no one replied, I just so happened to come across it again and noticed there were some responses.
thanks for them by the by. I did look through the max script tutorials and references…but they are rubbish. Unfortunately for someone like me who isn’t used to Max’s syntax of programming, there really needs to be more info and examples on each function you know?
I do however think you are right in saying that doing this with a wired parameter custom attribute is not the way to go about it. I’ve finally realised that WP’s are just a really bad way to do anything…I mean for something that reset’s itself when the syntax is wrong causing you to update every second to save your hard earned typing is just bad programming.
I still personally haven’t found out a way of doing this, but I’d imagine that if someone did it would be a very useful tool for rigging. I asked my tutor at uni and he seemed as dumbfounded as me, he said it would have to be done with some form of script…which I have no problem with, I just wouldn’t know where to start.
The eyeballs are animated using two slider manipulators.
one for dilation and one for balance.
To look at the script contoller open the dope sheet, navigate to an eye, then
-modified object-morpher-[1]line02- and right click to get the tracks properties.
the ‘DependsOn’ tells the script controller what objects in the scene to use.
The value of the final equation is passed to the morph target controller.
So bottom line is. How do you wire one custom attribute to control another but still have it’s dependancy. like a parent-child setup with two bones. you can move the child seperatly but if you move the parent then both move. I’d like one controller to be able to be controlled by the other but still be independant.
Id look at list_controllers.
Ken T,
Theres some oddness going on with the balance slider, when going from left to right. The eyes dilate weirdly.
You have one slider driving the size of the dillation right? This dillation being a morph target. And im guessing you have each eye treat this eye as a morph, like the value of a morph driving a morph?
So:
eye 1 is a morpher with a target: dillated
eye 2,3 use eye 1 as a morph with update always on. Then you just drive these two morphs with a simple slider. controller.weight[1] = slider1 etc etc
eek
Yes the sliders do behave a bit weirdly. It was ment help to get Nefertari started with script controllers…
I just realised that because i use dual montiors you guys might not of been able to find the script controller code (because it would of appeared off screen). I’ll upload a new version of the file to fix this…
The script controller for the left eye looks like this:
dependsOn $SliderDilate $sliderbalance
Dilate = $SliderDilate.value
Balance = $sliderbalance.value
(1-Dilate) 100(1-abs(balance)) + ((1-Balance) * 50)*(abs(balance))
The script controller for the Right eye looks like this:
dependsOn $SliderDilate $sliderbalance
Dilate = $SliderDilate.value
Balance = $sliderbalance.value
(1-Dilate) 100(1-abs(balance)) + ((1+Balance) * 50)*(abs(balance))
There is no value of a morph driving a morph. Each eye calculates the value of its morph channel directly from the code above. (you could delete the morph target line02 and it would all still work).
You could do all this with list controllers … But some rigging problems can only be solved with script controllers so it worth learning them if you have the time…
Having said that I guess i should of spent more time writing a nicer example function.
I ‘ll see what i can do tonight to make it smoother.