Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

The JASS-addon for blender ("domino reloaded")

Domino Marama
Domino Designs
Join date: 22 Sep 2006
Posts: 1,126
05-09-2009 16:23
From: Gaia Clary
Whatever comes out of our on going discussion about multires and subdivision type... It turned out to be easy as making a cake to hide the subdivision-type selectors when they are irrelevant. So at the moment you got me so far that i hide them unless the build type is multires ;-)

And now i am confident that i also can solve the LOD-display.


I'd forgotten about the change to the mesh generation in the RC scripts. It does make sense to offer it as an option. Might as well offer it for subsurf as well so the scripts are consistent with themselves if not my ideals ;)
Gaia Clary
mesh weaver
Join date: 30 May 2007
Posts: 884
05-10-2009 04:52
From: Domino Marama
Eg X Faces 16, Y Faces 4, subdiv 1 would show:

LOD0: 9 x 4
LOD1: 16 x 4
LOD2: 32 x 8
LOD3: 32 x 8

Where can i find a mapping between mapsize and LOD settings ? I thought it was in your readme, but i realised that you only tell which [x,y,level] tuples make sense.
From: domino marama

For All Viewers:

8 x 8 x 2, 16 x 16 x 1, 32 x 32 x 0

Viewer 1.21 and later:

5 x 204 x 0
11 x 23 x 1, 22 x 46 x 0
11 x 93 x 0

https://jira.secondlife.com/browse/VWR-9384 (maint-viewer-11 branch):

4 x 4 x 0
4 x 16 x 0
4 x 16 x 1, 8 x 32 x 0
4 x 16 x 2, 8 x 32 x 1, 16 x 64 x 0
4 x 32 x 0
4 x 64 x 0
4 x 64 x 1, 8 x 128 x 0
4 x 128 x 0
4 x 256 x 0
8 x 8 x 0
8 x 8 x 1, 16 x 16 x 0
8 x 16 x 0
8 x 16 x 1, 16 x 32 x 0
8 x 64 x 0

&fff8 patch (see vwr-9384 discussion for details)

4 x 8 x 0
4 x 8 x 1, 8 x 16 x 0
4 x 8 x 2, 8 x 16 x 1, 16 x 32 x 0


I remember that i have seen something about oblongs and mappings and how that is all calculated in the SL viewer and some debate about what makes sense, what not...

But which of all the variants is now implemented in the "official" viewer ?
Is there any documentation around ? Maybe even an algorithm which i can reimplement in the scripts ? Or is it allready hidden in the rc-scripts somewhere and i just don't see it ?
Gaia Clary
mesh weaver
Join date: 30 May 2007
Posts: 884
05-10-2009 05:00
From: Domino Marama
I'd forgotten about the change to the mesh generation in the RC scripts. It does make sense to offer it as an option. Might as well offer it for subsurf as well so the scripts are consistent with themselves if not my ideals ;)
You probably mean, that it makes sense to offer the selection between the "subdivision-type invariant" algorithm used in the release-scripts and the "subdivision-type sensitive" algorithm in the rc-scripts?
Gaia Clary
mesh weaver
Join date: 30 May 2007
Posts: 884
05-10-2009 07:53
Now i used a script which i found from Domino in another thread ;-)
And this is the current GUi for the sculptie creation popup:



I will clean up things and release that as Jass-1.0 later for broader testing.
Maybe the LOD calculation needs an update, but it should give reasonable
values for most oblong cases.
Domino Marama
Domino Designs
Join date: 22 Sep 2006
Posts: 1,126
05-12-2009 03:40
I've looked at some of the issues raised in this thread.

1) Lemon shape

This is mostly due to the poles not being closed. This is something that can only be properly fixed on a triangulated sculptie. It's on my todo list to add this generation type for both new sculpties and imports (where it is very useful for texturing). A triangulated sculptie would be LOD3 only though. "To Sphere" 100% immediately after adding the sculptie will improve the multires version a bit.

2) Inaccuracy in the baker.

This is due to the way I was handling the 1.0 UV co-ords. I'll be fixing this by converting the 1.0 to ((image_size - 1) / image_size) much earlier in the fill routine. This change makes the scripts so accurate that the minor hole (0.0005 on a 1.0 unit sphere) left on the pole of spheres is too large. I think I'll remove that completely as it's also contributing slightly to problem 1)

With 2) fixed, it becomes possible to detect the sculpt type from the final map, so this code becomes useful then ;)

(quote this post for tab spacing)
def mapType( image ):
poles = True
xseam = True
yseam = True
p1 = image.getPixelI( 0, 0 )[:3]
p2 = image.getPixelI( 0, image.size[1] - 1 )[:3]
if p1 != p2:
yseam = False
for x in xrange( 1, image.size[0] ):
p3 = image.getPixelI( x, 0 )[:3]
p4 = image.getPixelI( x, image.size[1] - 1 )[:3]
if p1 != p3 or p2 != p4:
poles = False
if p3 != p4:
yseam = False
p1 = p3
p2 = p4

for y in xrange( image.size[1] ):
p1 = image.getPixelI( 0, y )[:3]
p2 = image.getPixelI( image.size[0] - 1, y )[:3]
if p1 != p2:
xseam = False
if xseam:
if poles:
return "SPHERE"
if yseam:
return "TORUS"
return "CYLINDER"
return "PLANE"
Gaia Clary
mesh weaver
Join date: 30 May 2007
Posts: 884
05-12-2009 04:06
From: Domino Marama
1) Lemon shape
...
A triangulated sculptie would be LOD3 only though. "To Sphere" 100% immediately after adding the sculptie will improve the multires version a bit.


