Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Blender Sculptie Importer - Attached

Kate Nicholas
Registered User
Join date: 22 May 2006
Posts: 8
04-08-2008 19:16
This may very well be a case of user error, or failing to read well enough, or somesuch ... but the latest scripts, on 2.45, Mac OS X 10.4, seem to fail for baking sculpties.

Importing? Fantastic!

Baking? Fails. Here's what's on the console:

--------------------------------
Traceback (most recent call last):
File "<string>", line 447, in ?
File "<string>", line 423, in main
File "<string>", line 323, in updateSculptieMap
NameError: global name 'sorted' is not defined
--------------------------------

Any thoughts? My money is on mis-configuration on my part :)
Domino Marama
Domino Designs
Join date: 22 Sep 2006
Posts: 1,126
04-09-2008 01:07
From: Kate Nicholas
This may very well be a case of user error, or failing to read well enough, or somesuch ... but the latest scripts, on 2.45, Mac OS X 10.4, seem to fail for baking sculpties.

Any thoughts? My money is on mis-configuration on my part :)


Yes. The 2.45 Mac version of Blender uses Python 2.3 and the baker script requires Python 2.4 or later.

You should install a version of Blender built with Python 2.5 from http://graphicall.org and Python 2.5 from http://python.org

http://www.graphicall.org/builds/builds/showbuild.php?action=show&id=582 looks like it should be a good choice
Caylord Theas
Registered User
Join date: 15 Aug 2007
Posts: 24
04-16-2008 08:19
Dominio.

I just tried the script to create a sphere with blender 2.45 and this is what I got in the command box.

Compiled with Python version 2.5.
Checking for installed Python... got it!
Traceback (most recent call last):
File "<string>", line 33, in <module>
File "<string>", line 29, in main
File "C:\Program Files\Blender Foundation\Blender245\.blender\scripts\import_s
culptie.py", line 217, in new_sculptie
mesh.addMultiresLevel( multires )
AttributeError: 'Blender Mesh' object has no attribute 'addMultiresLevel'

Funny It had be working earlier and Ihave not changed python or blender.
Domino Marama
Domino Designs
Join date: 22 Sep 2006
Posts: 1,126
04-16-2008 14:40
From: Caylord Theas
Dominio.

I just tried the script to create a sphere with blender 2.45 and this is what I got in the command box.

AttributeError: 'Blender Mesh' object has no attribute 'addMultiresLevel'

Funny It had be working earlier and Ihave not changed python or blender.


Hmmm.. Try the latest version of the scripts as they should degrade and work on 2.45, you won't get multires though. You need one of the later builds for that, either an SVN build (recommended) or one of the rc / test builds of 2.46

You could also work around the error by setting 32 x 32 faces and 0 multires in the options when creating a sphere.
Caylord Theas
Registered User
Join date: 15 Aug 2007
Posts: 24
04-16-2008 14:42
From: Domino Marama
Hmmm.. Try the latest version of the scripts as they should degrade and work on 2.45, you won't get multires though. You need one of the later builds for that, either an SVN build (recommended) or one of the rc / test builds of 2.46

You could also work around the error by setting 32 x 32 faces and 0 multires in the options when creating a sphere.

I have the blender 2.46 release candidate on my machine. Just have not use it very much yes
I will try to put the latest version of you scripts on here in both the 2.45 and 2.46 scripts directories and let you know what happens
Caylord Theas
Registered User
Join date: 15 Aug 2007
Posts: 24
04-16-2008 15:01
worked like a charm in 2.45 off to try it in 2.46RC

Worked like a charm in 2.46RC also. Excuse the silly post.
whyroc Slade
Sculpted and Blended
Join date: 23 Feb 2007
Posts: 315
04-29-2008 05:28
Great work Domino!

To be honest I didn't love the mulitrez method.. but latest technique using modifiers totally rocks!

The thing I didn't realize is the subsurf also subdivides the UV.. even though you can't see it, and the mirroring is really useful too!

-why
_____________________
Sculpt Maps Galore - 100's of full perm sculpt maps. Top quality sculpts - low prices.
http://slurl.com/secondlife/Poecila/50/54/92
Domino Marama
Domino Designs
Join date: 22 Sep 2006
Posts: 1,126
04-30-2008 03:29
From: whyroc Slade
Great work Domino!

