Feature Request: Linear Constraint

The interface, modeling, 3d editing tools, import/export, feature requests, etc

Moderators: jesterKing, stiv

Post Reply
Posts: 0
Joined: Fri Feb 25, 2005 10:29 am

Feature Request: Linear Constraint

Post by lobo_nz » Sat Dec 03, 2005 7:44 pm

I would like to see some more constraints for animating mechanical objects more easily or modifications to existing ones to achieve the same.

The two that seem missing are:
Linear constraint
Planar constraint

Recently I had a job to animate a Folding Door with 3 stages that would foldback against the wall, I really wanted to animate the 1st door and have the 2nd door follow a track, the 3rd door was simply hinged so was easy.

I tried Armatures with IK and FK but the trouble was that the hinge point crossed the linear track which confused IK and the track was not vertical or horizontal so some of the constraints that may have made it possible like the "copy location" wouldn't work as they work on global coordinates not local.
I also asked on irc incase it was my lack of knowledge of blenders constraints that was preventing me finding a solution, I had 2 people try to find a solution both saying it cant be done, I am open to suggestions if this is wrong.

The "Copy Location" constraint could achieve both a Linear constraint and a Planar constraint if it would work using the local coordinates of the object being used as the constraint.

The "Follow Path" also seems like a constraint that would be easy to modify to achieve a linear constraint (and a path constraint), while it already achives a path constraint it seems to be time based only and not something that can be used to constrain The end of one Bone in a chain who's position is based on animation of another Bone.

Here is an image describing the Problem:

As I needed this done asap for the project I was working on I wrote a script that achieved what I needed, it is far from useable in every situation as it was aimed a solving a specific problem but I'm sure will help in explaining the problem I had.
Download the blend from here:

http://blender.formworks.co.nz/linear_c ... aint.blend

I hope that this gives the people who program the constraints an insight into the problem I ran into.

Posts: 0
Joined: Wed Mar 17, 2004 5:20 pm

Post by an-toni » Sun Dec 18, 2005 8:25 pm

cool script!

Bassam here is telling that he solved a similar issue in a 3d world article, and i guess adding such constraints would be nice .. we dont know the constraint system code really, but hopefully is not too hard.


Posts: 98
Joined: Fri Oct 18, 2002 2:47 pm
Location: Pennsylvania, USA

Post by harkyman » Mon Dec 19, 2005 1:45 am

Hey Toni - constraints system code is actually very easy. There's a step-by-step tutorial somewhere (http://www.blender3d.org/cms/Adding_A_C ... 311.0.html) in the .org CMS for writing a new constraint. It's mostly just C&P from other constraints and putting things in the right place. Using the tute and writing a constraint was my first step into the sources. I'm guessing it would take you less than two hours.

Posts: 0
Joined: Fri Feb 25, 2005 10:29 am

Post by lobo_nz » Mon Dec 19, 2005 1:55 am

Its good that its so easy, hopefully someone will have the time to add them in, I dont know C, but I guess if it dosn't get added I will eventually look into it - I've always wanted to compile blender :)

Posts: 0
Joined: Sun Jul 18, 2004 5:49 am

Post by GreyBeard » Mon Dec 19, 2005 3:40 am

Here is a wheel and piston blend that uses a driven ipo -- It might help you.



Posts: 0
Joined: Fri Feb 25, 2005 10:29 am

Post by lobo_nz » Mon Dec 19, 2005 4:02 am

Thanks GreyBeard, what I was after was the ability to make the free end of the arm follow a line (Like the red x axis in your blend) rather than be targeted to something.

BTW thanks for your LSCM video tutorial it was great!

Post Reply