Soc project: PyTex -- win (2005/09/04) New Build

User-contributed CVS development builds. Please test and give feedback!

Moderators: jesterKing, stiv

timmeh
Posts: 0
Joined: Wed Jun 29, 2005 5:25 am
Location: Brisbane, Australia

Soc project: PyTex -- win (2005/09/04) New Build

Post by timmeh »

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
Last edited by timmeh on Sat Sep 03, 2005 4:01 pm, edited 2 times in total.

kitsu
Posts: 0
Joined: Sun Jun 06, 2004 8:08 am

Post by kitsu »

Thanks! I almost didn't see this because it's not sticky!

hannibar
Posts: 50
Joined: Wed Oct 16, 2002 3:02 pm

Post by hannibar »

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.

timmeh
Posts: 0
Joined: Wed Jun 29, 2005 5:25 am
Location: Brisbane, Australia

Post by timmeh »

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.
the call should be :

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

hannibar
Posts: 50
Joined: Wed Oct 16, 2002 3:02 pm

Post by hannibar »

That was a typo indeed (in the script it was written correctly). Previewing doesn't work indeed, but when I try to render, it doesn't work either. It always uses the material colour instead of the Pytex colour.

flippyneck
Posts: 0
Joined: Thu Jul 31, 2003 10:34 am
Contact:

Post by flippyneck »

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.

oyster
Posts: 0
Joined: Sat Mar 29, 2003 4:41 pm
Contact:

Post by oyster »

Nice project
One problem, how to stop showing the error msg on the console and return to Blender?

timmeh
Posts: 0
Joined: Wed Jun 29, 2005 5:25 am
Location: Brisbane, Australia

Post by timmeh »

New build, many many bugfixes including render bugs, memory crashes and python errors.

http://www.sutabi.tk/timmeh/data/gsoc/blender.exe

timmeh

lusque
Posts: 11
Joined: Wed Oct 16, 2002 9:53 am

Post by lusque »

Sorry but http://www.sutabi.tk/timmeh/data/gsoc/blender.exe gives me a 404 Not Found.

AVATAR
Posts: 0
Joined: Thu Jan 01, 1970 1:00 am
Location: Norway

Post by AVATAR »

lusque wrote: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.zip

lusque
Posts: 11
Joined: Wed Oct 16, 2002 9:53 am

Post by lusque »

thank you AVATAR :D

EDIT: I just found how simple is to create a PyTexture, wonderful :D :!:
Thank you timmeh, very good work.

A question: is in your project to extend the API?
For instance it would be handy to have a getPytexNormal()

Keep up the good work :D :D :D

hannibar
Posts: 50
Joined: Wed Oct 16, 2002 3:02 pm

Post by hannibar »

The update works much better now. Less crashes, no more debug prints :)

And I found out that the colour works when I also use setPytexAlpha(1) (or another number).

Anyway, great stuff !

zupermonkey
Posts: 0
Joined: Tue Jul 06, 2004 1:13 pm

Post by zupermonkey »

kitsu wrote:Thanks! I almost didn't see this because it's not sticky!
I almost can't see any topic anymore because *everything* is sticky. Argh.

cekuhnen
Posts: 0
Joined: Mon Jan 13, 2003 11:04 pm

Post by cekuhnen »

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)

ysvry
Posts: 0
Joined: Thu Aug 05, 2004 4:28 pm

Post by ysvry »

hi timme , can you place your work were people who dont have axes to the wiki can see it too or give an password and login to that place :)
how can i get acces again otherwise?

Post Reply