Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Animated sculpties in Wings3d [Question]

Ledje Gorky
Registered User
Join date: 1 Jun 2005
Posts: 126
04-22-2008 00:09
Its been awhile since i posted in these forums, but the answer "doesnt seem to be out there".
Here is the situation:

I use Wings3d for my sculpty making together with Omei Turnbull's lovely exporter.
It works great and my sculpties turn out well.

Now im trying my hands at animated sculpties.(with a nice script)
When i make my different shapes in Wings3d and import them in SL, they are not all in the same scale.
One is bigger , one is smaller ; all dependant on its center point (i think)

How can i make this work? Attached is a simple example.
As you can see the little cube is going up and down (inworld). But when i import them in SL, sculpty2 is much bigger then sculpty1.
Rescaling in SL isnt an option cause its gonna be an animated sculpty.
And this is a simple sculpty. Eventually i want to do organic looking animated sculpties, so i need a solution before i go on....
Nectere Niven
Gadget Junky
Join date: 12 Jan 2007
Posts: 211
04-22-2008 02:54
Is sculpty 2 bigger than sculpty 1 on purpose? Or is this some sort of exporting issue?

As far as I know there are several things to try (always a tinkerer):
In wings rez a cube on your workspace, save the bounding box, delete the cube, then have your object center and scale all to the bounding box, do this with each of your sculpts. That should if I understand it correctly set a standard for the size and centering to be the same across the board.

"Rescaling in SL isnt an option cause its gonna be an animated sculpty." I am not sure I understand why - but if its via script you can set the prim parameters to be a specific size, as well as texture and all the other params.

this page has saved me a lot of headaches
http://www.lslwiki.net/lslwiki/wakka.php?wakka=llSetPrimitiveParams

I think maybe I am not following what you are wanting, as my solution would be to just keep using the same model over and over tweaking it for each animated frame so that I know it would be all the same size and orientation. You can also just layer your models in wings and choose which one to export each time, so you can see the changes from one model to the next.

Then again maybe I am clueless :P
Ledje Gorky
Registered User
Join date: 1 Jun 2005
Posts: 126
04-22-2008 05:16
Indeed, i am usually not very clear in my posts. Its my one flaw ;)

sculpty 2 isnt supposed to be bigger then sculpty 1, but when i import it into SL,
sculpty 2 ends up being bigger than sculpty 1 .
(eventhough they both have the same dimensions in SL , i.e. 0.500; 0.500 ;0.500)

From: someone
- but if its via script you can set the prim parameters to be a specific size, as well as texture and all the other params


So this means i can rescale and reposition each "frame" of the animated sculpty with llSetPrimitiveParams? Not sure if this is the most elegant solution, but i'll try that.

From: someone
In wings rez a cube on your workspace, save the bounding box, delete the cube, then have your object center and scale all to the bounding box, do this with each of your sculpts. That should if I understand it correctly set a standard for the size and centering to be the same across the board.


this might actually be what im looking for !

I will keep trying.....

(More input is always welcome)
Vlad Bjornson
Virtual Gardener
Join date: 11 Nov 2005
Posts: 650
04-22-2008 09:52
I've run into this same problem, Ledje. I think the problem is caused by the fact that the sculpty converters I have use will sort of maximize the volume of the sculpty to fill the space of it's bounding box. I'm sure that they do this to maximize the accuracy of the sculptmap, but it does cause the problem you describe when trying to animate.

Using llSetPrimitveParams to move the prims would probably work, but it might muck up the works. :) Hard enough to get a smooth animation by swapping sculptmaps as it is. I suppose if you combined the prim resizing/moving call with the sculptmap swap that you wouldn't necessarily slow down the time between 'frames' of the anim, tho.

I think a better solution, if it's even possible. would be to find a converter that preserves the size of each sculptamp. Not sure if something like this exists but it would be handy. Maybe some way to set a region that your animated sculpties would fit in, then create each from within this box.

It might also be possible to adjust the sculptmaps after the fact using Photoshop. I know that people can muck about with sculptmaps in Photoshop and it may be possible to change the scale of a sculpty this way, maybe by desaturating or something similar? Sculpty wizards like Aminom or Domino or Omei may be able to shed some light on that idea.
_____________________
I heart shiny ! http://www.shiny-life.com
Omei Turnbull
Registered User
Join date: 19 Jun 2005
Posts: 577
04-22-2008 09:59
Ledje, the fact that a sculpty only allows 8 bits of fixed-point precision for each vertex coordinate essentially requires that the sculpty's final size be set in-world, after the sculpty bitmap has been imported. For an animated sculpty, where the overall size changes from frame to frame, that means setting the size for each frame in the script with llSetPrimitiveParameters, as Nectere suggested. You can determine the proper scale values by manually adjusting the sculpties in Edit mode and then reading off the scale values.

If the sculpty frames have large changes in size, as illustrated in you example, you may also have to tweak the prim position with llSetPrimitiveParameters. To minimize the need for this, uncheck the "Allow recentering" box in the Sculpty exporter options dialog. Then, try to center all your "frames" in the same position in Wings before you export them.
Omei Turnbull
Registered User
Join date: 19 Jun 2005
Posts: 577
04-22-2008 10:13
After reading Vlad's post I thought about the issue a little more. It certainly wouldn't be hard to add an option to the Wings exporter that would make things easier for you. Until now, I had thought of sculpted animations as being something with potential, but given SL's problems with latency (lag), not something to take very seriously.

