BGE feature request : Parent Vertex to Object

Hello, fellow BGE users!

I’ve been wanting for years to ask for such a feature.

Feature:
Parent selected vertices to object. It’s the reverse of vertex parenting. By selecting vertices or a group of vertices, one could select an object and parent the first to the last.
Other options, like offset, keep vertices relative position, or affect object (so objects have a limited distance they can displace away from the vertex group), etc.

Usage:
Animation mostly. This could allow real-time easy modification of a mesh. Liquids simulation, cloth simulation, fast animation. Use of dynamics on static objects.

I believe with a lot of stitching it can be done in python, but would be cool if it was hard coded, thus faster.

What do yo guys think?

Isn’t that what armatures are doing?

It would be nice to be able to pin vertices to anything :smiley: not a unique armature in each instance

Isn’t that what armatures are doing?

Not that much. Objects have their own abilities. An object can only have one armature, armatures don’t have physical properties, are costly in terms of memory, harder to animate, etc.

It would be nice to be able to pin vertices to anything http://blenderartists.org/forum/images/smilies/sago/biggrin.gif not a unique armature in each instance

Right? Besides, armatures arent affected by the mesh…
check the example

An object can only have one armature

Why you need more then one? One should be enough (For a animated water you only need one armature and two bones)

armatures don’t have physical properties

The the armature has physical properties, if you set the armature to dynamic or rigged (sphere collier)
Or do you mean bones? You can use bone constraints to copy the position, rotation or scaling form an other object.

Sure if we can parent the vertices directly ton an object it would simplify some things. But for now you can use bones to deform your mesh.
In the official Blender 2.71 release is a bug (copy position, rotation or scaling not working) so use a actual build for the build bot.https://builder.blender.org/download/

vertex_to_obj_parenting 2.blend (96.4 KB)

I still do not see the difference.

This things are already done (see the various ragdoll implementations). The costs (efficiency) is a strange argument, because a separate implementaion will require the same costs.

I think it makes more sense to implement some of the bone constraints to support other relation to objects. I’m not up-to-date with that. It might already exist.

The ragdolls still rely on armatures! Add a hundred of those, and the BGE shockes.
If we could go by without armatures, ragdolls wouldn’t have any. The basic of ragdolls is a system of physical objects.

Armatures are to be much more expensive than empties, they have more properties, and sometimes you don’t really need one for a simple object. In my example I was trying to simulate a simple animated sponge like object. I added a soft object as the “parent” Add a field of those, with armatures, and the scene will certainly collapses, whereas you can add a few objects with vertices parented to them. imagine, flowing liquids, trees, doors, cloth, etc; now imagine lots of them. It’s simpler faster, cleaner.

For instance, in HG1’s example , one adds a bone + an object + constraint. The mesh is skinned to the bone. How many relationships are there?

The the armature has physical properties, if you set the armature to dynamic or rigged (sphere collier)
Or do you mean bones? You can use bone constraints to copy the position, rotation or scaling form an other object.

Well, the armature is not physical in the sense that you don’t have bone physical detection while animating(might be mistaken). Also you can’t parent a bone to an object, you need to script a copy rotation/position script. It’s very light, but how much scale can you give to it?

For instance, in HG1’s example , one adds a bone + an object + constraint. The mesh is skinned to the bone. How many relationships are there?

If you mean the the additional empty with “an object” it is only necessary to generate an offset to the physical object. This will also needed if you directly parent the vertices to an object.
The bone constraints only copy the rotation/position/scaling of the object to the bone. The bone constraints gives the user more options. The user can decide if he want to copy rotation/position/scaling or only one or two of them. You need to do the same for a direct vertex object parent.
For assigning multiple vertices to an object you need a list of vertices that is assigned to the object (mesh skinning). You need this also if you directly parent the vertices to an object.
Basically there is only the bone left comped to an direct vertex object parent. So this is the only additional relationship.

But you have right, armatures are much more expensive than empties. That is actual the only downside if you are using a bone to move vertices.

Well, the armature is not physical in the sense that you don’t have bone physical detection while animating(might be mistaken).

I don’t understand what you mean.

Also you can’t parent a bone to an object, you need to script a copy rotation/position script.

No. A script is not necessary. This can be done with the copy rotation/position bone constraint. As I have done it in my example.

this uses Ik and Ik targets, however if one could pin a vert to object, it would be the same effect but able to be made of many more 6dof shapes , (imagine each ring is instead 12 cubes, so the blimp can dent in rather then just up/down/left right twist…

(actually I could scale that bone maybe?)

I don’t understand what you mean.

An armature bone cannot collide with an object. The physics mesh is static by nature.

The bone constraints only copy the rotation/position/scaling of the object to the bone. The bone constraints gives the user more options. The user can decide if he want to copy rotation/position/scaling or only one or two of them. You need to do the same for a direct vertex object parent.
For assigning multiple vertices to an object you need a list of vertices that is assigned to the object (mesh skinning). You need this also if you directly parent the vertices to an object.

As you may have noticed, it is a bone alternative I’m suggesting here, for crowd animation.
If I have empties in place of joints, in a mesh, the LOD becomes much simpler, I just need to replace the meshes, not the armature. Then I can have thousands of animated objects moving around, and I can animate the objects using logic bricks only (with motion actuators). This can be useful for simple limb animations, for far away objects. The end result could be the same as the use of armature, only maybe cheaper and faster to setup. Also ingame “rigging” becomes easy.

I don’t know, maybe I’m underestimating armatures, but my main motivation is that if I use code to animate, like in the first example, it will still be a bit expensive, as I have to loop through the keys(faster than all vertices), can get slow with many objects. So if all the vertices that are children to a specific object automatically follow the parent’s orientation /position/scaling, I believe its faster because it might not be doing all the calculations done by the bones.

isnt that already possible (hooks and vertex parenting)?