Skip to content

Commit

Permalink
update for changes in rna api
Browse files Browse the repository at this point in the history
  • Loading branch information
ideasman42 committed Mar 14, 2011
1 parent 741b7ca commit 374c7c2
Show file tree
Hide file tree
Showing 14 changed files with 24 additions and 25 deletions.
4 changes: 2 additions & 2 deletions animation_add_corrective_shape_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def extractX_2(ob, mesh):
def extractMappedX(ob, mesh):
totvert = len(mesh)

mesh = ob.create_mesh( bpy.context.scene, True, 'PREVIEW' )
mesh = ob.to_mesh( bpy.context.scene, True, 'PREVIEW' )

x = []

Expand Down Expand Up @@ -246,7 +246,7 @@ def execute(self, context):
return {'FINISHED'}

def func_object_duplicate_flatten_modifiers(ob, scene):
mesh = ob.create_mesh( bpy.context.scene, True, 'PREVIEW' )
mesh = ob.to_mesh( bpy.context.scene, True, 'PREVIEW' )
name = ob.name + "_clean"
new_object = bpy.data.objects.new( name, mesh)
new_object.data = mesh
Expand Down
6 changes: 3 additions & 3 deletions io_export_directx_x.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,11 +274,11 @@ def WriteObjects(Config, ObjectList):
Object2 = Object.copy()
for Modifier in [Modifier for Modifier in Object2.modifiers if Modifier.type == "ARMATURE"]:
Object2.modifiers.remove(Modifier)
Mesh = Object2.create_mesh(bpy.context.scene, True, "PREVIEW")
Mesh = Object2.to_mesh(bpy.context.scene, True, "PREVIEW")
else:
Mesh = Object.create_mesh(bpy.context.scene, True, "PREVIEW")
Mesh = Object.to_mesh(bpy.context.scene, True, "PREVIEW")
else:
Mesh = Object.create_mesh(bpy.context.scene, False, "PREVIEW")
Mesh = Object.to_mesh(bpy.context.scene, False, "PREVIEW")
if Config.Verbose:
print(" Done")
print(" Writing Mesh...")
Expand Down
4 changes: 2 additions & 2 deletions io_export_pc2.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def do_export(context, props, filepath):
end = props.range_end
sampling = float(props.sampling)
apply_modifiers = props.apply_modifiers
me = ob.create_mesh(sc, apply_modifiers, 'PREVIEW')
me = ob.to_mesh(sc, apply_modifiers, 'PREVIEW')
vertCount = len(me.vertices)
sampletimes = getSampling(start, end, sampling)
sampleCount = len(sampletimes)
Expand All @@ -75,7 +75,7 @@ def do_export(context, props, filepath):

for frame in sampletimes:
sc.frame_set(frame)
me = ob.create_mesh(sc, apply_modifiers, 'PREVIEW')
me = ob.to_mesh(sc, apply_modifiers, 'PREVIEW')

if len(me.vertices) != vertCount:
file.close()
Expand Down
2 changes: 1 addition & 1 deletion io_mesh_ply/export_ply.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def rvec2d(v):
bpy.ops.object.mode_set(mode='OBJECT')

if use_modifiers:
mesh = obj.create_mesh(scene, True, 'PREVIEW')
mesh = obj.to_mesh(scene, True, 'PREVIEW')
else:
mesh = obj.data

Expand Down
2 changes: 1 addition & 1 deletion io_mesh_raw/export_raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def export_raw(filepath, applyMods, triangulate):
matrix = obj.matrix_world

if (applyMods):
me = obj.create_mesh(bpy.context.scene, True, "PREVIEW")
me = obj.to_mesh(bpy.context.scene, True, "PREVIEW")
else:
me = obj.data

Expand Down
3 changes: 1 addition & 2 deletions io_mesh_stl/blender_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ def faces_from_mesh(ob, apply_modifier=False, triangulate=True):

# get the modifiers
try:
mesh = ob.create_mesh(bpy.context.scene,
apply_modifier, "PREVIEW")
mesh = ob.to_mesh(bpy.context.scene, apply_modifier, "PREVIEW")
except RuntimeError:
return ()

