Importing a obstacle map in python

263
1
12-27-2012 08:02 AM
RobHoward
New Contributor
Hello,

I'm writing a python script to automate some stuff, and one of the things I'd like to automate is setting up an obstacle map.

Importing the obstacle map file is no trouble, but for it to function as an obstacle map, it needs to have the layer attribute
attr obstacle = brightness < 0.5

So after importing the png file and naming it "Obstacle," I'm trying to use the setLayerAttributes command to give this map layer the attribute needed for it to work as an obstacle map, like so:

#set layer attribute for obstacle layer
    obstacle = ce.getObjectsFrom(ce.scene, ce.isLayer, ce.withName("'Obstacle'"))[0]
    ce.setLayerAttributes(obstacle, "attr obstacle = brightness < 0.5")

However, when I run this script, it doesn't seem to assign the layer attribute.

Is this the right way to go about automating obstacle map importing in python?
Tags (3)
0 Kudos
1 Reply
RobHoward
New Contributor
ok, so.... nevermind. Suddenly, and I'm not exactly sure why, it is working just fine. *shrugs*
I'm not terribly certain what I did differently.
0 Kudos