Blender Sculptie Importer - Attached
|
Domino Marama
Domino Designs
Join date: 22 Sep 2006
Posts: 1,126
|
05-23-2008 15:09
From: Domino Marama I've had a look at the blend file for the arch, and I think you are just hitting the angle limit on sculpties. ----->8----- I've a few ideas I want to explore, I'll update you when I find out what works the best. Update: It needed a little extra effort in setting up, but then you only have to edit one side of the lattice to modify the curve. I created an 8 X 32 Y 0 multires cylinder, deleted the left half on y. Using magnet to snap to vertices, I squared off the remaining half. I added two vertex groups, middle and edge and added a lattice and lattice deform modifer, set to work on the "edge" vertex group. I set V to 8 on the lattice, to increase the number of edit points. I then added a mirror deform set to Y This still shows the jaggies to the grid on a baked sculptie, but that's to be expected without specifically aligning vertices to avoid it. There's also something very odd happening with the top row. I'll be investigating this further tomorrow.
|
Gaia Clary
mesh weaver
Join date: 30 May 2007
Posts: 884
|
05-24-2008 00:38
From: Domino Marama I've had a look at the blend file for the arch, and I think you are just hitting the angle limit on sculpties. I've attached a picture to explain, the same lines of vertices (simplified to 2D) are shown at different LOD levels. The dots represent the vertices as read from the sculptie map... I looked into the script code and tried to understand, what really happens. Uh, i feel so blindfolded here, but maybe i found something: I looked particularly at render_sculpty.py:updateSculptieMap() If i understand correctly, the heart of the transformation is here: for f in mesh.faces: .... for t in Blender.Geometry.PolyFill([ f.uv ]): ........ nf = [] ............ for i in t: ................ r, g, b = scale.normalise( f.verts[ i ].co ) ................ nf.append( .................... pixel( ........................ f.uv[ i ][0] * sculptimage.size[0], ........................ f.uv[ i ][1] * sculptimage.size[1], r, g, b ) .................... ) Could you comment, what is happening here? What is f.uv and what is f.verts .co ? And does this imply, that the vertices are NOT directly translated into colors ? That would explain, why my perfect vertex alignment is not transported into the sculptieMap. But then the question is, what kind of alignment can i do in order to keep precision intact ?
I have seen your recent comment on how to sculpt the arch in perfect x-symmetry. That's cool! I will try that out later tonight BTW: Yes, i can create the arch as it is now with normal Prims, but the sculptie is not finished yet and what i intend to do at the end, can't be done with normal prims.
|
Domino Marama
Domino Designs
Join date: 22 Sep 2006
Posts: 1,126
|
05-24-2008 02:05
From: Gaia Clary I looked into the script code and tried to understand, what really happens. Uh, i feel so blindfolded here, but maybe i found something: I looked particularly at render_sculpty.py:updateSculptieMap() If i understand correctly, the heart of the transformation is here:
for f in mesh.faces: .... for t in Blender.Geometry.PolyFill([ f.uv ]): ........ nf = [] ............ for i in t: ................ r, g, b = scale.normalise( f.verts[ i ].co ) ................ nf.append( .................... pixel( ........................ f.uv[ i ][0] * sculptimage.size[0], ........................ f.uv[ i ][1] * sculptimage.size[1], r, g, b ) .................... )
Could you comment, what is happening here? What is f.uv and what is f.verts.co ? f.uv is the face UV co-ordinates, f.verts.co is the mesh co-ordinates. The PolyFill converts the UV faces into triangles, the loop builds nf (new faces) which is a list of triangles on the image to be filled along with their pixel color. So each actual vertex gets a one to one conversion to a pixel and the triangle fill (not shown in this snippet) interpolates between the pixels to complete the faces.
From: Gaia Clary And does this imply, that the vertices are NOT directly translated into colors ?
Nope it means the opposite. Which is why an additional layer of subdivision in effect turns off the interpolation as with 64 faces each pixel has a corresponding vertice.
From: Gaia Clary I have seen your recent comment on how to sculpt the arch in perfect x-symmetry. That's cool! I will try that out later tonight  BTW: Yes, i can create the arch as it is now with normal Prims, but the sculptie is not finished yet and what i intend to do at the end, can't be done with normal prims.
Here's the file I described: http://dominodesigns.info/downloads/second_life/arch_blend.zip
Whether the top row distortion is related to this issue or is something else, I'm not sure.
Though as baking a cylinder sculptie immediately after creation doesn't show any issues, I really think the problem you are chasing is just a limit on working with sculpties and not a script bug. I did a test by generating a similar sculptie in the gimp using gradients and still got jaggies. It's a tough one to get perfect, I think my earlier description on forcing the 2.55 grid with a sizing sphere is likely to be the only approach for the final sculptie and I think even that way will be tough.
|
Domino Marama
Domino Designs
Join date: 22 Sep 2006
Posts: 1,126
|
05-24-2008 08:01
From: Domino Marama But I can see the "Normalize" option being handy for doing megaprim sculpties so I'll add it as I've described unless someone has a better suggestion on how it should work. If anyone did have a suggestion, they were too slow!! I've uploaded a new scripts bundle with the render_sculptie now at version 0.17 with the Normalize feature made optional. http://www.dominodesigns.info/downloads/second_life/import_sculptie_svn.zip
|
Gaia Clary
mesh weaver
Join date: 30 May 2007
Posts: 884
|
05-24-2008 08:42
From: Domino Marama The PolyFill converts the UV faces into triangles, the loop builds nf (new faces) which is a list of triangles on the image to be filled along with their pixel color. So each actual vertex gets a one to one conversion to a pixel and the triangle fill (not shown in this snippet) interpolates between the pixels to complete the faces. Hey, this was the missing link!!!! i debugged the script and eventually noticed, that the jaggyness is introduced in the scale.normalize() method. Eventually i found a solution, which is a bit unexpected, but i verified, that my sculpties are now at maximum precision, i.e. every mesh point in the sculptmap now matches perfectly to the corresponding mesh point in the blender object: r, g, b = scale.normalise( f.verts[ i ].co ) r = round(r * 255)/255; g = round(g * 255)/255; b = round(b * 255)/255; nf.append( .... pixel( .... f.uv[ i ][0] * sculptimage.size[0], .... f.uv[ i ][1] * sculptimage.size[1], r, g, b ) See here for a before/after comparison (I made this pic in SL to verify, that the precision does not get lost. The very same result can be seen directly in blender after reimporting the sculptmaps! http://www.sinemacchiato.com/movies/sinemacchiato/precision-test.pngMaybe you can double-check that my solution is a generic solution and not just a matter of lucky coincidence ? And... A very big thank you for all your hints and explanations so far. I am very happy now 
|
Domino Marama
Domino Designs
Join date: 22 Sep 2006
Posts: 1,126
|
05-24-2008 11:19
From: Gaia Clary Hey, this was the missing link!!!! i debugged the script and eventually noticed, that the jaggyness is introduced in the scale.normalize() method. Eventually i found a solution, which is a bit unexpected, but i verified, that my sculpties are now at maximum precision, i.e. every mesh point in the sculptmap now matches perfectly to the corresponding mesh point in the blender object: r, g, b = scale.normalise( f.verts[ i ].co ) r = round(r * 255)/255; g = round(g * 255)/255; b = round(b * 255)/255; nf.append( .... pixel( .... f.uv[ i ][0] * sculptimage.size[0], .... f.uv[ i ][1] * sculptimage.size[1], r, g, b ) Maybe you can double-check that my solution is a generic solution and not just a matter of lucky coincidence ? And... A very big thank you for all your hints and explanations so far. I am very happy now  I've applied a variation of this to the latest scripts. I can't see there being any adverse effects to it, and I can guess at a couple of reasons why it might improve things. Congrats on being the first person other than me to contribute code to the scripts 
|
Raz Welles
Registered User
Join date: 18 Jun 2007
Posts: 49
|
05-24-2008 16:43
Oh nice! Thanks! This should definitely be a help for seamless sculpts! When do we get a code update :3
|
Gaia Clary
mesh weaver
Join date: 30 May 2007
Posts: 884
|
05-24-2008 18:00
From: Raz Welles When do we get a code update :3 it is allready updated. just grab the newest scripts from domino's website and enjoy 
|
Fenrir Reitveld
Crazy? Don't mind if I do
Join date: 20 Apr 2005
Posts: 459
|
05-28-2008 11:43
Domino, have you considered adding multi-part support?
I use your scripts and Blender to do the actual sculpty translation, despite the fact that I use Lightwave as my main modeler. The reason I don't use the LW plugin is that I still own LW8, and really can't justify upgrading to 9 just yet. (Which is what the plugin requires.)
Anyway, the system works really nice save that I must import each sculpty by hand on a multi-part object. My idea is to modify your scripts to loop through all objects in a Blender scene and perform the sculpty render on each in turn, but I had wondered if you were working on that yourself. I would also like to add positional offsets, and basically re-create Qarl's Maya multi-sculpty system for Blender.
Your scripts have been a lifesaver, as I can easily get geometry in/out of Blender (and by extension of Blender's LWO file export, into Lightwave).
_____________________
---- ---- ----
|
Domino Marama
Domino Designs
Join date: 22 Sep 2006
Posts: 1,126
|
05-28-2008 14:56
From: Fenrir Reitveld Domino, have you considered adding multi-part support? Yes, but I keep changing my mind on the best way to do it  When I do settle on an approach it will be a new export script to LSL, LLSD or my own format. A lot of the recent changes were to expose the API for baking sculpties, and to add a sculptie only multiple export at this point would be pretty simple. I've got bigger plans though. I want to add support for all prim types, I did look at prim.blender as a possibility but I think I'll end up writing my own version. I have done some tests with an auto-builder in Second Life and the big problem is hitting the grey goo fence. So at the moment I'm leaning back towards exporting the LSL to rebuild the objects in Second Life rather than a LLSD notecard. A one shot builder wouldn't have the grey goo problem that dropping new notecards and textures into a main builder has. So it'll probably end up as "Export - Second Life LSL" which would give a folder with LSL scripts, sculpt maps and textures. Upload them all and drop into a prim along with a "build prim", click it and watch as it builds the linkset for you. So yes it is something I'm working on.
|
Raz Welles
Registered User
Join date: 18 Jun 2007
Posts: 49
|
05-28-2008 18:24
I'm seriously waiting with baited breath on that one  It'll be the only other exporter that I know of that can do a direct upload and rebuild to SL  P.S. - Domino, would it be possible you could add support to upload to the beta grid for testing (saving us a lot of L  )? I don't think even the Maya exporter does that  P.S.S. - Do you plan on plugging in SLimageupload, or using something similar to SLimageupload to upload near pixelperfect sculptmaps? (I'm still plugging away at getting one to one matches of vertices between two sculpties, and thanks to your exporter, it's become a loooot easier.) #1 fan, Raz 
|
Kornscope Komachi
Transitional human
Join date: 30 Aug 2006
Posts: 1,041
|
05-28-2008 19:01
From: Domino Marama Yes, but I keep changing my mind on the best way to do it  When I do settle on an approach it will be a new export script to LSL, LLSD or my own format. A lot of the recent changes were to expose the API for baking sculpties, and to add a sculptie only multiple export at this point would be pretty simple. I've got bigger plans though. I want to add support for all prim types, I did look at prim.blender as a possibility but I think I'll end up writing my own version. I have done some tests with an auto-builder in Second Life and the big problem is hitting the grey goo fence. So at the moment I'm leaning back towards exporting the LSL to rebuild the objects in Second Life rather than a LLSD notecard. A one shot builder wouldn't have the grey goo problem that dropping new notecards and textures into a main builder has. So it'll probably end up as "Export - Second Life LSL" which would give a folder with LSL scripts, sculpt maps and textures. Upload them all and drop into a prim along with a "build prim", click it and watch as it builds the linkset for you. So yes it is something I'm working on. >o< Oh man... who would I turn gay for?...Just kidding. I await every update! Please keep up your fabulous work, I just wish I was smart enough to help.
_____________________
SCOPE Homes, Bangu -----------------------------------------------------------------
|
Cheewha Palen
Registered User
Join date: 27 Nov 2007
Posts: 78
|
05-31-2008 18:11
Hello,
First of all thank you for this amazing tool allowing the lil guys to compete on a proffesional level!
I am using Ubuntu linux and as described I dropped the .py files into my blender/scripts folder where I see many other .py files. I go into blender>script window> update but I still do not find the import /export for SL.
Does anyone have an issue here or can plz offer any advice?
Thank you!
|
Fenrir Reitveld
Crazy? Don't mind if I do
Join date: 20 Apr 2005
Posts: 459
|
05-31-2008 21:44
From: Domino Marama Yes, but I keep changing my mind on the best way to do it  That's all pretty cool. And about 30 steps beyond what I was needing for my projects, but it would all great to have!  So all I will do is just hack in something quick, and let it go at that. All I need is a system that will just record the prim type, sizes, positions, and rotations. This could be stored in a simple strided list that is cut and pasted into a script for the build runtime. (With the appropriately named sculpt and bakemap textures in the builder prim.) Initially I didn't see this as much of a problem, but sculpties are like Lays; No-one can use just one! My last creation had 38 individual sculpties and it quickly became unmanageable to render-and-save-then-position each one. If I can build my model entirely inside something like Blender, why shouldn't I have it re-created in SL in the same manner? 
_____________________
---- ---- ----
|
Domino Marama
Domino Designs
Join date: 22 Sep 2006
Posts: 1,126
|
06-01-2008 08:55
From: Cheewha Palen Hello,
First of all thank you for this amazing tool allowing the lil guys to compete on a proffesional level!
I am using Ubuntu linux and as described I dropped the .py files into my blender/scripts folder where I see many other .py files. I go into blender>script window> update but I still do not find the import /export for SL.
Does anyone have an issue here or can plz offer any advice?
Thank you! Hi Cheewha, I develop the scripts under Ubuntu so there shouldn't be any problems. They go into the hidden .blender/scripts folder in your home directory (ctrl h will show hidden folders in Nautilus). You should get 3 new menu options when the scripts are installed: File - Import - Second Life Sculptie Add - Mesh - Sculpt Mesh Render - Bake Second Life Sculpties You should copy just the .py files into the scripts directory directly (ie not in a subfolder). Restarting Blender is another way to get the menus to refresh. If you still have problems let me know which build of Blender you are using.
|
Hirokii Hyun
Registered User
Join date: 12 Apr 2007
Posts: 9
|
06-02-2008 11:32
Okay, I've downloaded the most recent plugin version and the bake sculpty isn't working. This is tested with stuff that DID bake before. (My original version was before you added the modifier stuff.)
Here's the error.
Compiled with Python version 2.5. Checking for installed Python... got it! -------------------------------- Traceback (most recent call last): File "<string>", line 480, in <module> File "<string>", line 451, in main File "<string>", line 330, in updateSculptieMap RuntimeError: couldn't load image data in Blender
Any idea why this isn't working? :/
EDIT: *sigh* the new plugin hates any old sculpt projects I made. Looks like I'll just have to gather up what few sculpt maps I have and import them to work with them. It accepts any new meshes, though.
EDIT: Even when using the old plugins, now this error occurs all the time.
|
Domino Marama
Domino Designs
Join date: 22 Sep 2006
Posts: 1,126
|
06-02-2008 12:21
From: Hirokii Hyun Okay, I've downloaded the most recent plugin version and the bake sculpty isn't working. This is tested with stuff that DID bake before. (My original version was before you added the modifier stuff.) Not sure what would cause that. I could investigate a .blend file to see what's happening. You can get my email address here: https://projects.blender.org/users/domino/It might be worth clearing out the image setting by going to the logic panel (F4 / pacman icon) and deleting the LL_SCULPT_IMAGE property. The bake script will add it back, so if it's a problem with the image data that should sort it.
|
Zen Zeddmore
3dprinter Enthusiast
Join date: 31 Jul 2006
Posts: 604
|
06-02-2008 14:04
From: Hirokii Hyun EDIT: *sigh* the new plugin hates any old sculpt projects I made. Looks like I'll just have to gather up what few sculpt maps I have and import them to work with them. It accepts any new meshes, though.
EDIT: Even when using the old plugins, now this error occurs all the time.
Have you 'organised' recently? Most of my problems seem to stem from blender expecting things to be where IT left them.
_____________________
A kilogram of programmable nanobots can lower the certainty of both death AND taxes.
|
Dana Hickman
Leather & Lace™
Join date: 10 Oct 2006
Posts: 1,515
|
06-06-2008 20:17
I have a certainly noob question about baking sculpt maps on a mirrored object. I've made a left hand sculpt object and can bake and import that fine. But when I mirror the object for the right side, select it, and try to bake that sculpt map I get the first sculpt map again. I'm fairly new to blender, so can anyone tell me what steps I'm missing please? I assuming I'm missing setting or clearing something in the UV window before I save the sculpt map, but for the life of me i cant figure out what. Thanks
|
Domino Marama
Domino Designs
Join date: 22 Sep 2006
Posts: 1,126
|
06-07-2008 01:35
From: Dana Hickman But when I mirror the object for the right side, select it, and try to bake that sculpt map I get the first sculpt map again. I'm fairly new to blender, so can anyone tell me what steps I'm missing please? Sounds like you did the mirror in Object mode. You need to apply the transform for it to affect the sculptie bake. Ctrl A - Scale and Rotation to Obdata Normally you should do the mirror in edit mode by selecting all with A then M X leftClick.
|
Dana Hickman
Leather & Lace™
Join date: 10 Oct 2006
Posts: 1,515
|
06-07-2008 02:35
From: Domino Marama Sounds like you did the mirror in Object mode. You need to apply the transform for it to affect the sculptie bake. Ctrl A - Scale and Rotation to Obdata
That would be exactly what I did.. Thank you very much 
|
Dana Hickman
Leather & Lace™
Join date: 10 Oct 2006
Posts: 1,515
|
06-08-2008 10:41
From: Dana Hickman That would be exactly what I did.. Thank you very much  Ok so applying the transform gets me the proper sculpt map, but now there's a different problem... I didn't notice it at first, but all the sculpt maps made from duplicated meshes are rendering in SL like they were inside out. Transparent on the outside and solid/textured on the inside, instead of the reverse. Normals need flipping before baking maybe? I have no idea how to correct this so I'm dead in the water Any tips would be greatly appreciated.
|
Domino Marama
Domino Designs
Join date: 22 Sep 2006
Posts: 1,126
|
06-08-2008 12:35
From: Dana Hickman I didn't notice it at first, but all the sculpt maps made from duplicated meshes are rendering in SL like they were inside out. Mirror the entire UV map on X. In edit mode, select all vertice with A key, go to UV map and select all there with A, then M X to mirror. Bake the sculptie map again and all should be fine.
|
Dana Hickman
Leather & Lace™
Join date: 10 Oct 2006
Posts: 1,515
|
06-08-2008 14:02
From: Domino Marama ...go to UV map and select all there with A, then M X to mirror. Won't let me.. Selected the mirrored mesh, then to edit mode selected all with A, cursor over to UV map, push A and get "Operation only available for multires level 1". Same thing for UV Menu ->Mirror ->X. The 'link UV select to mesh select' gets the UV map to select, so I went back and tried another mesh mirror with the UV selected that way and no joy.
|
Domino Marama
Domino Designs
Join date: 22 Sep 2006
Posts: 1,126
|
06-08-2008 14:30
From: Dana Hickman Won't let me.. "Operation only available for multires level 1" Select Multires level 1 and try again 
|