sculpt mesh Tablet support, bug squash Dec 25th Merry XMAS

Okay here is a quick demo of what Michael Schardt and I have been working on

http://www.letwory.net/tutes/displace_mesh_test.htm

http://www.letwory.net/tutes/displace_mesh_makehuman.htm

It requires blender 2.35 or later

http://www.blender3d.org/cms/Blender.31.0.html

Then download the script from here

http://wiki.blender.org/pub/Blenderdev/SculpMesh/sculpt_mesh_tablet22.zip

see directions at the wiki

http://wiki.blender.org/bin/view.pl/Blenderdev/SculpMesh

The short version is, select the mesh, run the script, LMB to sculpt, LMB+ALTKEY to change selection size or displacement height, and FKEY to flip the displacement negative or positive. UKEY to toggle Undo mode, ESCKEY to exit. Arrowkeys to change the displacement direction and height. Also you can use a pen tablet now.

Have fun,

LetterRip

And a brief tutorial…

Open up a blend.
Split the screen.
Open a text window.
Open the script in the text window.

select your mesh to edit

Go to the text window and
Press alt-P

Go to the object,

Hold down the RMB to displace mesh,
Press alt RMB to change selection radius or to toggle displace in/out

Press ESC, or Q to exit the script (you need to to rotate the mesh, etc.)

Have fun,

LetterRip

looks awesome. is this a prove of concept? so is it gonna be implemented directly into blender? that’d be neat though…

This is awesome!!!, a greate way to model I can see.

EMesh will make this useable too!!!

Here a few points - features you could added and would make it even better.

  • Automatic subdividing of faces based on area so you would never loose detail
  • Automatic removing and joining of small faces that arnt needed.
  • These 2 would be really nice, the user could then pull the mesh about like a piece of rubber never worrying about the underlieing mesh data.
    Whole shapes could be draged from a single strand of snot :).
  • I could code this BTW.
    … also, these would have to be optional with area limits etc. it would be no good having the distortion painting messing around with the mesh structure for say, a low poly UV mapped model.

The biggest problem I have with a lot of these organic/fuzee modeling techniques is that you end up with fuzee/bloby objects too. (subsurf - preCreases) ans other packages that use the paint/drag allong normals

An awesome solution would be to have different brushes, there are some options for implimentation too.
Bitmap brushes! - Greyscale tga’s or somthing like that, would be a pain to code I would think but once done you could make a heap of different shapes, You could have all sorts of shapes, bullet dints- pot holes- cracks as in a wall,
With the added extra that ANY existing height map could double as a brush for high res meshes.

This would be nice because you could have chisel like shapes that didnt result in soft edjes- or spikes by the same tolten.

Wow- I just had another idea, you could use an RGB image (like a normal map)
so instead of having Black = low and White =High,
Each pixels color value (r/g/b) would represent a direction in 3D space.
THIS WOULD BE SO COOL- Just think
If this was coded in- any person with an image editor could invent brushes that would Twist, narrow, broarden- spin any way in 3d space- and all as a brush.

Other types of brushes involve a more mathamatical approch, though I think if bitmap brushes were implimented, you may have no need for any other kind (especialy since scaling the area bitmap brushes affect in 3D space wouldnt be hard once the rest was implimented)

Math would be faster then bitmap, but mabe not that much faster- randomization might be nice- like fractal brushes, or brushes that changes there properties as you painted, (Pressure sensitive from a wacom pad!!- No IM going too far now.) but it could be fun to fiddle with.

What might be nice is a Python/Brush system so users could add in there own brushes- The image/brush could be one of them.

Another optuion could be hardness- Various vert attributes could be used to determine how hard a vert was - Vertex colour being the simpelest.

You could paint balck/while vertex colours to determine how hard dofferent parts of the mesh were, then you could do your mesh deforme painting and only affect certain areas- or use if for artistic ressions.

Could also have dynamic hardness that either increases (like steel) or decreases (like water and cornflower) as you model it.
Hardness could be stored as bone weights too- would be more logical :).

Anyway some food for thaught, But I could code a lot/all of this too, so mabe we could work on it together.

The original version is implemented using alphamasks,

see this link,

http://wiki.blender.org/bin/view.pl/Blenderdev/DisplaceMeshFollowsMouse

I just haven’t had time to merge the old code with the new code yet.

So, you can have all sorts of brushes at your disposal. In the comments is a link to a thread on how to get RGB info from an image.

Also if you read the comments it lists a number of planned features, and ways to go about implementing them.

If you’d like, feel free to help with the merging. Or the usage of mirroring (mentioned in the code comments just use the Makehuman symetry code…) Or anything your heart desires of course <grin>.

LetterRip

cambo,

Automatic subdividing of faces based on area so you would never loose detail

I posted a script to bf-funboard for this purpose (subdivides mesh that are stretched much more than average). However, if you read the comments to the older script, a better method is to just paint a displacement/normal maps.

I plan, eventually, to take complex meshes, and then create multilayer displacement maps to simplify them. Thus we can get simple primitives (objects less than 100 faces say) that are amaizingly detailed.

Automatic removing and joining of small faces that arnt needed.

The fgons (fake gons) code should allow that… I’ve given it some thought. Especially with the displacement map idea it becomes trivial.

An awesome solution would be to have different brushes, there are some options for implimentation too.
Bitmap brushes! - Greyscale tga’s or somthing like that, would be a pain to code I would think but once done you could make a heap of different shapes, You could have all sorts of shapes, bullet dints- pot holes- cracks as in a wall

The alphamask idea is already coded in the original version, but the code to extract the data from images wasn’t implemented yet (there is a link iin the comments though).

