Add game property to selected objects.

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

seeeker
Posts: 1
Joined: Fri Jul 13, 2012 6:57 am

Add game property to selected objects.

Postby seeeker » Fri Jul 13, 2012 7:24 am

I would like to add a specific game property to all objects selected.

The only way to add it that I see is to use:

Code: Select all

bpy.ops.object.game_property_new()

which cannot be used in an scenario like:

Code: Select all

for obj in bpy.context.selected_objects
  ...
  obj.game_property_new(...)
  ...


Can anyone throw me a hint? thanks!

Return to “Python”

Who is online

Users browsing this forum: No registered users and 0 guests