add NDEBUG to scons release flags + some pep8 cleanup for examples.

This commit is contained in:
Campbell Barton
2011-02-25 16:19:50 +00:00
parent b25db7c8cb
commit bc15e0e295
20 changed files with 34 additions and 33 deletions

View File

@@ -27,4 +27,4 @@ bpy.ops.mesh.subdivide(number_cuts=3, smoothness=0.5)
# check poll() to avoid exception.
if bpy.ops.object.mode_set.poll():
bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.object.mode_set(mode='EDIT')

View File

@@ -8,6 +8,7 @@ Custom properties can be added to any subclass of an :class:`ID`,
import bpy
# Assign a collection
class SceneSettingItem(bpy.types.PropertyGroup):
name = bpy.props.StringProperty(name="Test Prop", default="Unknown")
@@ -30,4 +31,4 @@ my_item.name = "Eggs"
my_item.value = 30
for my_item in bpy.context.scene.my_settings:
print(my_item.name, my_item.value)
print(my_item.name, my_item.value)

View File

@@ -12,7 +12,7 @@ class SubMenu(bpy.types.Menu):
def draw(self, context):
layout = self.layout
layout.operator("object.select_all", text="Select/Deselect All")
layout.operator("object.select_inverse", text="Inverse")
layout.operator("object.select_random", text="Random")

View File

@@ -10,6 +10,7 @@ The function menu_draw acts like Menu.draw
"""
import bpy
def menu_draw(self, context):
self.layout.operator("wm.save_homefile")

View File

@@ -20,7 +20,7 @@ class BasicMenu(bpy.types.Menu):
def draw(self, context):
layout = self.layout
layout.operator("object.select_all", text="Select/Deselect All")
layout.operator("object.select_inverse", text="Inverse")
layout.operator("object.select_random", text="Random")

View File

@@ -25,7 +25,7 @@ class ModalOperator(bpy.types.Operator):
def __init__(self):
print("Start")
def __del__(self):
print("End")
@@ -33,7 +33,7 @@ class ModalOperator(bpy.types.Operator):
context.object.location.x = self.value / 100.0
def modal(self, context, event):
if event.type == 'MOUSEMOVE': # Apply
if event.type == 'MOUSEMOVE': # Apply
self.value = event.mouse_x
self.execute(context)
elif event.type == 'LEFTMOUSE': # Confirm
@@ -51,7 +51,6 @@ class ModalOperator(bpy.types.Operator):
return {'RUNNING_MODAL'}
bpy.utils.register_class(ModalOperator)
# test call

View File

@@ -23,7 +23,6 @@ class ObjectSelectPanel(bpy.types.Panel):
layout = self.layout
obj = context.object
layout.prop(obj, "select", text="")
def draw(self, context):
layout = self.layout

View File

@@ -6,6 +6,7 @@ A mix-in parent class can be used to share common properties and
"""
import bpy
class View3DPanel():
bl_space_type = 'VIEW_3D'
bl_region_type = 'TOOLS'

View File

@@ -782,7 +782,7 @@ def pyrna2sphinx(BASEPATH):
for op in ops.values():
op_modules.setdefault(op.module_name, []).append(op)
del op
for op_module_name, ops_mod in op_modules.items():
filepath = os.path.join(BASEPATH, "bpy.ops.%s.rst" % op_module_name)
file = open(filepath, "w")