Merged changes in the trunk up to revision 51448.
Conflicts resolved: source/blender/blenkernel/CMakeLists.txt source/blender/blenloader/intern/readfile.c source/blender/editors/mesh/editmesh_tools.c source/blender/makesrna/intern/rna_main_api.c
This commit is contained in:
@@ -49,9 +49,9 @@ def add_torus(major_rad, minor_rad, major_seg, minor_seg):
|
||||
angle = 2 * pi * minor_index / minor_seg
|
||||
|
||||
vec = quat * Vector((major_rad + (cos(angle) * minor_rad),
|
||||
0.0,
|
||||
(sin(angle) * minor_rad),
|
||||
))
|
||||
0.0,
|
||||
(sin(angle) * minor_rad),
|
||||
))
|
||||
|
||||
verts.extend(vec[:])
|
||||
|
||||
@@ -133,13 +133,15 @@ class AddTorus(Operator, object_utils.AddObjectHelper):
|
||||
)
|
||||
|
||||
def execute(self, context):
|
||||
if self.use_abso == True:
|
||||
grid_scale = object_utils.object_add_grid_scale(context)
|
||||
|
||||
if self.use_abso is True:
|
||||
extra_helper = (self.abso_major_rad - self.abso_minor_rad) * 0.5
|
||||
self.major_radius = self.abso_minor_rad + extra_helper
|
||||
self.minor_radius = extra_helper
|
||||
|
||||
verts_loc, faces = add_torus(self.major_radius,
|
||||
self.minor_radius,
|
||||
verts_loc, faces = add_torus(self.major_radius * grid_scale,
|
||||
self.minor_radius * grid_scale,
|
||||
self.major_segments,
|
||||
self.minor_segments)
|
||||
|
||||
|
||||
@@ -214,7 +214,7 @@ class BakeAction(Operator):
|
||||
'OBJECT' in self.bake_types,
|
||||
self.clear_constraints,
|
||||
True,
|
||||
)
|
||||
)
|
||||
|
||||
if action is None:
|
||||
self.report({'INFO'}, "Nothing to bake")
|
||||
@@ -252,8 +252,8 @@ class ClearUselessActions(Operator):
|
||||
|
||||
for action in bpy.data.actions:
|
||||
# if only user is "fake" user...
|
||||
if ((self.only_unused is False) or
|
||||
(action.use_fake_user and action.users == 1)):
|
||||
if ((self.only_unused is False) or
|
||||
(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.)
|
||||
|
||||
@@ -57,7 +57,7 @@ def CLIP_set_viewport_background(context, all_screens, clip, clip_user):
|
||||
space_v3d.show_background_images = True
|
||||
|
||||
CLIP_spaces_walk(context, all_screens, 'VIEW_3D', 'VIEW_3D',
|
||||
set_background, clip, clip_user)
|
||||
set_background, clip, clip_user)
|
||||
|
||||
|
||||
def CLIP_camera_for_clip(context, clip):
|
||||
@@ -329,7 +329,7 @@ object's movement caused by this constraint"""
|
||||
|
||||
if not con:
|
||||
self.report({'ERROR'},
|
||||
"Motion Tracking constraint to be converted not found")
|
||||
"Motion Tracking constraint to be converted not found")
|
||||
|
||||
return {'CANCELLED'}
|
||||
|
||||
@@ -341,7 +341,7 @@ object's movement caused by this constraint"""
|
||||
|
||||
if not clip:
|
||||
self.report({'ERROR'},
|
||||
"Movie clip to use tracking data from isn't set")
|
||||
"Movie clip to use tracking data from isn't set")
|
||||
|
||||
return {'CANCELLED'}
|
||||
|
||||
@@ -461,9 +461,9 @@ class CLIP_OT_setup_tracking_scene(Operator):
|
||||
scene.camera = camob
|
||||
|
||||
camob.matrix_local = (Matrix.Translation((7.481, -6.508, 5.344)) *
|
||||
Matrix.Rotation(0.815, 4, 'Z') *
|
||||
Matrix.Rotation(0.011, 4, 'Y') *
|
||||
Matrix.Rotation(1.109, 4, 'X'))
|
||||
Matrix.Rotation(0.815, 4, 'Z') *
|
||||
Matrix.Rotation(0.011, 4, 'Y') *
|
||||
Matrix.Rotation(1.109, 4, 'X'))
|
||||
|
||||
return camob
|
||||
|
||||
@@ -629,7 +629,7 @@ class CLIP_OT_setup_tracking_scene(Operator):
|
||||
|
||||
if need_stabilization:
|
||||
tree.links.new(distortion.outputs["Image"],
|
||||
stabilize.inputs["Image"])
|
||||
stabilize.inputs["Image"])
|
||||
tree.links.new(stabilize.outputs["Image"], scale.inputs["Image"])
|
||||
else:
|
||||
tree.links.new(distortion.outputs["Image"], scale.inputs["Image"])
|
||||
|
||||
@@ -129,6 +129,6 @@ class ConsoleLanguage(Operator):
|
||||
|
||||
# insert a new blank line
|
||||
bpy.ops.console.history_append(text="", current_character=0,
|
||||
remove_duplicates=True)
|
||||
remove_duplicates=True)
|
||||
|
||||
return {'FINISHED'}
|
||||
|
||||
@@ -92,7 +92,7 @@ class MeshMirrorUV(Operator):
|
||||
puvs[i] = tuple(uv.uv for uv in uv_loops[lstart:lend])
|
||||
puvs_cpy[i] = tuple(uv.copy() for uv in puvs[i])
|
||||
puvsel[i] = (False not in
|
||||
(uv.select for uv in uv_loops[lstart:lend]))
|
||||
(uv.select for uv in uv_loops[lstart:lend]))
|
||||
# Vert idx of the poly.
|
||||
vidxs[i] = tuple(l.vertex_index for l in loops[lstart:lend])
|
||||
# As we have no poly.center yet...
|
||||
|
||||
@@ -408,13 +408,13 @@ class ShapeTransfer(Operator):
|
||||
n2loc_to = v2_to + target_normals[i2] * edlen_to
|
||||
|
||||
pt = barycentric_transform(orig_shape_coords[i1],
|
||||
v2, v1, n1loc,
|
||||
v2_to, v1_to, n1loc_to)
|
||||
v2, v1, n1loc,
|
||||
v2_to, v1_to, n1loc_to)
|
||||
median_coords[i1].append(pt)
|
||||
|
||||
pt = barycentric_transform(orig_shape_coords[i2],
|
||||
v1, v2, n2loc,
|
||||
v1_to, v2_to, n2loc_to)
|
||||
v1, v2, n2loc,
|
||||
v1_to, v2_to, n2loc_to)
|
||||
median_coords[i2].append(pt)
|
||||
|
||||
# apply the offsets to the new shape
|
||||
@@ -507,7 +507,7 @@ class JoinUVs(Operator):
|
||||
if obj_other != obj and obj_other.type == 'MESH':
|
||||
mesh_other = obj_other.data
|
||||
if mesh_other != mesh:
|
||||
if mesh_other.tag == False:
|
||||
if mesh_other.tag is False:
|
||||
mesh_other.tag = True
|
||||
|
||||
if len(mesh_other.loops) != nbr_loops:
|
||||
@@ -520,7 +520,7 @@ class JoinUVs(Operator):
|
||||
len(mesh_other.polygons),
|
||||
nbr_loops,
|
||||
),
|
||||
)
|
||||
)
|
||||
else:
|
||||
uv_other = mesh_other.uv_layers.active
|
||||
if not uv_other:
|
||||
|
||||
@@ -299,7 +299,6 @@ class QuickSmoke(Operator):
|
||||
style = EnumProperty(
|
||||
name="Smoke Style",
|
||||
items=(('STREAM', "Stream", ""),
|
||||
('PUFF', "Puff", ""),
|
||||
('FIRE', "Fire", ""),
|
||||
),
|
||||
default='STREAM',
|
||||
@@ -328,20 +327,9 @@ class QuickSmoke(Operator):
|
||||
bpy.ops.object.modifier_add(fake_context, type='SMOKE')
|
||||
obj.modifiers[-1].smoke_type = 'FLOW'
|
||||
|
||||
psys = obj.particle_systems[-1]
|
||||
if self.style == 'PUFF':
|
||||
psys.settings.frame_end = psys.settings.frame_start
|
||||
psys.settings.emit_from = 'VOLUME'
|
||||
psys.settings.distribution = 'RAND'
|
||||
elif self.style == 'FIRE':
|
||||
psys.settings.effector_weights.gravity = -1
|
||||
psys.settings.lifetime = 5
|
||||
psys.settings.count = 100000
|
||||
if self.style == 'FIRE':
|
||||
obj.modifiers[-1].flow_settings.smoke_flow_type = 'FIRE'
|
||||
|
||||
obj.modifiers[-2].flow_settings.initial_velocity = True
|
||||
obj.modifiers[-2].flow_settings.temperature = 2
|
||||
|
||||
psys.settings.use_render_emitter = self.show_flows
|
||||
if not self.show_flows:
|
||||
obj.draw_type = 'WIRE'
|
||||
|
||||
@@ -361,8 +349,6 @@ class QuickSmoke(Operator):
|
||||
bpy.ops.object.modifier_add(type='SMOKE')
|
||||
obj.modifiers[-1].smoke_type = 'DOMAIN'
|
||||
if self.style == 'FIRE':
|
||||
obj.modifiers[-1].domain_settings.use_dissolve_smoke = True
|
||||
obj.modifiers[-1].domain_settings.dissolve_speed = 20
|
||||
obj.modifiers[-1].domain_settings.use_high_resolution = True
|
||||
|
||||
# create a volume material with a voxel data texture for the domain
|
||||
@@ -373,6 +359,7 @@ class QuickSmoke(Operator):
|
||||
mat.type = 'VOLUME'
|
||||
mat.volume.density = 0
|
||||
mat.volume.density_scale = 5
|
||||
mat.volume.step_size = 0.1
|
||||
|
||||
tex = bpy.data.textures.new("Smoke Density", 'VOXEL_DATA')
|
||||
tex.voxel_data.domain_object = obj
|
||||
@@ -381,29 +368,35 @@ class QuickSmoke(Operator):
|
||||
tex_slot.texture = tex
|
||||
tex_slot.use_map_color_emission = False
|
||||
tex_slot.use_map_density = True
|
||||
tex_slot.use_map_color_reflection = True
|
||||
|
||||
# for fire add a second texture for emission and emission color
|
||||
if self.style == 'FIRE':
|
||||
mat.volume.emission = 5
|
||||
tex = bpy.data.textures.new("Smoke Heat", 'VOXEL_DATA')
|
||||
tex.voxel_data.domain_object = obj
|
||||
tex.use_color_ramp = True
|
||||
# for fire add a second texture for flame emission
|
||||
mat.volume.emission_color = Vector((0.0, 0.0, 0.0))
|
||||
tex = bpy.data.textures.new("Flame", 'VOXEL_DATA')
|
||||
tex.voxel_data.domain_object = obj
|
||||
tex.voxel_data.smoke_data_type = 'SMOKEFLAME'
|
||||
tex.use_color_ramp = True
|
||||
|
||||
tex_slot = mat.texture_slots.add()
|
||||
tex_slot.texture = tex
|
||||
tex_slot = mat.texture_slots.add()
|
||||
tex_slot.texture = tex
|
||||
|
||||
ramp = tex.color_ramp
|
||||
# add color ramp for flame color
|
||||
ramp = tex.color_ramp
|
||||
# dark orange
|
||||
elem = ramp.elements.new(0.333)
|
||||
elem.color[0] = 0.2
|
||||
elem.color[1] = 0.03
|
||||
elem.color[2] = 0
|
||||
elem.color[3] = 1
|
||||
# yellow glow
|
||||
elem = ramp.elements.new(0.666)
|
||||
elem.color[0] = elem.color[3] = 1
|
||||
elem.color[1] = 0.65
|
||||
elem.color[2] = 0.25
|
||||
|
||||
elem = ramp.elements.new(0.333)
|
||||
elem.color[0] = elem.color[3] = 1
|
||||
elem.color[1] = elem.color[2] = 0
|
||||
|
||||
elem = ramp.elements.new(0.666)
|
||||
elem.color[0] = elem.color[1] = elem.color[3] = 1
|
||||
elem.color[2] = 0
|
||||
|
||||
mat.texture_slots[1].use_map_emission = True
|
||||
mat.texture_slots[1].blend_type = 'MULTIPLY'
|
||||
mat.texture_slots[1].use_map_density = True
|
||||
mat.texture_slots[1].use_map_emission = True
|
||||
mat.texture_slots[1].emission_factor = 5
|
||||
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
@@ -436,19 +436,19 @@ class AddPresetTrackingSettings(AddPresetBase, Operator):
|
||||
]
|
||||
|
||||
preset_values = [
|
||||
"default_correlation_min",
|
||||
"default_pattern_size",
|
||||
"default_search_size",
|
||||
"default_frames_limit",
|
||||
"default_pattern_match",
|
||||
"default_margin",
|
||||
"default_motion_model",
|
||||
"use_default_brute",
|
||||
"use_default_normalization",
|
||||
"use_default_mask",
|
||||
"use_default_red_channel",
|
||||
"use_default_green_channel",
|
||||
"use_default_blue_channel"
|
||||
"settings.default_correlation_min",
|
||||
"settings.default_pattern_size",
|
||||
"settings.default_search_size",
|
||||
"settings.default_frames_limit",
|
||||
"settings.default_pattern_match",
|
||||
"settings.default_margin",
|
||||
"settings.default_motion_model",
|
||||
"settings.use_default_brute",
|
||||
"settings.use_default_normalization",
|
||||
"settings.use_default_mask",
|
||||
"settings.use_default_red_channel",
|
||||
"settings.use_default_green_channel",
|
||||
"settings.use_default_blue_channel"
|
||||
]
|
||||
|
||||
preset_subdir = "tracking_settings"
|
||||
|
||||
@@ -89,7 +89,7 @@ class PlayRenderedAnim(Operator):
|
||||
if player_path == "":
|
||||
player_path = guess_player_path(preset)
|
||||
|
||||
if is_movie == False and preset in {'FRAMECYCLER', 'RV', 'MPLAYER'}:
|
||||
if is_movie is False and preset in {'FRAMECYCLER', 'RV', 'MPLAYER'}:
|
||||
# replace the number with '#'
|
||||
file_a = rd.frame_path(frame=0)
|
||||
|
||||
|
||||
@@ -608,9 +608,9 @@ class WM_OT_context_collection_boolean_set(Operator):
|
||||
except:
|
||||
continue
|
||||
|
||||
if value_orig == True:
|
||||
if value_orig is True:
|
||||
is_set = True
|
||||
elif value_orig == False:
|
||||
elif value_orig is False:
|
||||
pass
|
||||
else:
|
||||
self.report({'WARNING'}, "Non boolean value found: %s[ ].%s" %
|
||||
@@ -1583,7 +1583,7 @@ class WM_OT_addon_enable(Operator):
|
||||
"version %d.%d.%d and might not "
|
||||
"function (correctly), "
|
||||
"though it is enabled") %
|
||||
info_ver)
|
||||
info_ver)
|
||||
return {'FINISHED'}
|
||||
else:
|
||||
return {'CANCELLED'}
|
||||
@@ -1668,7 +1668,7 @@ class WM_OT_theme_install(Operator):
|
||||
class WM_OT_addon_install(Operator):
|
||||
"Install an addon"
|
||||
bl_idname = "wm.addon_install"
|
||||
bl_label = "Install Addon..."
|
||||
bl_label = "Install from File..."
|
||||
|
||||
overwrite = BoolProperty(
|
||||
name="Overwrite",
|
||||
@@ -1773,12 +1773,6 @@ class WM_OT_addon_install(Operator):
|
||||
|
||||
try: # extract the file to "addons"
|
||||
file_to_extract.extractall(path_addons)
|
||||
|
||||
# zip files can create this dir with metadata, don't need it
|
||||
macosx_dir = os.path.join(path_addons, '__MACOSX')
|
||||
if os.path.isdir(macosx_dir):
|
||||
shutil.rmtree(macosx_dir)
|
||||
|
||||
except:
|
||||
traceback.print_exc()
|
||||
return {'CANCELLED'}
|
||||
@@ -1822,8 +1816,11 @@ class WM_OT_addon_install(Operator):
|
||||
# in case a new module path was created to install this addon.
|
||||
bpy.utils.refresh_script_paths()
|
||||
|
||||
# TODO, should not be a warning.
|
||||
#~ self.report({'WARNING'}, "File installed to '%s'\n" % path_dest)
|
||||
# print message
|
||||
msg = "Modules Installed from %r into %r (%s)" % (pyfile, path_addons, ", ".join(sorted(addons_new)))
|
||||
print(msg)
|
||||
self.report({'INFO'}, msg)
|
||||
|
||||
return {'FINISHED'}
|
||||
|
||||
def invoke(self, context, event):
|
||||
|
||||
Reference in New Issue
Block a user