Installing pyawd for AWD for use in Blender

Software: Away3D 4.x

Avatar
sebbdk, Jr. Member
Posted: 24 September 2011 05:07 PM   Total Posts: 39

I am having some trouble with installing the pyawd library for the AWD Blender exporter.

i get and error when running

import pyawd 

also i noticed when doing the installation that pyawd was installed into the python 2.6 folder

sebbdkpython setup.py install
running install
running build
running build_py
running build_ext
running install_lib
running install_egg_info
Removing 
/Library/Python/2.6/site-packages/pyawd-0.1.0-py2.6.egg-info
Writing 
/Library/Python/2.6/site-packages/pyawd-0.1.0-py2.6.egg-info 

However Blender runs python 3.2 so the library is not available for blender

running the command “import pyawd” in python version 2.6 via the console works fine

i tried installing python 3.2 for mac, which install to
/usr/local/bin/
which seems a bit odd compared to where the standard 2.6 is installed to =/

so i am thinking i have to move the library over into my python3 , im just not sure where to, and wether or not Blender will actually use it or the inbuilt python3.2 that comes with blender, so in short where do i move my library/site-package files to? smile

or maybe i need to use a older version of blender?
currently i am running blender 2.57 on Mac OSX version 10.6.8

 

   

Richard Olsson, Administrator
Posted: 24 September 2011 05:49 PM   Total Posts: 1192   [ # 1 ]

When you use the setup.py way of installing python, you are installing it into that python distribution that you are running the setup.py script with. So when you run “python setup.py install”, you are installing it to the default distribution to which the “python” binary belongs, which is usually 2.x.

Blender has it’s own python 3 installation contained within the blender application. To install into blender, build PyAWD using a 3.x python distribution (e.g. “python3 setup.py install”) and then copy the pyawd folder (from a sub-folder of the “build” folder) into your blender installation.

This will all be made easier once I have actually finished the blender exporter (and the file format for that matter.)

   

Avatar
sebbdk, Jr. Member
Posted: 24 September 2011 11:07 PM   Total Posts: 39   [ # 2 ]

ahh should have thought of that ofc’ i have to use python3 and not the normal python command, doh!

i copy’ed it over into the blender python installation and it seems to work, i ran the export script from the blender text editor and got the “blendout.awd” in my hd root directory as expected, now i just gotte test it out in away3D, thanks for all the hard work on the the awd format, cant wait to see just how far you can take it once the format is complete! :D

   

Avatar
rkn14, Newbie
Posted: 25 September 2011 04:25 PM   Total Posts: 13   [ # 3 ]

Hi,
I also try to make this Blender Exporter working, but it’s a bit difficult for me…
On MacOs 10.6, blender 2.57

It would be so cool if you could post a little step by step howto smile

First i tried to build the libawd following this page
http://code.google.com/p/awd/wiki/SDKBuildInstructions

strange, on my system i didn’t have “lib” and “include” folder in my ” /usr/local” ... So i had to create them. But i don’t know if it’s a bad thing or not…

Then the buld process was ok.

After that i tried many “python things”, and i can’t remember all…
From the building of the pyAwd to the way to put it in Blender 2.57.

Thank you if you can help smile

 

 

   

Avatar
rkn14, Newbie
Posted: 25 September 2011 06:36 PM   Total Posts: 13   [ # 4 ]

i have compiled the pyawd lib with python 3.2, and copied the result in “blender path/python/lib/python3.2”

and i tried to copy the plugin file “BlenderAWDExporter.py” in “plugins” folder, or “scripts/add-on”, etc…
no way…

i also tried to do it by going in blender preference, “install Add-on”, not better.

I think i really need some help !

   

Avatar
sebbdk, Jr. Member
Posted: 25 September 2011 08:14 PM   Total Posts: 39   [ # 5 ]

@rkn14
you need to run the script in the blender text editor i believe smile

   

Avatar
rkn14, Newbie
Posted: 25 September 2011 09:17 PM   Total Posts: 13   [ # 6 ]

oh thanks a lot.
It works now, or at least (like you) i have a blendout.awd file exported.

It’s a bit hard, for now, but will be very esteemed !

   

Avatar
rkn14, Newbie
Posted: 25 September 2011 11:30 PM   Total Posts: 13   [ # 7 ]

Did you managed to get something from your blendout.awd ?

Using the Awd2Parser class i get a EOF error
/away3d/loaders/parsers/AWD2Parser.as:253]

   

Avatar
sebbdk, Jr. Member
Posted: 26 September 2011 07:26 AM   Total Posts: 39   [ # 8 ]

no actually that was my next step , the file doesn’t seem to contain anything by the file headers or something, open it up in a text editor and you will see a very short amount of binary data.

I am gonne play around with some traces in the python script when i get home, not that i have ever written one line of python before tho haha, but most likely we’re just using the script wrong

if you figure something out in the meanwhile please do write smile

   

Avatar
rkn14, Newbie
Posted: 26 September 2011 08:51 AM   Total Posts: 13   [ # 9 ]

I read quickly the script, too quickly to find any bug.
I know a little well python but i don’t know the Blender API ans uses.

Richard,
I can help to debug, test, if needed (it’s seems to be needed smile )

   

Avatar
sebbdk, Jr. Member
Posted: 26 September 2011 11:08 PM   Total Posts: 39   [ # 10 ]

okay im now 100% the produces file is just about empty, it dosent open in prefab either =/

also the script fails to find my materials, which are just color materials, or does the script only support bitmap materials?

this is my console output from a blender file containing to cubes with different colored materials, i can supply source if need be

Looking for sequence file in /Users/barathrumm/Desktop/sequences.txt
Looking for sequence file in ./sequences.txt
Creating mesh ClankyCube
Checking materials for ClankyCube
Found texture to create material?
Creating mesh CostumCube
Checking materials for Costumcube
Found texture to create material?
Writing using libawd.
material count: 0
material count: 0

also, from what i gather sequencer.txt is for animation export’s and is not required for simple static model export correct?

here are the files i tested with

created awd file:
http://www.filesonic.com/file/2208089954/blendout.awd
test blend file:
http://www.filesonic.com/file/2208089964/untitled.blend

   

Avatar
sebbdk, Jr. Member
Posted: 26 September 2011 11:43 PM   Total Posts: 39   [ # 11 ]

okay some more discoveries smile

first i found out by looking a bit closer on the script that surface materials only support image materials it appears

It still dosent load in prefab, but i’m gonne try experimenting with loading it in AS3 instead, could be a bug with my AIR flash version or something

well tomorrow that is , now i am gonne get some sleep smile

   

Avatar
sebbdk, Jr. Member
Posted: 27 September 2011 09:59 PM   Total Posts: 39   [ # 12 ]

Made some nice progress the model’s shows up mostly fine in away3D, yay! smile

first of alle here is a LoaderAWD2Test class i wrote

http://pastebin.com/W2dFKzRH

i got everything working, except the relations between the objects, it might be the assetLoader i dont know..  But i have to manually assign the box meshes from blender to my objectContainer3D / “my empty from blender”
and also manually assign the materials to my meshes again

the awd1 example uses the loader3D class, attempts using the same example with the awd2parser gave me the following error tho

Main Thread (SuspendedTypeErrorError #2007: Parameter data must be non-null.) 
 
flash.display3D::VertexBuffer3D/uploadFromVector [no source] 
 away3d
.core.base::SubGeometry/getUVBuffer 
 away3d
.core.base::SubMesh/getUVBuffer 
 away3d
.materials.passes::DefaultScreenPass/render 
 away3d
.materials::MaterialBase/renderPass  
 away3d
.core.render::DefaultRenderer/drawRenderables 
 away3d
.core.render::DefaultRenderer/draw 
 away3d
.core.render::RendererBase/executeRender 
 away3d
.core.render::RendererBase/render 
 away3d
.containers::View3D/render 
 LoaderAWD2Test
/handleEnterFrame 

most likely i need to load the AWD file format different, now i just gotte figure out how, any examples or idea would be highly appreciated :D

On a side note once i have figured this out im gonne write a article about it, i have put in a lot of time into just figuring out this much, and information seems very scattered, not that it is unexpected for a format that it still in development :D

 

   

Avatar
sebbdk, Jr. Member
Posted: 27 September 2011 10:28 PM   Total Posts: 39   [ # 13 ]

okay funny little thing smile

trace(_mesh.parent.name);
  
trace("mat->name:"_mesh.material.name

run from the onAssetComplete function
where _mesh is the mesh im adding in the previous example

it shows correct names

also i quit adding it to the container/blender-empty manually and then just added the empty, boxes got added with it must have been some other bug i had before, i still have to add a new material to the boxes for it to work bug free tho, must be something wrong with my materials in my awd file, i will try and screw around in blender with some other images and doing some more traces of the material thats obviously properly appended with some kind of bug to the mesh

 

   

Alex Bogartz, Sr. Member
Posted: 28 September 2011 01:09 AM   Total Posts: 216   [ # 14 ]

Awesome, please keep it coming!  Can you share your compiled python file?  I’m totally lost on python, but I’d love to play with this and see what I can do with it.

   

Avatar
sebbdk, Jr. Member
Posted: 29 September 2011 12:12 AM   Total Posts: 39   [ # 15 ]

Finally made everything work.

Did some traces and discovered the AWD file did contain correct bitmap data, so i investigated the error i got before and found out that the missing param where referring to a UV variable being passed being Null.

So it basically means i where missing a UV map for my texture, i was exporting from blender without UV mapping the image.
I made a UV map and BAM! it worked smile

i read that some folks are having problems with it not working before having put it through prefab in the OBJ format, they got the same error.
So my guess is they had UV map issues maybe as well?
And then Prefap knowing a UV map is required issued a standard UV map when they exported?

food for thought, but it’s not on my agende to investigate that right now tho smile

here is the error for reference again:

Main Thread (SuspendedTypeErrorError #2007: Parameter data must be non-null.) 
 
flash.display3D::VertexBuffer3D/uploadFromVector [no source] 
 away3d
.core.base::SubGeometry/getUVBuffer 
 away3d
.core.base::SubMesh/getUVBuffer 
 away3d
.materials.passes::DefaultScreenPass/render 
 away3d
.materials::MaterialBase/renderPass  
 away3d
.core.render::DefaultRenderer/drawRenderables 
 away3d
.core.render::DefaultRenderer/draw 
 away3d
.core.render::RendererBase/executeRender 
 away3d
.core.render::RendererBase/render 
 away3d
.containers::View3D/render 
 LoaderAWD2Test
/handleEnterFrame 

@Makai Media
You dont really need to know python, just compile the library according to the guide on the google AWD project page, and then put the library file into your blender installation, just remember to compile with python3

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X