Page 1 of 1

Just getting started :-)

Posted: Thu Sep 04, 2003 6:15 pm
by midnightcoder
Hi!

I got Blender 228 from CVS to build using the MSVC project files.


I still can't get past Blender.getCurrentScene() in most ( all ) of the scripts I test. Noticing in scene.py there is a 'GetCurrent()', I tried it, but still no luck. I started with Blender.py, but noticing the Blender module, placed that in my Python 2.23 site-packages directory and tried it.

Anyone want to point me towards getting started?

Bruce Williams

Posted: Thu Sep 04, 2003 7:41 pm
by nyoxi
try this :D

Code: Select all

# get selected objects
objs = Object.GetSelected()
# get meshes from selected objects
for obj in objs:
	if( obj.getType() == "Mesh" ):
		print "mesh"
	else:
		print "not mesh"

Re: Just getting started :-)

Posted: Fri Sep 05, 2003 10:48 am
by Michel
midnightcoder wrote:Hi!

I got Blender 228 from CVS to build using the MSVC project files.


I still can't get past Blender.getCurrentScene() in most ( all ) of the scripts I test. Noticing in scene.py there is a 'GetCurrent()', I tried it, but still no luck. I started with Blender.py, but noticing the Blender module, placed that in my Python 2.23 site-packages directory and tried it.

Anyone want to point me towards getting started?

Bruce Williams
Hi,

have you read the API documentation? You can read the documentation here or download it here.
There's no Blender.getCurrentScene() function. This is probably what you want:

Code: Select all

import Blender

sc = Blender.Scene.GetCurrent()
With regards,
Michel

Posted: Sat Sep 06, 2003 4:15 am
by midnightcoder
Thanks

The API seems to have changed from what it was when the code I am working with was done ( It exports Blender to CrystalSpace )

Bruce Williams

Posted: Sat Sep 06, 2003 6:41 pm
by nyoxi
Whops, now I noticed that I wrote something that you don't want :roll:
I thing I have to slow down, because now I'm not sure about things I'm reading :?.
Sorry for that :oops: , I have so much of work that I sometimes don't know what I'm doing