If anyone can show me that animated sculpties work well enough to justify it, I'll add something to the Wings exporter to make their construction easier.
Vlad Bjornson
Virtual Gardener
Join date: 11 Nov 2005
Posts: 650
04-22-2008 13:56
Omei, I've actually had the best luck animating sculpties with your Wings3D exporter. Turning off the recentering option is as close as I can get to a truly 'registered' set of animation frames. I have an animated flower that I can drop on you to demonstrate the results.

One of the main problems with animating sculpties is the .2 second delay caused by the call to llSetPrimitiveParams. 5 frames a second is a bit slow for the illusion of smooth motion. You can hack up a couple of scripts to sort of interleave the calls, nearly doubling that rate. Then you run into trouble with getting the sculptmaps to load and change in the client quick enough to keep up.

The best/smoothest sculpty animation that I've been able to create was done with video. you can use video as the the source of the sculptmap, although you still need to make repeated calls to llSetPrimitiveParams to get the actual shape to update. It's been hinted at by Qarl that these calls may be unnecessary in the future which would make for some super spiffy animations - although they would still be hampered by the same rules that make video difficult to use in SL.

I think one way to make sculpties easier to animate would be for LL to provide a function similar to llSetTextureAnim, but for the sculptmap. That way you could prepare a grid of sculptmap frames and step through them at will. This has been suggested on the JIRA, again by Qarl, but I have no idea if we will ever see such a feature.
_____________________
I heart shiny ! http://www.shiny-life.com
Welleran Kanto
Registered User
Join date: 15 Mar 2008
Posts: 64
04-22-2008 22:48
From: Omei Turnbull
After reading Vlad's post I thought about the issue a little more. It certainly wouldn't be hard to add an option to the Wings exporter that would make things easier for you. Until now, I had thought of sculpted animations as being something with potential, but given SL's problems with latency (lag), not something to take very seriously.

If anyone can show me that animated sculpties work well enough to justify it, I'll add something to the Wings exporter to make their construction easier.


I thought Vlad's YouTube video, showing his "Sculpted Thoughts" animated sculpty, is a tantalizing glimpse of the possibilities.

I want my first animated sculpty to be a giant, throbbing chicken heart with veins bulging... or maybe an egg that sprouts feet and walks away. Is that serious enough for you? Maybe a giant chicken heart inside an egg that sprouts feet and does the cartoon sneak while whistling "Numa Numa"? :D Mmmm, eggs....
Ledje Gorky
Registered User
Join date: 1 Jun 2005
Posts: 126
04-23-2008 00:07
Excellent, this is what i was hoping for: input from people who know what they are talking about :)


From: someone
If anyone can show me that animated sculpties work well enough to justify it

I would have to refer you to the stuff Vlad makes...it makes me drewl :)

Thanks for the clear explanation, Omei. I did try it with unchecking "recentering". Also tried it with making a bounding box and scaling+centering every sculpt to the bounding box.
Didnt make any difference though.

Vlad, if i'm not mistaking, you use Zbrush3.0 + converter for making sculpties. Does this create the same problem? (I already have Zbrush3 but i use it only for texturing and baking the sculpt i made in Wings3d)
EDIT: wow,I just read that you made your animated flower with Wings3d. There is hope ! :)

Also , as soon as i get inworld, i will refer Aminom to this thread, cause i'm pretty sure it is possible to adjust the sculpty in photoshop later on (at least for simple sculpts)
Maybe he can shed some light on this.

Thanks for the replies
Vlad Bjornson
Virtual Gardener
Join date: 11 Nov 2005
Posts: 650
04-23-2008 00:47
Welleran: yeah that Morphing sculpty is a good example of what can be accomplished with the video as sculptmap. The effect is broken in the current main viewer but is fixed in the current RC (1.20.2). yay! Here's a link to a video of the piece in action:

http://www.shiny-life.com/2007/07/25/morphing-sculpty/


Ledje: Yes, Now I am using zBrush plus the SculptyMaker converter by 2k Suisei. Same problem with growing/shrinking of the sculptmap frames for animation. I still use Omei's plugin at times, too.

For that animated flower I created the 4 stages of the opening petals in zBrush. I started with one mesh and just sort of bent it into 4 different shapes. I think using the same initial mesh for each frame helped keep things in line. Then I saved out as .obj files and imported into Wings3D. When exporting I turned off the options that recenter or rescale the object.

I'd love to hear what Aminom has to say about tweaking the sculptmaps in Photoshop. I have not experimented in that area yet.

I should also do some experiments with a script that changes the size and position of the sculpts along with the sculptmap. Kind of a heavy handed approach but it is worth a try.


/me runs off to make a fried egg sandwich.
_____________________
I heart shiny ! http://www.shiny-life.com
Aminom Marvin
Registered User
Join date: 31 Dec 2006
Posts: 520
04-23-2008 10:46
Two ways to do this:

1) in a 3D modeler like Blender or Wings, take two verts somewhere on the sculpt and position them at the upper right and lower left corners of the model. This is sort of a hacky way of making a bounding box to make sure the stuff that is animated is the same scale. However, it requires restoring the two used verts in photoshop, which can be tricky. However, the parts of the sculpt that are the same position in all "frames" of the animation will be exactly the same, making this good for mechanical things like pistons.

2) Scale the frames in photoshop to be uniform. To do this, use the color curves tool on the channel(s) that need to be scaled. In the example picture, it would require the left "frame" to be scaled on blue (z axis) using the numbers 0->0 and 255->191 or something like that. Experimentation and tweaking is required D:
Ledje Gorky
Registered User
Join date: 1 Jun 2005
Posts: 126
04-23-2008 11:19
right.....lol

At least now i know what im doing this weekend :)
Domino Marama
Domino Designs
Join date: 22 Sep 2006
Posts: 1,126
04-23-2008 12:33
From: Aminom Marvin
1) in a 3D modeler like Blender or Wings, take two verts somewhere on the sculpt and position them at the upper right and lower left corners of the model.


Ughh. This is unnecessary in Blender. My scripts allow for bounding boxes (or sizing spheres /8/60/203571/8.html#post1890321)

If the animation is contained within the models, like a can squashing, you can just select all the sculpties for the different frames at once, and Render - Bake Second Life Sculpties will work out a common center and scale for them.

You can add a sizing sphere as mentioned in the post linked above if you were doing something like a fish swimming in a circle, where the overall size needs to be bigger than the sculpties. Setting the LL_SCULPT_TYPE to 0 means it is counted in the range calculations but isn't baked.
Vlad Bjornson
Virtual Gardener
Join date: 11 Nov 2005
Posts: 650
04-23-2008 12:35
From: Aminom Marvin
1) in a 3D modeler like Blender or Wings, take two verts somewhere on the sculpt and position them at the upper right and lower left corners of the model. This is sort of a hacky way of making a bounding box to make sure the stuff that is animated is the same scale. However, it requires restoring the two used verts in photoshop, which can be tricky.


ooo. very clever :) Sort of like making your own registration marks in the actual sculpty.

If you did use a few of your vertices to make this forced bounding box, why would you need to fix them up in photoshop? Wouldn't these marker vertices end up in the exact same spots every time with the rest of the sculpt inside the bounding box and positioned relative to the markers?

Just curious, cuz I don't have any experience controlling individual vertices in a sculpt, or creating multiple distinct shapes with one sculpty. need to learn this trick, tho :)

To accomplish this forced bounding box with my normal tools (zBrush) I think I may need to sacrifice the top and bottom row of vertices to create this forced bounding box. Then I could hide these two rows with a custom alpha texture. Or I may just have to bust out Wings3D again since it gives better control over individual vertices.

Thanks for the tip! This will be a fun experiment. :)

Your second idea of adjusting the maps in Photoshop was pretty much what I was thinking. Sounds like a lot of trial and error to get it exact, tho. Or maybe some very careful construction and post-production math.
_____________________
I heart shiny ! http://www.shiny-life.com
Vlad Bjornson
Virtual Gardener
Join date: 11 Nov 2005
Posts: 650
04-23-2008 12:41
From: Domino Marama
If the animation is contained within the models, like a can squashing, you can just select all the sculpties for the different frames at once, and Render - Bake Second Life Sculpties will work out a common center and scale for them.


cool. I wish I didn't have Blenderphobia. :eek: Might just have to give it another shot. I've seen some neat sculpties created with Blender. Like a tablecloth that used the soft body physics to drape the cloth over a table then capture the resulting mesh.

/me wanders away mumbling, "I must not fear. Fear is the mind-killer. Fear is the little-death that brings total obliteration...."
_____________________
I heart shiny ! http://www.shiny-life.com
Domino Marama
Domino Designs
Join date: 22 Sep 2006
Posts: 1,126
04-23-2008 13:30
From: Vlad Bjornson
cool. I wish I didn't have Blenderphobia. :eek: Might just have to give it another shot. I've seen some neat sculpties created with Blender. Like a tablecloth that used the soft body physics to drape the cloth over a table then capture the resulting mesh.

/me wanders away mumbling, "I must not fear. Fear is the mind-killer. Fear is the little-death that brings total obliteration...."


He he.. I'm biased having written the scripts, but I think Blender is the most flexible of any of the sculptie tools. There's a shrink wrap feature being developed as part of the Google Summer of Code so that should make converting existing meshes even easier too :)

http://code.google.com/soc/2008/blender/appinfo.html?csaid=1FE28CB9D0098771

I knew I'd described how to do a sizing sphere in another thread but couldn't find it earlier.. I'd called it a scaling sphere then for some reason <shrugs> /8/7d/254217/1.html

And here's my latest demo of the Blender scripts /8/60/203571/9.html#post1936182

I'll wander off now.. Sorry for so much posting about Blender in a Wings thread.. Just join in one of the existing Blender threads or mention it in the title of a new thread if you've any questions you want me to see :)