To be honest I didn't love the mulitrez method.. but latest technique using modifiers totally rocks!


Thanks whyroc. It's always been my intention to bring as much of Blender's feature set to sculpties as possible. I prefer modifiers too, if I'd realised how easy they were to include I would have added them much sooner :)

Still for organic stuff using sculpt mode in Blender, multires is still the best option. It's nice to have the flexibility of so many different approaches in one package.

I've updated the scripts package again. No new features or bug fixes so it's optional. What it does add is Python 2.3 compatibility to make things easier for Mac users, and it now has some error catching on the UV map to avoid console error messages. You get a friendly popup telling you what is wrong now :)

I don't know of any remaining errors that can happen that will trigger a console error dump. If anyone gets one with these latest scripts, please let me know as I'm now treating those as bugs rather than intended behaviour.

The next stage of the scripts is adding LLSD support for import and export. This is a pretty major job and will take some time. Initially only sculptie prim sets will be supported, but I'll be adding normal prim support too. So the next major upgrade will use Blender's parenting to do link sets and will export all the data to recreate the build in SL :)
Raz Welles
Registered User
Join date: 18 Jun 2007
Posts: 49
05-01-2008 05:51
*sits and drools*

:O~~~~~~~~~~~~~~~~

That. Would. Rock. Out. Hard. :D!!
Viktoria Dovgal
Join date: 29 Jul 2007
Posts: 3,593
05-02-2008 17:26
Has the download link for this changed with the latest version? A couple of different browsers and curl are all getting 0 bytes for the zip file.
_____________________
Domino Marama
Domino Designs
Join date: 22 Sep 2006
Posts: 1,126
05-03-2008 02:26
The latest versions are at

http://dominodesigns.info/downloads/second_life/import_sculptie_svn.zip

It's not changed, though I had missed setting the permissions on the latest upgrade again. It's ok now. Sorry about that.

I'm beginning to think my SFTP software isn't updating the permissions view on overwritten files with how often I miss this :/
Viktoria Dovgal
Join date: 29 Jul 2007
Posts: 3,593
05-03-2008 02:28
And downloads fine now, thank you very much!
_____________________
Domino Marama
Domino Designs
Join date: 22 Sep 2006
Posts: 1,126
05-03-2008 02:37
You were too quick :) I had an unreleased update so I've just uploaded to test whether the perms display was updated, it wasn't so at least I know to refresh the display after uploads. Whether I remember or not is another issue...

The new versions just add session persistance for the settings in the add - mesh - sculpt mesh dialogs.
Domino Marama
Domino Designs
Join date: 22 Sep 2006
Posts: 1,126
05-07-2008 06:38
Another minor update on the import and add sculpt mesh scripts. These use the new preferences in Blender 2.46 under Edit Methods:

Add new objects:
Switch to Edit Mode
Aligned to View

http://dominodesigns.info/downloads/second_life/import_sculptie_svn.zip

The view alignment is done in object mode so sculpties will need the same rotation in SL.

You can apply the rotation in Blender to make the sculptie aligned at zero rotation in SL.
Raz Welles
Registered User
Join date: 18 Jun 2007
Posts: 49
05-07-2008 06:48
People are gonna get sick of me cheering at every new update, but you deserve it :D Thank you!!

This is gonna make editing all that more intuitive x3!!
Domino Marama
Domino Designs
Join date: 22 Sep 2006
Posts: 1,126
05-07-2008 07:14
From: Raz Welles
People are gonna get sick of me cheering at every new update, but you deserve it :D Thank you!!

This is gonna make editing all that more intuitive x3!!


I've updated again.. You can skip the cheering this time if you want :p

I've just added PRIM_ROTATION to the LSL script snippet the baker prints on the console to make it easier to recreate in SL.
Raz Welles
Registered User
Join date: 18 Jun 2007
Posts: 49
05-07-2008 11:01
Hahaha xD the less numbers I have to type in by hand the better ;P thanks!
Catwise Yoshikawa
Registered User
Join date: 15 Aug 2007
Posts: 93
05-13-2008 05:12
Hi!

I'm new to blender and started this week with a friend making some things. My friend is trying to make a door, but has some problem. He has to make a door to be used with a door script. Well he can't enter this forum, so i'm asking for him.
How can he scale the sculpt texture in a different range from 0-1 in any direction? Can he modify something in the script to make that posible?

