Yafray Error

(ec2) #1

Can someone tell me why I’m getting:
Traceback (most recent call last):
File “YFexport.py.001”, line 58, in ?
AttributeError: data

Thanks in advance.

(eeshlo) #2

I guess you’re using my old script? There is a better new one which has a GUI created by tredee:

As for the error, the only thing I can think of is that there is a non-mesh object in the scene (surface/nurb/curve/metaball/text?).
I forgot that, but I think the yable script also forgets to check that, which will also produce the same error.
You have to convert any surface/metaball/etc. to a mesh first (ALT-C) if you want to export these.

(eeshlo) #3

Of course a script is not really meant to be ‘read’. And for the average user it probably would be better if the script itself was never visible. Some people seem to be convinced you need to be a programmer before you can use any of this. Of course, scripts can be far from perfect, which tend to require workarounds, and the yable script is still very new…

Anyway, the Yable page itself tells you how to proceed, I think there is enough information there to start.
The only thing that you need to change is the name of the directory where you want to export your scenes to, this doesn’t have to exist, it will create one if needed. Then run (ALT-P).
The GUI is based on blenderman and works similarly, you have to assign shaders and light parameters yourself, this is not done automatically using the blender materials, so in that respect it might not be the best script for beginners.
You select the object in blender and then select either the ‘Material settings’ or the ‘Light settings’ button depending on if you want to change light or materials. Then press the ‘Get Selected’ button, which will show you another set of buttons where you can change things like colours, refraction index,etc. for shaders, or light types and such for lights (except for the hemilight which is available in the ‘global settings’).
Of course this requires that you know a bit about the parameters to make best use of this, and at this moment there is not much documentation yet for yafray.
After doing all that, go back to ‘Global settings’, and set the render resolution, type a name for your scene in the ‘Filename:’ and ‘Image:’ buttons, set the sample depth (which controls anti-aliasing). Also don’t forget to convert any non-mesh objects, otherwise you get the same error as before, in case you use windows, make sure to select the ‘!INC’ button, otherwise the current yafray windows version will crash, and then ‘Export’.
Then finally, you will have to manually start yafray using the .xml filename as an argument to it.
I suppose all of this might sound hopelessly complicated to some people, but you have to remember that both yafray and the yable script are still very young, and there is a long way to go yet…
I hope this helps a bit, for further info, see the yable page:

edit: I see you removed the post which was the reason I typed all this in, oh well, hope it is useful to somebody…

(ec2) #4

Sorry fot the delete. I only did it becasue I thought I should really re-read the yable page in case i misread something. What you have typed will also be a big help.

I still got an error though:
AttributeError: data
Blender Version 223
c:\yafray\images already exists
c:\yafray\images\Archive already exists
c:\yafray\images\povtest already exists
c:\yafray\images\povtest\Materials already exists
c:\yafray\images\povtest\Meshes already exists
No Assigned Shaders for: CurveCircle
No Assigned Shaders for: Plane.001
No Assigned Shaders for: Plane
Clicked Export
<Getting List of Meshes>

Traceback (most recent call last):
File “c:\python22\lib\yable-beta05.py”, line 669, in bevent
File “c:\python22\lib\yable-beta05.py”, line 813, in export
File “c:\python22\lib\yable-beta05.py”, line 2163, in exporttoyafray
dt = i.data

(eeshlo) #5

I have said twice that you would get an error if you have non-mesh objects in your scene without converting them first, but this:

No Assigned Shaders for: CurveCircle

unless you named something CurveCircle, assuming it is the blender default for a nurbs circle, will produce exactly that error. So convert it first to a mesh (ALT-C key), then export, do this for any other non-mesh objects as well.
I have notified Andrea of this with the solution to it, so this might be solved in a future version of the script.

(ec2) #6

I didn’t mean to annoy you with questions. I wasn’t ignoring what you said about curves, but I found one I’d hidden away earlier on layer 8!

You will be glad to know that this morning I was able to get the script to work for me. I exported a simple scene, and later a scene with a few more objects. I’m excited about the possibilities.

I have been playing with povanim, and figured some of it out, and decided to try Yafray.

As for shaders I’ve found general tutorials that will help me build good ones. I’ll be sure to post images soon.

Thanks eeshlo for your help.

(eeshlo) #7

No no, you don’t annoy me with any questions, I suppose it sounded a bit like that, but that was not my intention at all, my apologies!
Anyway, the script is being improved right now, so this particular error will not occur anymore in the next version.