Page 1 of 5
Muscle system for blender
Posted: Mon Nov 19, 2007 4:57 pm
I'm planning on implementing a muscle system in blender which I've designed from scratch. It uses a modified Gaussian function along with user data to calculate deformations. The way I'm thinking of putting it in is to add an object type "Muscle" which can be edited with the edit panel in the buttons window type. Eventually I want to be able to add modifiers to muscles so that the muscle can be deformed by armatures etc.
I've finished the maths side of it all and I can program "fluently" in c/c++, but I'm new to the blender source and I don't know where anything is. Basically to begin with I just need to know how to add in a new object type.
Posted: Thu Nov 22, 2007 7:30 am
very neat sounding idea,
instead of another object type - you might want to consider adding muscle as a modifier to mesh instead similar to how softbody is done.
That said, here is a tutorial on how to add an object type
and here is info on the modifier stack
http://wiki.blender.org/index.php/Blend ... ementation
Posted: Thu Nov 22, 2007 4:52 pm
I thought about a muscle modifier for a mesh, but I decided against it because I thought it may make it difficult to use. Instead I decided on having an object containing only muscles which can be modified by armatures and then to deform a mesh with muscles there will be a modifier for the mesh which takes as parameters the muscle object and density of skin.
p.s. how difficult would it be to get this included in the next blender release, if it all works.
Posted: Thu Nov 22, 2007 5:40 pm
handydan wrote:...I decided on having an object containing only muscles which can be modified by armatures and then to deform a mesh with muscles there will be a modifier for the mesh which takes as parameters the muscle object and density of skin.
Posted: Thu Nov 22, 2007 8:44 pm
If it works well and is coded 'reasonably' getting stuff into head isn't usually too difficult if something is useful. You might email bf-committers with a design doc and letting everyone know what you are up to. Of course sometimes it is a lot easier to get something working, provide a patch, and then ask for feedback.
Posted: Sat Nov 24, 2007 10:25 am
The Object type tutorial in the wiki has got errors in it. It misses out some include files and some of the code could cause memory leaks if it worked. Where should I get write access for the wiki from to correct it?
Posted: Sat Nov 24, 2007 3:00 pm
Tell me what your wiki username is, and I can give you write access.
Posted: Sat Nov 24, 2007 5:53 pm
Posted: Sun Nov 25, 2007 10:57 am
handydan wrote:Its Handydan
Posted: Sun Nov 25, 2007 1:33 pm
Posted: Thu Nov 29, 2007 1:48 pm
hey handydan. I was just about to try a cheat method for muscles using the new mesh deform modifier, but your way sounds much better. If you want any help testing or with models/characters/animation etc then I'm all ears. I mainly hang around the blenderartists.org forums under the same user name. I can't help with code however because I dont know any and by the time I learnt enough you'll probably have finished.
Posted: Sat Dec 01, 2007 10:49 am
thanks, but I'm still a ways off making anything usable yet.
I've got a problem with a memory leak. The problem is that my object isn't being freed when blender shuts. To my understanding free_libblock in Blenkernel/intern/library.c is the function that should free the object, but it isn't being called for my object.
I think that the problem is that my muscle object isn't being added to the current scene. After looking at the Scene struct I found the linked list "base". Is this where objects are stored in the scene? and if so where and how in the source should my object be added to the list?
The next problem will probably be, how to add an edit mode to my object and also how to alter the buttons panel to add editing options, but after that I think I can finish it.
any help much appreciated,
Posted: Sun Dec 02, 2007 5:35 pm
I'm really stumped by this, I've been closely following the lattice object, but searching the source for "case OB_LATTICE:" doesn't throw up anything as far as I can see, (but I did find out where to add the buttons panel code).
anybody got any ideas?
p,s I added "printf("freeing %s\n", id->name);" to the top of free_libblock. Its definitely not being called for my object.
Posted: Sun Dec 02, 2007 6:10 pm
A place to quickly get answers is #blendercoders at chat.freenode.org. Please do join us there
I'm sure you'll find the most help there.
Posted: Wed Dec 05, 2007 3:52 pm
Sorry, maybe it's already in the code (but as I don't speak gaussian deformations I wouldn't know). The thing that would really be great with having a "muscle mesh" would be to make it so that the collisions with a softbody are "correct". I've been trying out to get a muscle (fluid) inside a membrane (softbody) but the two systems being separeted at baking, it didn't get very far.
From observation I noticed that the volume of the muscle is constant, and thus that a fluid inside a softbody would nicely simulate it.
The real trick would be to have the skin over the muscle "riple over" to get realistic anatomic rendering.
Disclaimer: I'm not asking for anything, I'm just airing my thoughts.
Have fun coding.