Home Technical Talk

very Basic rigging question

Wintersun
polycounter lvl 12
Offline / Send Message
Wintersun polycounter lvl 12
Sorry if it is too noobish. But here is the problem, as you see in the picture below I wanna animate the left shape (zig zag planes) to the right one. It's like windows shutters ( or w/e it's called ) that close from bottom to top. I know very little about IK rigging and the real problem here is they have to close one by one sequentially from bottom to top so it becomes the right shape. I know I can do that manually one by one with FK but some of the geometries are like 100 zigzags and animating them one by one would be a lot of Pain in the butt. Any help or suggestion or even a video tutorial would be much appreciated. thank you very much.

Replies

  • Wintersun
    Options
    Offline / Send Message
    Wintersun polycounter lvl 12
  • Mr.Mint
    Options
    Offline / Send Message
    With such a very repetitive task...scripting pops into my mind...
  • aleksdigital
  • JohnnyRaptor
    Options
    Offline / Send Message
    JohnnyRaptor polycounter lvl 15
    is this what your looking for?

    [ame="http://www.youtube.com/watch?v=D87isBR-Cuw"]Accordion Rig Quick Demo - YouTube[/ame]

    If so, iv uploaded the maya file,

    https://dl.dropboxusercontent.com/u/2516103/accordion.mb

    Basically what iv done is write a simple expression to drive the bones based on the last ikHandle.

    You need to apply 1 / number of ikhandles in your chain to the translate (in this case y) of each ik handle and incrementally increase it down the chain.

    you can apply the same expression to the other axes and it should work(the maya file has this on all axes)
  • Wintersun
    Options
    Offline / Send Message
    Wintersun polycounter lvl 12
    @JohnnyRaptor dude this is amazing, exactly what I want. the only problem is its in maya and I'm using max . tbh yours actually has some other things I had in mind that I couldn't explain in words but lemme ask it for sure. imagine the zig zags were like 100, If I start to pull it up just a bit does it affect the very top ones? or it's gonna crunch them all relatively? cause its not really noticeable in this video cause of the really short length of the spring (zig zag, accordion or w/e ). anyways you've been helpful enough already. thank you
  • JohnnyRaptor
    Options
    Offline / Send Message
    JohnnyRaptor polycounter lvl 15
    np dude! shame your not on maya! :)

    the top ones will move as well, obviously that is relative to how much you move. if you move the last handle 1 unit, the top bone will move 1/100th of 1 unit so this is near irrelevant. But as this unit is increased, the amount the top one moves will increase and eventually they will all end up as in your before/after screen in your original post.

    hope this helps!
  • Snader
    Options
    Offline / Send Message
    Snader polycounter lvl 15
    You'll want to have a fiddle around with the IK solver in max and just press a bunch of buttons...

    I managed to get you the inverse of what you need: the top folds first and then the lower ones fold. I'm not really a rigger/animator so I'm not much more help, I'm afraid. Maybe this is enough to get you looking in the right places?

    IK-luxaflexattempt.gif
    https://dl.dropboxusercontent.com/u/448525/keep/Polycount/IK-luxaflexattempt.max
    (file is max 2011 or higher)
  • Wintersun
    Options
    Offline / Send Message
    Wintersun polycounter lvl 12
    Gotta say thank you to both of you but yet I need help.
    I even read some of the syntaxes of maxscript, still I couldn't manage to do this. I couldn't even go through my bones (bones001, bones002 , ...) with a loop that had bone"i" in it's do()! what was with that!

    @Snader I downloaded the file but it didn't have any IK handle , and when I applied an IK solver to it, it went crazy like what I encountered the first time I tried rigging it, nothing like the gif you put here but anyways I really appreciate that

    I am still desperate in need of help.

    btw I found this http://www.mgrote.com/tutorials/mirror.php one, it may be helpful to some ppl who are searching for it, but it didn't help me.
  • monster
    Options
    Offline / Send Message
    monster polycounter
    The title is simple rigging question, but unfortunately there is no easy way to do it without intermediate/advanced rigging skills.

    There might be easier ways to do it, but I did it this way because it can be scripted quickly. It uses an IK chain per segment, then you use a script controller on each ik object.

    https://dl.dropboxusercontent.com/u/2904948/Tutorials/SliderZ.max


    This was the script I use to set it up. Parent each IK object to the one above it, then select them from top to bottom.
    (
    	--CREATE A SCRIPT STRING
    	posScript =  "z = -1*(distance a.pos b.pos)\n"
    	posScript +=  "if z < dist*n then dist else z/n"
    
    	--LOOP THROUGH THE SELECTION
    	for i = 1 to selection.count do
    	(
    		--CREATE A FLOAT SCRIPT
    		posCon = float_Script()
    		selection[i].position.controller.z_position.controller = posCon
    		
    		--CREATE THE PARAMS
    		posCon.script = posScript
    		posCon.addNode "a" $Top
    		posCon.addNode "b" $Bottom
    		posCon.addConstant "dist" -20
    		posCon.addConstant "total" selection.count
    		posCon.addConstant "n" i
    		
    		--SET THE SWIVEL TARGET FOR THE IK OBJECTS
    		selection[i].transform.controller.VHTarget = $Aim
    		
    	)
    )
    
  • monster
    Options
    Offline / Send Message
    monster polycounter
    Here is another file. This one works better, but takes longer to setup. It uses a Reaction controller with the master set as the bottom circle.

    Reaction controllers are like Set Driven Keys in Maya. Or basically, they monitor other object's position or rotation states and keep a predetermined animation curve based on those states.

    You can probably find some tutorials on Reaction controllers, there is some good info in the Max help file.

    https://dl.dropboxusercontent.com/u/2904948/Tutorials/SliderReactionZ.max
  • Wintersun
    Options
    Offline / Send Message
    Wintersun polycounter lvl 12
    @Monster You are my saviour man, after 3 days of complete frustration. I did it with reaction manager, it took time but now I'm really satisfied , I'm gonna put the end result here whenever it finished.
    For any1 who google got here, do it with reaction manager, it may take time but It definitely will worth.
Sign In or Register to comment.