Thanx and sorry for my english :o
whyroc Slade
Sculpted and Blended
Join date: 23 Feb 2007
Posts: 315
05-13-2008 09:42
From: Domino Marama

Still for organic stuff using sculpt mode in Blender, multires is still the best option. It's nice to have the flexibility of so many different approaches in one package.


I am just now 'getting' the multirez method through my thick skull lol.. from working with more geometric and simple shapes (a flight of stairs for example) I'm realizing how working the lower levels is essential to keeping square edges , angles etc.

-why
_____________________
Sculpt Maps Galore - 100's of full perm sculpt maps. Top quality sculpts - low prices.
http://slurl.com/secondlife/Poecila/50/54/92
Domino Marama
Domino Designs
Join date: 22 Sep 2006
Posts: 1,126
05-13-2008 10:14
From: Catwise Yoshikawa
Hi!

I'm new to blender and started this week with a friend making some things. My friend is trying to make a door, but has some problem. He has to make a door to be used with a door script. Well he can't enter this forum, so i'm asking for him.
How can he scale the sculpt texture in a different range from 0-1 in any direction? Can he modify something in the script to make that posible?

Thanx and sorry for my english :o


/8/7d/254217/1.html#post1957018

For a door I'd recommend a different approach. Select the top and bottom corner vertice for the edge where you want the hinge to be. Then do Shift-S - Cursor to Selection. Go to Object mode and do "Center Cursor". Duplicate the door with Shift-D, then right click to set in same location as original. Go into edit mode, top view and select all vertice. Rotate 180 degrees on Z. Then go to object mode and select both doors and do Render - Bake Second Life sculpties. Save one of the sculptie maps and this should have a perfect hinge for a single prim door in SL rotating around it's centre.
Gaia Clary
mesh weaver
Join date: 30 May 2007
Posts: 884
05-13-2008 16:59
From: Domino Marama

Then go to object mode and select both doors and do Render - Bake Second Life sculpties. Save one of the sculptie maps and this should have a perfect hinge for a single prim door in SL rotating around it's centre.
What exactly is the difference between "backing a set of selected objects" and "baking each object individually" ?

From your explanation i guess, rendering all objects at the same time would bring me the benefit of having all sculpties fit together perfectly on a scale <x,x,x> ? Would that also affect the precision of the individual sculpties) ? Or am i completely wrong with my assumption ?
Gaia Clary
mesh weaver
Join date: 30 May 2007
Posts: 884
05-13-2008 17:19
Hi;

I have two points with the scripts, concerning usability. Well, maybe i have not yet found the correct configuration parameters ;-)

1.) When i save my sculptie map under a different name (with save as...), then rebaking will result in 2 sculptie images: The rebaked image is named, as the script wants it to be, and the initial image is named as i have choosen when i did the "save as"...

It would be great, if the script could just reuse the renamed image for rebaking. I can imagine, that is not possible to program ? And i just have to name the subobjects exactly like i want the sculptie images to be named ?

2.) When i store the images, blender always gives me the blender default user data diretory as starting point. I think, it is better to use the same directory, where the .blend file is created as starting point for the "save" or "save as" dialog. I hope, there is a configuration option for this somewhere in blender?

regards,
Gaia
Domino Marama
Domino Designs
Join date: 22 Sep 2006
Posts: 1,126
05-14-2008 06:54
From: Gaia Clary
What exactly is the difference between "backing a set of selected objects" and "baking each object individually" ?

From your explanation i guess, rendering all objects at the same time would bring me the benefit of having all sculpties fit together perfectly on a scale <x,x,x> ? Would that also affect the precision of the individual sculpties) ? Or am i completely wrong with my assumption ?


The sculpties are calculated to maximise the use of the 0 to 255 colour range by the baker. This is done by taking the minimum and maximum of x, y and z vectors and mapping it to the 0 to 255 range. The minimum and maximum are calculated across all selected sculpties local co-ordinates. So say object A is 0.0 to 5.0 and object B is -4.0 to 2.0, then with A selected only, the range is 0.0 = 0 and 5.0 = 255. With just B it is -4.0 = 0 and 2.0 = 255. With both A and B selected the range is -4.0 = 0 and 5.0 = 255.

