Floor Constraint: Patch and Windows Build

User-contributed CVS development builds. Please test and give feedback!

Moderators: jesterKing, stiv

Post Reply
harkyman
Posts: 98
Joined: Fri Oct 18, 2002 2:47 pm
Location: Pennsylvania, USA
Contact:

Floor Constraint: Patch and Windows Build

Post by harkyman » Fri Sep 02, 2005 4:34 pm

Made a new constraint yesterday, called "Floor".

The way it works:

1. Apply constraint to object (or bone).
2. Choose target.
3. Choose: X,Y,Z,-X,-Y,-Z. Default is Z.

Z will not allow the constrained object to pass below the target object.
-Z will not allow it to go above the target.
X,-X,Y and -Y will do the respective actions on the global X and Y axes.

Useful for placing a "floor" or "walls" for objects and armatures. Apply to armature foot bones to prevent them from slipping below the floor.

Patch against current CVS here:

http://www.harkyman.com/floorpatch.txt

Windows binary (.exe only) here (3.4 MB - if you can patch, please do that instead):

http://www.harkyman.com/blenderfloor.zip

Feedbacks are appreciated.

Also, I don't have commit privleges, so anyone (theeth!) who wants to check the code and possibly commit, please feel free. I've seen this feature asked for a dozen times in the last year.


lucky3
Posts: 12
Joined: Thu Oct 17, 2002 6:08 pm

Post by lucky3 » Fri Sep 02, 2005 5:36 pm

Don't know if it's a bug or not, but i'm gonna try to explain what happens:
My constrained object is on the target, and then i move down my object along -Z axis.
I want the object to move above the target, so i move it along Z axis but i have to move it a long time until it gets the previous coordinates, because object's coordinates haven't been reset or 'stopped' below the target.

Hum i don't know if that's clear
:?

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

Post by harkyman » Fri Sep 02, 2005 5:42 pm

I think that's just the way constraints work. The actual coords (what you'd get if you set an IPO key) of your object stay live as you translate, but they are constrained on-the-fly before display, render and other calculations. As far as I know, this is the first constraint whose functionallity has made this obvious.

Just got some feedback from the mailing list that bones aren't working as expected, though they seemed to when I tried to it.

kidb, thanks for the Linux builds.

lightning
Posts: 0
Joined: Sat May 17, 2003 9:06 pm

Post by lightning » Fri Sep 02, 2005 6:57 pm

I havent tried it, but would it be possible to set a certain 'distance', so for example if the foot is quite big, then it does not continue to pass through the floor until the bone touches the floor, but instead the bone stops a set distance above?

thanks
lightning
The dawn of a new error...

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

Post by harkyman » Fri Sep 02, 2005 7:59 pm

That's a cool and useful idea. You can get around it with workarounds and careful planning, but it would be easier to do it right in the constraint. I've added that and am trying to compile right now.

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

Post by harkyman » Fri Sep 02, 2005 9:00 pm

Works great. Cool idea. I'll clean up the GUI and make a new patch over the long U.S. weekend.

SamAdam
Posts: 0
Joined: Thu Mar 04, 2004 1:28 pm
Contact:

Post by SamAdam » Fri Sep 02, 2005 10:33 pm

how about a geometry constraint? would it be hard to continue this to that?

just make the object follow the geometry mesh, like having the floor mesh with an up and down constraint together.

blendman
Posts: 0
Joined: Wed Oct 20, 2004 12:53 pm

Post by blendman » Sat Sep 03, 2005 12:34 pm

Hello Harkyman

GREAT feature !
I have tested and I find it really good! this work pretty well.
thank you very much.
really useful for animation !
just an idea : it seems this is the center of the constrainted object wich can't pass under the floor (the target). (I knwo that the constraint work like this)
but could be it the mesh (the face or vertices) not only the center object? and for armature too (not only the center, but the bones too)?
I don't know if it's possible or difficult to code, just an idea ;) but perhap's it 's the same feature like lightning or SamAdam. (i don't know)

thanks aigain.
sorry for my bad english;)
Blendman

MyIS
Posts: 0
Joined: Fri Sep 02, 2005 11:13 am

Post by MyIS » Sun Sep 04, 2005 4:43 am

I think if you need mesh collision testing, something much more complicated is necessary, such as using ODE/SOLID collision libs, etc etc. So, while it definitely sounds like a good thing to add, it should be a separate project/effort. This one's a nice and simple constraint.

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

Post by harkyman » Tue Sep 06, 2005 6:35 pm

One more feature added and now I'm through with it.

In addition to the "offset" feature suggested above, which is very cool, I've also added a "sticky" button in the constraint. When "sticky" is active, your constrained object freezes against the target object for as long as it's constrained, as opposed to skating around on it like it does now.

patch against CVS:
http://www.harkyman.com/floorpatchstick.txt

Windows .exe:
http://www.harkyman.com/blenderfloor.zip

CJD
Posts: 0
Joined: Tue Jan 11, 2005 8:26 pm

Post by CJD » Wed Sep 07, 2005 8:26 pm

GOOD IDEA, but...

don't work 2 constrains floor at same time

the center object isn't good "contact point"

it's a great idea for emptys, or bones constrain.

other thing, only work on plane? "real time mesh surfaces" is better, irregular surfaces (for example an irregular floor, stairs, dunes, etc)

and a "on the floor" option, for the objects are exactly on the floor, not above, not below. (only an idea)

great work, go to coding!

and sorry my ugly english... :oops:

Post Reply