Skip to content

Commit

Permalink
Merge pull request UuuNyaa#8 from Vwings/fix/rig_body_radius_lost
Browse files Browse the repository at this point in the history
fix(Rigid Body): Compatible with bmesh.ops.create_uvsphere  in 3.0
  • Loading branch information
UuuNyaa authored Dec 4, 2021
2 parents 4b03827 + 61ce504 commit 04d7bc9
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions mmd_tools/bpyutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,20 @@ def makeSphere(segment=8, ring_count=5, radius=1.0, target_object=None):

mesh = target_object.data
bm = bmesh.new()
bmesh.ops.create_uvsphere(
bm,
u_segments=segment,
v_segments=ring_count,
diameter=radius,
)
if bpy.app.version >= (3, 0, 0):
bmesh.ops.create_uvsphere(
bm,
u_segments=segment,
v_segments=ring_count,
radius=radius,
)
else:
bmesh.ops.create_uvsphere(
bm,
u_segments=segment,
v_segments=ring_count,
diameter=radius,
)
for f in bm.faces:
f.smooth = True
bm.to_mesh(mesh)
Expand Down

0 comments on commit 04d7bc9

Please sign in to comment.