Have you ever looked at my solution to that problem ?

From: gaia clary

if sculpt_type == SPHERE:
levelCorrection = 1
if profile == 1.0 or profile == 0.0 :
levelCorrection = 0.98**(levels)

...

# later use the level correction on the sphere like this:

...

a = pi + twopi * path
ps = sin( pi * profile ) / 2.0
vert = Blender.Mathutils.Vector(
sin( a ) * ps,
-cos( a ) * ps,
-levelCorrection * cos( pi * profile ) / 2 )

...

The result is an almost perfect sphere with multires or subsurf enabled.
BTW: Can the function "toShpere" be called by script ?

From: domino marama
2) Inaccuracy in the baker.

This is due to the way I was handling the 1.0 UV co-ords. I'll be fixing this by converting the 1.0 to ((image_size - 1) / image_size) much earlier in the fill routine.
If i do understand this correct, then your solution would be equivalent to scaling the uv-map by 0.9999. If i do that scaling before baking, the dark pixels in the baked texture go away. So i tried this in the code and it worked like a charm without destroying the sculptie precision (that needs further checking though):

From: gaia clary

darkPixelCorrectionFactor=0.9999;
for i in range( s ):
p = int(w * i / float(s))
if clean_s:
p = p & level_mask
if p:
p = float(p) / w
#print "uvgrid_s append :",p
uvgrid_s.append( p*darkPixelCorrectionFactor )
#print "uvgrid_s append : 1.0"
uvgrid_s.append( 1.0*darkPixelCorrectionFactor )

for i in range( t ):
p = int(h * i / float(t))
if clean_t:
p = p & level_mask
if p:
p = float(p) / h
#print "uvgrid_t append :",p
uvgrid_t.append( p*darkPixelCorrectionFactor )
#print "uvgrid_t append : 1.0"
uvgrid_t.append( 1.0*darkPixelCorrectionFactor )


Not sure, if i address the same problem as you do, but i see that all my dark pixel problems have gone by now and the top/bottom row dark triangles vanish as soon as i bake textures with subsurf using level 4 or above. So now i could get back to building :D
Domino Marama
Domino Designs
Join date: 22 Sep 2006
Posts: 1,126
05-12-2009 04:25
I've looked at some of the issues raised in this thread.

1) Lemon shape

This is mostly due to the poles not being closed. This is something that can only be properly fixed on a triangulated sculptie. It's on my todo list to add this generation type for both new sculpties and imports (where it is very useful for texturing). A triangulated sculptie would be LOD3 only though. "To Sphere" 100% immediately after adding the sculptie will improve the multires version a bit.

2) Inaccuracy in the baker.

This is due to the way I was handling the 1.0 UV co-ords. I'll be fixing this by converting the 1.0 to ((image_size - 1) / image_size) much earlier in the fill routine. This change makes the scripts so accurate that the minor hole (0.0005 on a 1.0 unit sphere) left on the pole of spheres is too large. I think I'll remove that completely as it's also contributing slightly to problem 1)

With 2) fixed, it becomes possible to detect the sculpt type from the final map, so this code becomes useful then ;)

(quote this post for tab spacing)
def mapType( image ):
poles = True
xseam = True
yseam = True
p1 = image.getPixelI( 0, 0 )[:3]
p2 = image.getPixelI( 0, image.size[1] - 1 )[:3]
if p1 != p2:
yseam = False
for x in xrange( 1, image.size[0] ):
p3 = image.getPixelI( x, 0 )[:3]
p4 = image.getPixelI( x, image.size[1] - 1 )[:3]
if p1 != p3 or p2 != p4:
poles = False
if p3 != p4:
yseam = False
p1 = p3
p2 = p4

for y in xrange( image.size[1] ):
p1 = image.getPixelI( 0, y )[:3]
p2 = image.getPixelI( image.size[0] - 1, y )[:3]
if p1 != p2:
xseam = False
if xseam:
if poles:
return "SPHERE"
if yseam:
return "TORUS"
return "CYLINDER"
return "PLANE"
Gaia Clary
mesh weaver
Join date: 30 May 2007
Posts: 884
Jass-1.0 finally available
05-17-2009 15:39
HI again;

I just released jass-1.0. You can find a teaser video and the download link at:

http://blog.machinimatrix.org/jass/

MANY thanks to Domino who gave me lots of helpfull hints to make Jass-1.0.
Please give it a chance ...

BTW: The video has been created almost entirely by using blender. It is the first time i have done animation with blender and it took me quite a while but i love the results ;-)

This is what Jass provides on top of what the domino-rc-scipts allready provide:

- Completely rewritten GUI
- GUI-parameters now fully persistent
- Individual alpha mask for sculptie protection supported.
- NURBS-mode for advanced users (my nurbs2sculptie script now fully integrated)
- Choice between Catmull-Clark and Simple with Multires-build type
- Library of basic sculpts integrated.
- LOD-calculator shows you the number of meshpoints available per LOD-level

A few minor bugfixes:

- Lemon shape spheres now have improved shape (not perfect, but ok)
- Persistency bug removed (see feature list above)
- workaround for dark pixels during surface texture baking, will become obsolete with blender 2.49 ( our bugreport to blender has been resolved in 2.49-RC3)
Domino Marama
Domino Designs
Join date: 22 Sep 2006
Posts: 1,126
05-21-2009 05:37
http://dominodesigns.info/second_life/blender_scripts_git.html has details on the new git repository for my scripts. I've changed quite a lot since the version you forked from, though still have to test before moving to a rc.
1 2 3