Other types of brushes involve a more mathamatical approch, though I think if bitmap brushes were implimented, you may have no need for any other kind (especialy since scaling the area bitmap brushes affect in 3D space wouldnt be hard once the rest was implimented)

The old code has support for arbitrarily sized alphamaps. Also has some built in mathematical based brushes already (which are translated to alphamasks).

Math would be faster then bitmap, but mabe not that much faster- randomization might be nice- like fractal brushes, or brushes that changes there properties as you painted, (Pressure sensitive from a wacom pad!!- No IM going too far now.) but it could be fun to fiddle with.

I really do wish we had wacom support though. We definitely need support for brushes that vary with the stroke (directional brushes, etc.) All of the above is planned, but not yet implemented.

You could paint balck/while vertex colours to determine how hard dofferent parts of the mesh were, then you could do your mesh deforme painting and only affect certain areas- or use if for artistic ressions.

Yep, I plan to have the ability to mask off mesh to not be affected or be affected less by a brush. Haven’t decided how I want to go about it yet though.

Anyway some food for thaught, But I could code a lot/all of this too, so mabe we could work on it together.

I totally encourage you to go wild <grin>. Anyone who is interested can dive right in, the possibilites are vast, and thus there is plenty of work to share with everybody.

LetterRip

EDIT :::

PAtch works on OSX but very very slow.

Questions and comments. Can it be changed to the left click ?
Can it be click and drag ? As what I find right now is the that it has to click a lot to show the deform, as draging just moves the entire mesh around, or opens up the toolbar menu.

Great start though! I always said that the displacement script wopuld be sweet in a live updateing mode.

Specs. OSX 10.3.3 500mhz G4 128mb ATI 900 pro 1.2 gig ram

patch no work on OSX

could you give a bit more detail by no work?

Does it not apply? Does it not compile? Does it not run? Or something else?

LetterRip

Very cool. I hope this makes it into the next version of bf-blender. Unfortunatly I have to wait for each windows binary to come out. I do not trust my C skills with the lcc compiler I have.

wow thats awsome, tablet support would be awsome :D.

SHABA1; there are test builds avalible at www.blender.org in teh forums, then ‘test builds’

im compiling this now, if i can find someone with some webspace to keep it, i will post about it there.

The above script only works correctly with objects at the screen center who have had scaling and rotation transforms applied.
I’m fixing it right now, but if you get strange results, that is why.

LetterRip

I think, yur script should be used for Topology Brush in silo 1.3 also
http://www.silo3d.com/forum/viewtopic.php?p=10873#10873
http://www.silo3d.com/Images/topology2.jpg
http://www.silo3d.com/Images/topology3.jpg
This feature can be use to:

  1. reconstruct a modle in tridfaces/quadfaces
  2. reconstruct a modle with less faces
  3. put fit clothes on the people

That wouldn’t be too hard actually…

If I were implementing that feature (which I’ll probably let someone else do…) is first, find the nearest face that the mouse is on, now create a temporary copy of that face and subdivide it till you are ‘close enough’ to the mouse location. Then that point is your point on your new surface. Store the point in your new structure (Maybe place the points on a seperate layer). Then repeat for each mouse click.

Then use a snap feature when you are ready to close it, plus you can do some smoothing of the mesh so that faces are the same size. Probably use a mirroring tool too so that you complete both sides at the same time…

LetterRip

PAtch works on OSX but very very slow.

Questions and comments. Can it be changed to the left click ?
Can it be click and drag ? As what I find right now is the that it has to click a lot to show the deform, as draging just moves the entire mesh around, or opens up the toolbar menu.

Great start though! I always said that the displacement script wopuld be sweet in a live updateing mode.

Specs. OSX 10.3.3 500mhz G4 128mb ATI 900 pro 1.2 gig ram

We are speeding it up. It really depends on your mesh size for how fast it is. I’m on an athlon 2500 and it works plenty fast for makehuman.

Which script are you using, this one or one from the other site? (The one here is faster right now…)

I’ll test on a mac here and see…

The click and drag is a bug in the event handling code, it will be fixed after we get the segfault fixed in blender Draw.Register code.

To change it to left click, go to the lines that say

mouse_buttons == 4

and change it to

mouse_buttons == Draw.LEFTMOUSE

LetterRip

Very cool! I use tools like these all the time in Maya- they’re called Artisan tools. I haven’t actually ran your script yet because I don’t want to mess around with non-cvs builds, but I have some suggestions for your interface.

Displacement Amount -

Min Radius -Maximum displacement force out to this radius
Max Radius -Linear fade to 0 displacement force at this radius

Direction displace:

  • View Direction
  • Normal Direction
  • Specific axis (x,y,z)

Method:

  • Push- negative x,y,z or normal/view- Pull- positive x,y,z or normal/view- Erase- Resets area back to pre-script condition

To use it with cvs will require this patch

http://projects.blender.org/pipermail/bf-committers/2004-October/007783.html

I’d like to try this out; how do I apply this patch? :expressionless:

Does it have to be applied at compile time?

Hi Ripsting,

agreed, I already have much of that functionality planned. There are lots of simple things to do.

This type of functionality is found in Maya (as you noted) in ZBrush (where most people know it from), and is also available in 3DS, and presumably XSI and others as well.

I just finished merging most of the code from the first and second version. I think it runs slightly slower, but it has full alphamask capability now and uses the backface culling.

Will post an update shortly.

LetterRip

removed old version

if you have used psyco in the program and compiled all py file to optmized pyc file. Do I need to install psyco on my pc?

Umm…

I have no idea - I have only the vaguest knowledge of psyco and I haven’t seen any compiled files from it around… However, psyco isn’t required to run the script. Hence the try except block.

LetterRip