Last active
December 14, 2015 04:29
-
-
Save PierrickKoch/5028832 to your computer and use it in GitHub Desktop.
Scan the game controllers from all objects in a Blender file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def scan(): | |
| for obj in bpy.data.objects: | |
| for ctrl in obj.game.controllers: | |
| print("# bpy.data.objects['%s'].game.controllers['%s']"%\ | |
| (obj.name, ctrl.name)) | |
| if ctrl.type == 'PYTHON' and ctrl.mode == 'MODULE' and \ | |
| ctrl.module.startswith('calling.'): | |
| # TODO remove it | |
| print("### module: %s"%ctrl.module) | |
| scan() | |
| """ | |
| # bpy.data.objects['head_armature'].game.controllers['Python'] | |
| ### module: calling.actuator_action | |
| # bpy.data.objects['l_arm_armature'].game.controllers['Python'] | |
| ### module: calling.actuator_action | |
| # bpy.data.objects['l_arm_armature'].game.controllers['Or'] | |
| # bpy.data.objects['r_arm_armature'].game.controllers['Python'] | |
| ### module: calling.actuator_action | |
| # bpy.data.objects['r_arm_armature'].game.controllers['Or'] | |
| # bpy.data.objects['torso_armature'].game.controllers['Python'] | |
| ### module: calling.actuator_action | |
| """ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment