• Advertisement
Sign in to follow this  

Skeletal weight spray painting

This topic is 4518 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey all, Hopefully there is a quick and easy answer to this, but I'm having trouble trying to think one up! I'm currently very disatisfied with every single type of character animation I've been able to find. If the exporter actually doesn't crash out on me, the export process is very fiddly or the animation only support pivot, scale and rotation based animation. Also skeletal animation is not well suited to animated scenery modelling, and I really feel the need for an all-purpose character/scenery solution. That is slightly beside the point because I don't need help getting the exporters/etc to work as I've decided to code my own skeletal animation tool with IK and pivot/rotate/scale animation to boot. I'd like to be able to use the tool to also assign attached particle systems, reskinable models with detachable parts and data tags that can be used to attach arbitrary objects to so that if, for example, I later coded a lighting system, I could attach alight emitting object to the tag by name or ID number. Please also note that if/when I finish coding this system I'd be happy to pass it on for use in other projects, and plan to code it in a similar manner to Cal3D in that the output will simply be a list of faces/tags/materials/etc so that it can be rendered by any API. I'd also like to be able to create template skeletons (different ones for different types of character/scenery) where the bones can be altered to fit any given static mesh that is roughly the same shape and preset animations can be saved in the template so that anyone can get a half decent animated mesh going in minutes by simply adjusting the bones to fit the model and spray painting the skeletal weights onto the model, then spending a short time tweaking the animation key frames to customise it a little. I'd hopefully like to get some physics in there later on as well but for the time being it would just be nice to have a tool that both creates and exports the animations itself so there is no reliance upon 3rd party programs. So anyhoo... my question is as follows: How would you go about spray painting skeletal vertex weights onto a model? Now I know that I could simply check for cursor intersection with the mesh by casting a ray and then only updating the weight of vertices with a normal facing the camera (within the radial confines of the brush), but in the case where you have, say, an arm in front, and a body behind, the back of the arm would not get painted because it's normals face away from the view, but the nearest side of body would get painted despite being occluded by the arm. If I were painting onto a texture I'm pretty sure it would be easier as I could look at using projected textures, but as I'm dealing only with vertices, I'm finding it hard to work out what to do short of performing thousands of intersection tests to determine occlusion which would be horribly slow! I wonder if perhaps there is any depth buffer/ pixel/vertex shader trickery I could use or if anyone else has any other ideas? Any help would be much appreciated and hopefully when I'm done may actually benefit the Gamedev community (I hope!). Cheers, Steve

Share this post


Link to post
Share on other sites
Advertisement
Why the need to spray paint the weights on? Perhaps allowing the user to change joint "envelope" sizes as in 3d studio and automatically calculating the weights for each vertex would be easier.

Share this post


Link to post
Share on other sites
Well part of the reason I want to develop such a tool is for intuitive use, and I have to say that I find envelope systems very fiddly to use as it is difficult to control exactly which vertices are affected while the vertex weight painting tool is as simple as, if you can see it, click and you've adjusted it.

If all else fails then I may go down this route, but I'd rather have it as a complimentary option than a must-use option.

Thanks for the suggestion though!

Steve

Share this post


Link to post
Share on other sites
I don't see what the problem is with casting a ray from each vertex within the radius back to the camera and seeing if it intersects the mesh. This shouldn't be that slow.

Share this post


Link to post
Share on other sites
Quote:

I'm finding it hard to work out what to do short of performing thousands of intersection tests to determine occlusion which would be horribly slow!


When you do a draw, cache the last-known set of intersecting triangles and do a quick check against that the next time you have to do a draw. If the cursor moves or the view-point changes, invalidate the cache (ie. recalculate the new set of triangles)

You could also use a similar method and use a higher-level cache of the sphere that surrounds the last frame's paintable object.

To speed up the actual intersection, build a coarsely partitioned axis-aligned BSP tree of the paintable object whenever you enter paint mode.

Share this post


Link to post
Share on other sites
Just in case you didn't know, 3dsmax, Maya, and I'd assume SoftImage all support painting the weights on. If want to do your own thing, that's cool. But, I thought you might like to know anyway =)

-John

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement