Just getting started :-)

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

Post Reply
midnightcoder
Posts: 0
Joined: Wed Sep 03, 2003 5:10 pm

Just getting started :-)

Post 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

nyoxi
Posts: 0
Joined: Fri Jul 25, 2003 8:14 pm

Post 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"

Michel
Posts: 180
Joined: Wed Oct 16, 2002 7:27 pm
Location: Somewhere below the rivers in Holland (but not Limburg)

Re: Just getting started :-)

Post 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
You can have one of two things: Progress or Progress Reports.

midnightcoder
Posts: 0
Joined: Wed Sep 03, 2003 5:10 pm

Post 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

nyoxi
Posts: 0
Joined: Fri Jul 25, 2003 8:14 pm

Post 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

Post Reply