Expand Down
2 changes: 1 addition & 1 deletion io_scene_3ds/export_3ds.py
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ def save(operator, context, filepath="",
continue

try:
data = ob_derived.create_mesh(scene, True, 'PREVIEW')
data = ob_derived.to_mesh(scene, True, 'PREVIEW')
except:
data = None

Expand Down
8 changes: 4 additions & 4 deletions io_scene_fbx/export_fbx.py
Original file line number Diff line number Diff line change
Expand Up @@ -1856,7 +1856,7 @@ def write_group(name):

obs = [(ob_base, ob_base.matrix_world)]
if ob_base.dupli_type != 'NONE':
ob_base.create_dupli_list(scene)
ob_base.dupli_list_create(scene)
obs = [(dob.object, dob.matrix) for dob in ob_base.dupli_list]

for ob, mtx in obs:
Expand All @@ -1881,7 +1881,7 @@ def write_group(name):
origData = True
if tmp_ob_type != 'MESH':
try:
me = ob.create_mesh(scene, True, 'PREVIEW')
me = ob.to_mesh(scene, True, 'PREVIEW')
except:
me = None

Expand All @@ -1892,7 +1892,7 @@ def write_group(name):
else:
# Mesh Type!
if EXP_MESH_APPLY_MOD:
me = ob.create_mesh(scene, True, 'PREVIEW')
me = ob.to_mesh(scene, True, 'PREVIEW')

# print ob, me, me.getVertGroupNames()
meshes_to_clear.append(me)
Expand Down Expand Up @@ -1983,7 +1983,7 @@ def write_group(name):

# not forgetting to free dupli_list
if ob_base.dupli_list:
ob_base.free_dupli_list()
ob_base.dupli_list_clear()

if EXP_ARMATURE:
# now we have the meshes, restore the rest arm position
Expand Down
6 changes: 3 additions & 3 deletions io_scene_obj/export_obj.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ def findVertexGroupName(face, vWeightMap):
if ob_main.dupli_type != 'NONE':
# XXX
print('creating dupli_list on', ob_main.name)
ob_main.create_dupli_list(scene)
ob_main.dupli_list_create(scene)

obs = [(dob.object, dob.matrix) for dob in ob_main.dupli_list]

Expand All @@ -380,7 +380,7 @@ def findVertexGroupName(face, vWeightMap):
if ob.type != 'MESH':
continue

me = ob.create_mesh(scene, EXPORT_APPLY_MODIFIERS, 'PREVIEW')
me = ob.to_mesh(scene, EXPORT_APPLY_MODIFIERS, 'PREVIEW')

if EXPORT_ROTX90:
me.transform(mat_xrot90 * ob_mat)
Expand Down Expand Up @@ -674,7 +674,7 @@ def findVertexGroupName(face, vWeightMap):
bpy.data.meshes.remove(me)

if ob_main.dupli_type != 'NONE':
ob_main.free_dupli_list()
ob_main.dupli_list_clear()

file.close()

Expand Down
2 changes: 1 addition & 1 deletion io_scene_x3d/export_x3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ def export(self, scene, world, alltextures,
elif objType in ('MESH', 'CURVE', 'SURF', 'FONT'):
if use_apply_modifiers or objType != 'MESH':
try:
me = ob.create_mesh(scene, use_apply_modifiers, 'PREVIEW')
me = ob.to_mesh(scene, use_apply_modifiers, 'PREVIEW')
except:
me = None
else:
Expand Down
4 changes: 2 additions & 2 deletions io_shape_mdd/export_mdd.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def save(operator, context, filepath="", frame_start=1, frame_end=300, fps=25):

orig_frame = scene.frame_current
scene.frame_set(frame_start)
me = obj.create_mesh(scene, True, 'PREVIEW')
me = obj.to_mesh(scene, True, 'PREVIEW')

#Flip y and z
mat_flip = mathutils.Matrix(((1.0, 0.0, 0.0, 0.0), \
Expand Down Expand Up @@ -108,7 +108,7 @@ def save(operator, context, filepath="", frame_start=1, frame_end=300, fps=25):
"""

scene.frame_set(frame)
me = obj.create_mesh(scene, True, 'PREVIEW')
me = obj.to_mesh(scene, True, 'PREVIEW')
check_vertcount(me, numverts)
me.transform(mat_flip * obj.matrix_world)

Expand Down
2 changes: 1 addition & 1 deletion light_field_tools/light_field_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def arrangeVerts(self):
"""Sorts the vertices as described in the usage part of the doc."""
# get mesh with applied modifer stack
scene = bpy.context.scene
mesh = self.baseObject.create_mesh(scene, True, "PREVIEW")
mesh = self.baseObject.to_mesh(scene, True, "PREVIEW")
verts = []
row_length = scene.lightfield.row_length

Expand Down
2 changes: 1 addition & 1 deletion object_fracture/fracture_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def boolop(ob, cutter, op):
a.modifiers['Boolean'].object = cutter
a.modifiers['Boolean'].operation = op

nmesh = a.create_mesh(sce, apply_modifiers=True, settings='PREVIEW')
nmesh = a.to_mesh(sce, apply_modifiers=True, settings='PREVIEW')

if len(nmesh.vertices) > 0:
a.modifiers.remove(a.modifiers['Boolean'])
Expand Down
2 changes: 1 addition & 1 deletion render_povray/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ def exportMeshs(scene, sel):
continue

try:
me = ob.create_mesh(scene, True, 'RENDER')
me = ob.to_mesh(scene, True, 'RENDER')
except:
# happens when curves cant be made into meshes because of no-data
continue
Expand Down

0 comments on commit 374c7c2

Please sign in to comment.