Previous Thread  Next Thread

chat icon Help to the new Python API

AEnema

Posted: Fri Jul 18, 2003 10:23 am
Joined: 18 Jul 2003
Posts: 4
I get a error in my ASE Exporter. In the old Blender version it worked.

objs = Blender.getCurrentScene().objects

Error:
Traceback (most recent call last):
File "ExportASE.py", line 370, in ?
AttributeError: 'module' object has no attribute 'getCurrentScene'

i have no idea to transform this code to the new blender/python api.
Reply with quote


Michel

Posted: Fri Jul 18, 2003 10:55 am
Joined: 16 Oct 2002
Posts: 209
AEnema wrote:
objs = Blender.getCurrentScene().objects

Hi,

the function you're trying to use is from the old blender210 API which is no longer supported. The code below should work:
Code:

import Blender

scene = Blender.Scene.GetCurrent()
objs = scene.GetChildren()


I have not tested this.

If you want to know what modules, functions, methods and variables are available, you can do a:

Code:

import Blender

print dir (Blender)


You can also print the contents of the Blender.Scene module for example. Really helpful.

With regards,
Michel
_________________
You can have one of two things: Progress or Progress Reports.
Reply with quote


AEnema

Posted: Fri Jul 18, 2003 1:59 pm
Joined: 18 Jul 2003
Posts: 4
Thanks for your help.

The interpreter still gets a error when i call:

Code:


scene = Blender.Scene.GetCurrent()

  File "ExportASE.py", line 372, in ?
AttributeError: 'module' object has no attribute 'GetCurrent'



Sad
[/code]
Reply with quote


AEnema

Posted: Fri Jul 18, 2003 2:06 pm
Joined: 18 Jul 2003
Posts: 4
oh im so stupid ;o) have to write get not Get.

Thanks for help
Reply with quote


ideasman

Posted: Fri Jul 18, 2003 2:21 pm
Joined: 25 Feb 2003
Posts: 998
Hello, I am writing an ASE importer, Its works about 90% so far, have a little way to go.

Mabe we could share code?
Reply with quote


AEnema

Posted: Fri Jul 18, 2003 2:38 pm
Joined: 18 Jul 2003
Posts: 4
Oh hi,

sorry but this is not my ASE Exporter, im just trying to convert the old ASE Exporter to the new Blender Version.

Here is the E-Mail Adress from the writer of ASE Export: andrewc@piffle.org

Here you can download the exporter: http://www.piffle.org/3d/ase-export-filter.html
Reply with quote


 
Jump to:  
Powered by phpBB © 2001, 2005 phpBB Group