4x4x4 Lattice deformer in Daz Studio -- pre-release / Beta / Unfinished PC/Win x32 / x64 version av
last time i checked the patent on Lattice deformers had run its course ( 1986-2006 )
so i think i can safely integrate it as a plugin or a script
shown below is my first attempt
the scaling-up effect is not supposed to happen
but .... the torus being stretched as if one corner of the lattice is pulled up and away is what i want !
so ... this spring or summer .... should be very useful for poke-through fixes
the deformation is added to the object as a morph channel
-----------
second test, second image, that's more like it !
the torus being deformed is 512 vertices and the test script took only 8 / 10th of a second to compute the morph
so, lets say a 10000 vertices dress would take 16 seconds to lattice-deform
guess we better make it a plugin ... maybe interactive
--------
the maths are all explained here
Real-Time Soft-Object Animation Using Free-Form Deformation
by Alex Ferrier
August 27th 1999
http://www.gamasutra.com/view/feature/131779/realtime_softobject_animation_.php
itself based on
Sederberg, Thomas W.; Parry, Scott R. (1986). "Free-form deformation of solid geometric models".
SIGGRAPH Computer Graphics (ACM) 20 (4): 151–160.
************************************************************************
** sneak peek **** sneak peek **** sneak peek **** sneak peek **
************************************************************************
pre-beta for the adventurous Indiana Jones’s ( or uh the Marion Ravenwood’s )
https://sites.google.com/site/mcasualsdazscripts3/mcjlattice
This is an early version of mcjLattice for DS4.5 PC/WIN
it possibly contains bugs which will crash Daz Studio
( but so far this didn’t happen too often )
if you save a scene containing this version of an mcjLattice node
it may later make the re-loading of that scene problematic
you could proceed this way:
use mcjLattice to create the deforming morph
delete the mcjLattice node, delete the control points,
save this scene or export the morph or the morphed shape
then use morph-loader ... or ... well i dont know DS4.5 that well smile
************************************************************************
for now the plugin works best on objects that remain at their zero position, no rotations
it may work on figures ( see i didnt get to that part yet ) but the figures must be in their zero pose
and the morphis applied to the whole figure
i hope to be able to deal with figure body parts in non-zero-pose poses
************************************************************************
Comments
my code will be based on the article
Real-Time Soft-Object Animation Using Free-Form Deformation
by Alex Ferrier
August 27th 1999
http://www.gamasutra.com/view/feature/131779/realtime_softobject_animation_.php
which itself is based on
Sederberg, Thomas W.; Parry, Scott R. (1986). "Free-form deformation of solid geometric models".
SIGGRAPH Computer Graphics (ACM) 20 (4): 151–160.
my script code will be in readable form (maybe not the plugin code )
Whoo hoo! Now *that's* the type of stuff I was thinking of when I idly started poking at 3D software again (my attempt to learn Maya several years ago crashed and burned from lack of time and the fact that Autodesk's student license agreement wouldn't allow me to actually *do* anything with what I learned). I couldn't figure out why some of this stuff looked so primitive. But patented algorythms explain it.
I bow down to you. Yes, yes, please write that plugin!
That's cool! Good work!
I'm sure that a lattice deformer will be very useful for fixing poke-through.
i'm tempted to do it now, the lattice deformer
though the next project is supposed to be -- updating, the mcjWarp plugin for DS4.5 use
it still works for DS 3 though https://sites.google.com/site/mcasualsdazscripts/mcjwarp-plugin-for-ds3-pc
------
image below : deforming a 3x3x3 faces cube
This would be a great help to all. DForms in DS are not always preferable to use, and this would be another great tool for the arsenal. Is it possible to create a lattice with higher resolution than 4x4? Like the one Photoshop uses for deforming.
i could possibly make the resolution adjustable later ( it's in fact 3 spans x 3 spans x 3 spans for my script experiments )
first i have to cope with the fact that moving any lattice control point deforms all vertices of the object
incidentally that may hold the key to expanding the resolution,
since i read that in games they build 3x3x3 lattices using 3x3x3 lattices that are 1x1x1
results when moving only the 4 lattice control points on the bottom front row
note that this is a low resolution skirt so we don't see the (Bezier) curving effect of the deformer
fig 2.
the script based test setup uses 4x4x4 null nodes as the lattice
( wireframe display courtesy of the mcjTracer splugin )
fig 3 -- a 32x32 cylinder was processed in 2 seconds by the script
--
maybe i'll bring the test script to a humanly-usable form , release that,
and return to the mountain of backlog ... the mcjWarp plugin , the Aiko pumps, the openGL water simulations, the hardware rendered mirrors, the pseudo-dynamic hair ... the Aiko3 bodycon dress ... the other plugins that need to be upgraded to DS 4,5
Just when do you find time to sleep? ;)
i live in a deformed time continuum :)
( lattice plugin widget in DS4.5 )
check this out
the basics of the plugin became functional !
i selected the sphere
created an mcjLattice
the plugin created the 64 null-nodes and placed them around the sphere
then i can simply select and move anyone of the null nodes
and the blue lattice lines immediately follow
next phase is to compute the deformed shape of the sphere ( should be very very fast for under-50K vertices )
and embed that shape as a morph channel of the sphere
it's not a by-the-book deformer, but it's a good candidate for exports
then on June 15th 2013 mcjLattice will become self-aware
ah! lost my 5 lines long post!
so as i was saying before being bamboozled away to my account's "dashboard"
---
this is the first succesful deformation done with the upcoming mcjLattice plugin
( for which i wont give a release date )
- created a sphere
- selected it
- created an mcjLattice
- parented, moved and twisted the top layer of 16 control points
( they are just good old null nodes, easy to work with ! )
- ran this script : Scene.findNode( "mcjLattice" ).activated();
less than 5 milliseconds later a new morph channel was added to the sphere by the plugin
i made the morph strength 100%
done
-----
ideally it will be interactive, so as one moves the control points the object will deform
should not be excessively slower than a d-form
-----
imagine the possibilities, dancing bananas
Ruddy hell, impressive! :)
Wow this could have a lot of application. Thanks for sharing your work.
demo video of the interactive mode ! http://www.youtube.com/watch?v=wB4PJOAogUU
( not included in the video , the crash of the previous attempt )
Super stuff!
Now THAT is a Deformer :)
example, we fit Aiko 3 shoes on Aiko 5's feet
this was done in 10 minutes, so great results could be obtained under an hour
( also, i was able to prevent crashes that happened with this loaded .obj )
also ----> demo video of the interactive mode ! http://www.youtube.com/watch?v=wB4PJOAogUU
a funny test that had a good side, i discovered the mcjLattice node continues working after being deleted
. o O ( now i guess the mcjLattice node should disconnect itself from the control nodes and self destruct ? )
. o O( its like the 6th sense, the node diesnt know it's dead )
This is a very exciting development. I just discovered the lattice deformer in Hex and was bemoaning the fact that this would be great in DAZ. Did you read my mind?
WHOLLY BOVINE!!!!! This is amazing!!! Casual, you sure you want to give this away?????
one of the factors is that, if i create something to sell, i'll have to put a lot of additional effort to make it robust and test it longer, and write cleaner instruction manuals and there's the update issue that would be more pressing :)
note that i plan to just make it useful and not add too much options, so i can get back to all the other stuff i started
in unrelated matters, old pre 2003 music selected by me http://mcasual.tripod.com/momo156.html
New Preview / Test video
https://www.youtube.com/watch?v=ukVgkjYyAbc
when i was moving 16 of the lattice nodes at the same time,
the plugin would get 16 requests to update the deformation
so i instituted an update throttle at 10fps
it will probably be adjustable in the release
also you can see i'm using a little script to select whole panels of lattice control points in 1 click
and you can see there's a vertex of the deformed object mistakenly left behind
figure 2 - solved the "vertex left behind" issue by inflating the lattice
i'm thinking of a release this weekend
but recent experiences showed predictions may be off by 1 week or 2 :)
here's the ToDos, features and fixes i can think of
- make sure the plugin doesn't eat up memory (memory leaks )
- understand why mcjSceneGraf cant see the morph channel created by mcjLattice
- make it possible to narrow down the deformed surfaces -- selection by Bone or by Material
- do the maths to handle body parts that are rotated in space ( vs their zeroed position )
- 32 bit / 64 bit,
- for DS 3.1 and for DS 4.5
- make it possible to create many morphs from the same lattice ( example, morph per animation frame )
- control the maximum updates per second ( which is presently set at 10 per second ) ...
- accommodate animation renders
- prepare for verlet-based cloth physics ( dangling chains of nodes )
However long it takes! :)
i wasn't expecting this test to work,
but that's the first test where the object is not immobile
plus, i was able to render an animation
and this involves the morph for each shape shown is updated before each frame is rendered
what we're talking about here is a custom morph generated on the fly
so it the lattice was deforming long hair,
then by parenting part of the cage to the head and part of the cage to the chest,
we could have head movements and dangling part of the hair would stay laid on the chest
( in some cases that type of trick is already achievable using good old D-Forms )
one thing to note is that the entire universe is deformed, even what's outside the initial cage area
this is not always wanted so i'll have to do something about that
---------
figure 2 - we sure don't want to completely get rid of them world deformations
Is it ready for trying? It is amazing. I'm sure that it will cut down the time I spend on making morphs.
************************************************************************
** sneak peek **** sneak peek **** sneak peek **** sneak peek **
************************************************************************
pre-beta for the adventurous Indiana Jones's ( or uh the Marion Ravenwood's )
https://sites.google.com/site/mcasualsdazscripts3/mcjlattice
This is an early version of mcjLattice for DS4.5 PC/WIN
it possibly contains bugs which will crash Daz Studio
( but so far this didn't happen too often )
if you save a scene containing this version of an mcjLattice node
it may later make the re-loading of that scene problematic
you could proceed this way:
use mcjLattice to create the deforming morph
delete the mcjLattice node, delete the control points,
save this scene or export the morph or the morphed shape
then use morph-loader ... or ... well i dont know DS4.5 that well :)
--------
for now the plugin works best on objects that remain at their zero position, no rotations
it may work on figures ( see i didnt get to that part yet ) but the figures must be in their zero pose
and the morphis applied to the whole figure
i hope to be able to deal with figure body parts in non-zero-pose poses
====
figure 1 shows a 16x32 primitive sphere being deformed by an mcjLattice-produced morph
fig 2 shows the "Geometry" section of the mcjLattice's "Parameters" tab
theres a slider to change the crayon width used to draw the cage
and there's a drop down list to select which node is the object of the deformation
fig 3 shows that the mcjLattice was transfered from the 16x32 sphere to a 4x8 sphere ( for now you have to kick one of the control points to uh apply the deformation to the newly selected object
So this would be like a softbody deformer right in DAZ Studio?? If so this will be very very helpful in getting some of the fix morphs I need done completed if there is a way to save them as a morph target afterwards.
for now,
you select an object and you create the mcjLattice, which appears to you as a cage around the object to deform
the cage is attached to 64 null nodes , which i call control points
as you move the control points, the cage is deformed and the object in the cage is deformed
what the plugin did just now, is, it added a morph channel named Doby which contains this deformation and it set its strength to 100%
as you continue moving the control points, the Doby morph is updated
------
for now
the deformation affects the whole object or figure (didnt test this yet )
but i plan to make it possible to deform just the part of the figure "owned" by a bone
or just the part of the figure in the cage
------
i don't know all the options available in DS4.5
one way to export the morphs on props is to use "PP2 exporter"
DS4.5 can also export some things and it saved the Doby morph
another way is to export the morphed object as an .obj file, then re-import the .obj using uhh Morph Loader which is somewhere in the Scene sub-menus
If there is a way to set up the plugin like the D-Form plugin to name and then "Spawn Morph" one could then just save out the figure with the morph information embedded. :-)
Looking forward to seeing how this develops. Your on to something Casual!
Note that in a way the deformation is already Spawned the moment you move a control point, but for now it's always the Doby morph on the Doby Channel. for figure use, it would be on a standard figure channel like PBM_something
this morning's version is very premature
--
the other thing i plan is indeed to let users specify morph names, also the possibility to create 1 morph per animation frame , and maybe as is the case in mcjElevate, the possibility to export the morphs as pose files
mcjElevate https://sites.google.com/site/mcasualsdazscripts/mcjelevate-reva
mcjElevate the movie ... http://www.youtube.com/watch?v=6dP8faP3KMo