fix for misc py errors + some pep8 edits.

This commit is contained in:
Campbell Barton
2011-09-08 05:42:44 +00:00
parent c61827ed25
commit 7500f4cd48
7 changed files with 16 additions and 14 deletions

View File

@@ -14,7 +14,7 @@ def createTexture(cont):
object = cont.owner object = cont.owner
# get the reference pointer (ID) of the internal texture # get the reference pointer (ID) of the internal texture
ID = texture.materialID(obj, 'IMoriginal.png') ID = texture.materialID(object, 'IMoriginal.png')
# create a texture object # create a texture object
object_texture = texture.Texture(object, ID) object_texture = texture.Texture(object, ID)

View File

@@ -21,7 +21,7 @@ class HelloWorldOperator(bpy.types.Operator):
print("Hello World") print("Hello World")
return {'FINISHED'} return {'FINISHED'}
bpy.utils.register_class(SimpleOperator) bpy.utils.register_class(HelloWorldOperator)
# test call to the newly defined operator # test call to the newly defined operator
bpy.ops.wm.hello_world() bpy.ops.wm.hello_world()

View File

@@ -685,7 +685,6 @@ data_path_update = [
] ]
import bpy
from bpy.types import Operator from bpy.types import Operator

View File

@@ -271,7 +271,8 @@ class BakeAction(Operator):
class ClearUselessActions(Operator): class ClearUselessActions(Operator):
'''Mark actions with no F-Curves for deletion after save+reload of file preserving "action libraries"''' '''Mark actions with no F-Curves for deletion after save+reload of ''' \
'''file preserving "action libraries"'''
bl_idname = "anim.clear_useless_actions" bl_idname = "anim.clear_useless_actions"
bl_label = "Clear Useless Actions" bl_label = "Clear Useless Actions"
bl_options = {'REGISTER', 'UNDO'} bl_options = {'REGISTER', 'UNDO'}
@@ -292,12 +293,14 @@ class ClearUselessActions(Operator):
if ((self.only_unused is False) or if ((self.only_unused is False) or
(action.use_fake_user and action.users == 1)): (action.use_fake_user and action.users == 1)):
# if it has F-Curves, then it's a "action library" (i.e. walk, wave, jump, etc.) # if it has F-Curves, then it's a "action library"
# (i.e. walk, wave, jump, etc.)
# and should be left alone as that's what fake users are for! # and should be left alone as that's what fake users are for!
if not action.fcurves: if not action.fcurves:
# mark action for deletion # mark action for deletion
action.user_clear() action.user_clear()
removed += 1 removed += 1
self.report({'INFO'}, "Removed %d empty and/or fake-user only Actions" % (removed)) self.report({'INFO'}, "Removed %d empty and/or fake-user only Actions"
% removed)
return {'FINISHED'} return {'FINISHED'}

View File

@@ -74,6 +74,7 @@ class DATA_PT_skeleton(ArmatureButtonsPanel, Panel):
if context.scene.render.engine == "BLENDER_GAME": if context.scene.render.engine == "BLENDER_GAME":
layout.row().prop(arm, "vert_deformer", expand=True) layout.row().prop(arm, "vert_deformer", expand=True)
class DATA_PT_display(ArmatureButtonsPanel, Panel): class DATA_PT_display(ArmatureButtonsPanel, Panel):
bl_label = "Display" bl_label = "Display"
@@ -185,7 +186,6 @@ class DATA_PT_pose_library(ArmatureButtonsPanel, Panel):
layout.template_ID(ob, "pose_library", new="poselib.new", unlink="poselib.unlink") layout.template_ID(ob, "pose_library", new="poselib.new", unlink="poselib.unlink")
if poselib: if poselib:
# list of poses in pose library # list of poses in pose library
row = layout.row() row = layout.row()
row.template_list(poselib, "pose_markers", poselib.pose_markers, "active_index", rows=5) row.template_list(poselib, "pose_markers", poselib.pose_markers, "active_index", rows=5)
@@ -207,7 +207,7 @@ class DATA_PT_pose_library(ArmatureButtonsPanel, Panel):
col.operator("poselib.pose_remove", icon='ZOOMOUT', text="").pose = pose_marker_active.name col.operator("poselib.pose_remove", icon='ZOOMOUT', text="").pose = pose_marker_active.name
col.operator("poselib.apply_pose", icon='ZOOM_SELECTED', text="").pose_index = poselib.pose_markers.active_index col.operator("poselib.apply_pose", icon='ZOOM_SELECTED', text="").pose_index = poselib.pose_markers.active_index
col.operator("poselib.action_sanitise", icon='HELP', text="") # XXX: put in menu? col.operator("poselib.action_sanitise", icon='HELP', text="") # XXX: put in menu?
# properties for active marker # properties for active marker
if pose_marker_active is not None: if pose_marker_active is not None: