Multiple Attributes to Single Parameter

Multiple Attributes to Single Parameter

Anonymous
Not applicable
1,354 Views
4 Replies
Message 1 of 5

Multiple Attributes to Single Parameter

Anonymous
Not applicable

Hello. I am working on a homework assignment which is primarily about modifiers. I have a hookshot which is fired at one point, and right now the "rope" is just a cylinder. My rig contains an attribute "Fire Distance" which is wired to adjust the height of the cylinder. However, I want to have another control which adds slack to the rope using the bend modifier. My intent was to have a seperate "Slack" attribute which is wired to the rope's rotation, bend angle AND the height of the cylinder so that the rope terminates at the same point. In order to do this I need to use both the Fire Distance and Slack attributes together (something like height = FireDistance + Slack, I haven't worked out the exact math yet). I feel like this should be possible, but I have not been able to find any way to do it.

 

I would appreciate any advice, or an alternative solution (bearing in mind that this is should all be doable with simple rigs and modifiers). Thanks!

0 Likes
Accepted solutions (1)
1,355 Views
4 Replies
Replies (4)
Message 2 of 5

leeminardi
Mentor
Mentor
Accepted solution

I have limited experience with this but I was able to control the height of a cylinder by manipulating two attributes (Bend and Twist). I used an expression controller to set the x position of a point based on the x position of two other points each off which has its x position controlled by the bend or twirst modifier angle.  The height of the cylinder is then wired to the x position of the "sum" point.

 

Here's the process.

 

Create 3 point helpers. Call them p1, p2, and psum.

 

Create an Expression Controller for psum where its x position is the sum of the x positions of p1, and p2.

 

Create a Box that has the following modifiers: Attribute Holder, Bend, and Twist.  The custom attributes control the Bend and Twist of the Box 

 

Create a cylinder.

 

Create a Wire Parameter from the Bend angle of the Box to the X position of p1.

 

Create a Wire Parameter from the Twist angle of the Box to the X position of p2.

 

Create a Wire Parameter from the x position of psum to the Height parameter of the cylinder.

 

The attached file shows the result.

 

If you need to adjust the weight and scale of the two parameters that affect the height value just add a multiplier to the psum x position expression controller.

 

~Lee

 

multiple-attributes.JPG

lee.minardi
0 Likes
Message 3 of 5

Anonymous
Not applicable

Interesting. That's a quite a convoluted solution, but it definitely works. I resolved my current problem with a wave modifier (not ideal, but it worked with some heavy hand-adjustment), but I'm going to try your solution because I don't think that this is going to be the last time I want to do this. Thanks!

0 Likes
Message 4 of 5

leeminardi
Mentor
Mentor

I faced two challenges, adding the modifier values from two different modifiers and then using that sum to control an object parameter. I solved the first with an expression controller and the second with a wire parameter.

 

What seems crazy to me is that after I got it working I can delete the 3 points and it still works!  The expression controller is referencing objects that no longer exist.

 

 

lee.minardi
0 Likes
Message 5 of 5

Anonymous
Not applicable

I just did some poking around to see if there is an alternative explanation for it to continue working. I did not find one. The programmer in me finds that deeply unsettling.

0 Likes