Soc project: PyTex -- win (2005/09/04) New Build
Moderators: jesterKing, stiv
Soc project: PyTex -- win (2005/09/04) New Build
Well I though people might like to have a play with this, it's far from perfect, but it works, and rarely crashes. I've written up a API Doc/Walkthru which can be found here http://wiki.blender.org/bin/view.pl/Ble ... /PyTexture
I'm aware there is a memory issue still (freeing a null pointer), oh and there is still some debugging output to the console.
File http://www.sutabi.tk/timmeh/data/gsoc/B ... _Pytex.zip
timmeh
I'm aware there is a memory issue still (freeing a null pointer), oh and there is still some debugging output to the console.
File http://www.sutabi.tk/timmeh/data/gsoc/B ... _Pytex.zip
timmeh
Last edited by timmeh on Sat Sep 03, 2005 4:01 pm, edited 2 times in total.
the call should be :hannibar wrote:Is it possible that the colour doesn't work ? I copied your first example (coloured clouds) from your wiki page. Nor and intensity seem to work, but the others don't. When I try this in the script :
tex.setPytexCoulour(0.6, 0.3, 0.2)
nothing changes.
tex.setPytexColour( 0.6, 0.3, 0.2 )
though i suspect that may just be a typo, as I mentioned in the doc, colour does not update correctly in the texture preview window, so at this time you must render to see the effect.
timmeh
-
- Posts: 0
- Joined: Thu Jul 31, 2003 10:34 am
- Contact:
Very nice indeed. So much less daunting than the C plugin interface.
Couple of points:
- Seems I have to map the texture to the col channel AND the alpha channel to see the effect of the colour function in the preview or the render. Map to col channel only and it doesn't work.
- What's the effect of the intensity function compared with the colour function?
Once again, nice work. Thank you.
Couple of points:
- Seems I have to map the texture to the col channel AND the alpha channel to see the effect of the colour function in the preview or the render. Map to col channel only and it doesn't work.
- What's the effect of the intensity function compared with the colour function?
Once again, nice work. Thank you.
New build, many many bugfixes including render bugs, memory crashes and python errors.
http://www.sutabi.tk/timmeh/data/gsoc/blender.exe
timmeh
http://www.sutabi.tk/timmeh/data/gsoc/blender.exe
timmeh
Sorry but http://www.sutabi.tk/timmeh/data/gsoc/blender.exe gives me a 404 Not Found.
I think it should be http://www.sutabi.tk/timmeh/data/gsoc/blender.ziplusque wrote:Sorry but http://www.sutabi.tk/timmeh/data/gsoc/blender.exe gives me a 404 Not Found.
-
- Posts: 0
- Joined: Tue Jul 06, 2004 1:13 pm
hi
i get an error in line 30 when i use the marble script fomr the wiki page
"tex_obj = Blender.Texture.GetCurrentPytex()"
it says it cannot get the object py texture.
claas
import Blender
import math
def sin_bias (a):
return 0.5 + 0.5 * math.sin(a)
def saw_bias (a):
b = 2 * math.pi
n = int(a/b)
a -= n * b
if a < 0:
a += b
return a / b
def tri_bias (a):
b = 2 * math.pi
a = 1 - 2 * abs(math.floor((a * (1/b))+0.5) - (a*(1/b)))
return a;
def soft (a):
return a
def sharp (a):
return a**0.5
def sharper (a):
return sharp(sharp(a))
pytex_name = "Marble"
tex_obj = Blender.Texture.GetCurrentPytex()
coords = tex_obj.getPytexCoords()
opt_nbasis = 1
opt_wf = sin_bias
opt_turb = 10
opt_ns = 0.25
opt_nd = 5
opt_def = soft
n = (coords[0] + coords[1] + coords[2]) * 5
m = n + opt_turb * Blender.Noise.turbulence(coords, opt_nd, opt_nbasis)
m = opt_wf(m)
m = opt_def(m)
tex_obj.setPytexIntensity(m)
i get an error in line 30 when i use the marble script fomr the wiki page
"tex_obj = Blender.Texture.GetCurrentPytex()"
it says it cannot get the object py texture.
claas
import Blender
import math
def sin_bias (a):
return 0.5 + 0.5 * math.sin(a)
def saw_bias (a):
b = 2 * math.pi
n = int(a/b)
a -= n * b
if a < 0:
a += b
return a / b
def tri_bias (a):
b = 2 * math.pi
a = 1 - 2 * abs(math.floor((a * (1/b))+0.5) - (a*(1/b)))
return a;
def soft (a):
return a
def sharp (a):
return a**0.5
def sharper (a):
return sharp(sharp(a))
pytex_name = "Marble"
tex_obj = Blender.Texture.GetCurrentPytex()
coords = tex_obj.getPytexCoords()
opt_nbasis = 1
opt_wf = sin_bias
opt_turb = 10
opt_ns = 0.25
opt_nd = 5
opt_def = soft
n = (coords[0] + coords[1] + coords[2]) * 5
m = n + opt_turb * Blender.Noise.turbulence(coords, opt_nd, opt_nbasis)
m = opt_wf(m)
m = opt_def(m)
tex_obj.setPytexIntensity(m)