In all three examples, there are only the 256 (0 to 255) steps in each colour to give a vertex position. So the vertex snap of sculpties during baking is to a larger grid with muliple sculpties selected. Generally speaking you would bake one sculptie object at a time to get the best grid. However for precision alignments, off centre sculpties, common scale sculpties for animation, etc going for a larger grid to make other things possible is an acceptable trade off.

Object : Vertex grid snap : Steps per object

A only: 0.019607843 : A 256 steps
B only: 0.023529412 : B 256 steps
A & B : 0.035294118 : A 141 steps B 170 steps

From: Gaia Clary
I have two points with the scripts, concerning usability. Well, maybe i have not yet found the correct configuration parameters ;-)

1.) When i save my sculptie map under a different name (with save as...), then rebaking will result in 2 sculptie images: The rebaked image is named, as the script wants it to be, and the initial image is named as i have choosen when i did the "save as"...

It would be great, if the script could just reuse the renamed image for rebaking. I can imagine, that is not possible to program ? And i just have to name the subobjects exactly like i want the sculptie images to be named ?


The first time you bake a sculptie object, the image name is based from the object name. It is then stored in the Logic panel (pacman icon) under LL_SCULPT_IMAGE. You can change the texture name it will bake to by altering the string there. A save and reload clears the extra textures, and I find them useful as autobackups along the way, so I'm not convinced this a problem rather than a feature ;)

With imported sculpties, the LL_SCULPT_IMAGE field is based on the original filename, though using "Save As" wouldn't update the LL_SCULPT_IMAGE field to the new filename.

From: Gaia Clary
2.) When i store the images, blender always gives me the blender default user data diretory as starting point. I think, it is better to use the same directory, where the .blend file is created as starting point for the "save" or "save as" dialog. I hope, there is a configuration option for this somewhere in blender?

regards,
Gaia


Not that I know of. There's a recent directories list in the file selection dialog just under the "P" for parent directory. Click the double triangle icon to bring it up.
Gaia Clary
mesh weaver
Join date: 30 May 2007
Posts: 884
05-15-2008 16:25
From: Domino Marama

In all three examples, there are only the 256 (0 to 255) steps in each colour to give a vertex position. So the vertex snap of sculpties during baking is to a larger grid with muliple sculpties selected. Generally speaking you would bake one sculptie object at a time to get the best grid. However for precision alignments, off centre sculpties, common scale sculpties for animation, etc going for a larger grid to make other things possible is an acceptable trade off.
This explains very well, why a scultie map of a precise shape is typically somewhat distorted and crunchy(?) especially at the edges.

I wonder, if it is possible to get blender to work in a mode, where i can see these distortions beforehand. Currently all i know to do is: export the sculptie-map, reimport it, watch the distortions, tweek the new object a bit, recreate the scultie-map ... over and over and over.

Ideally i would want a grid with exactly 256*256*256 gridpoints, which fits exactly into the bounding-box of the object (and auto-adjusts to any scaling of the object of course). Mesh points would snap to the grid, so i can see already in the modelling phase, where my sculpties will get inprecise and possibly i can find workarounds by slightly reshaping critical parts.

Such a feature would save an incredible amount of time and it would make sculptie creation much less frustrating...
Domino Marama
Domino Designs
Join date: 22 Sep 2006
Posts: 1,126
05-16-2008 00:08
From: Gaia Clary
Ideally i would want a grid with exactly 256*256*256 gridpoints, which fits exactly into the bounding-box of the object (and auto-adjusts to any scaling of the object of course). Mesh points would snap to the grid, so i can see already in the modelling phase, where my sculpties will get inprecise and possibly i can find workarounds by slightly reshaping critical parts.


The closest you will get to this in Blender is by:

Add a sculpt mesh.
Scale to 2.55 x 2.55 x 2.55
Make a copy and hide it
now you can snap to a 0.01 grid and all verts will be aligned.
do any scaling needed in object mode, you'll need to clear it to check grid alignment
when baking unhide the copy and select both objects. This way even if you have moved the outside vertice in a bit, you still bake to the 0.01 = 1 step range.

Not ideal, but that's the only way I know to eliminate rounding errors during the model process.
1 ... 6 7 8 9 10 11 12 13 14 ... 36