code cleanup: python/pep8 and double-promotion warnings.
This commit is contained in:
@@ -156,9 +156,9 @@ else:
|
|||||||
if builder.find('win') != -1:
|
if builder.find('win') != -1:
|
||||||
dlls = ('msvcm90.dll', 'msvcp90.dll', 'msvcr90.dll', 'vcomp90.dll', 'Microsoft.VC90.CRT.manifest', 'Microsoft.VC90.OpenMP.manifest')
|
dlls = ('msvcm90.dll', 'msvcp90.dll', 'msvcr90.dll', 'vcomp90.dll', 'Microsoft.VC90.CRT.manifest', 'Microsoft.VC90.OpenMP.manifest')
|
||||||
if builder.find('win64') == -1:
|
if builder.find('win64') == -1:
|
||||||
dlls_path = 'C:\\b\\redist\\x86'
|
dlls_path = 'C:\\b\\redist\\x86'
|
||||||
else:
|
else:
|
||||||
dlls_path = 'C:\\b\\redist\\amd64'
|
dlls_path = 'C:\\b\\redist\\amd64'
|
||||||
for dll in dlls:
|
for dll in dlls:
|
||||||
shutil.copyfile(os.path.join(dlls_path, dll), os.path.join(install_dir, dll))
|
shutil.copyfile(os.path.join(dlls_path, dll), os.path.join(install_dir, dll))
|
||||||
|
|
||||||
|
|||||||
@@ -416,7 +416,7 @@ class CyclesCameraSettings(bpy.types.PropertyGroup):
|
|||||||
default=0.0,
|
default=0.0,
|
||||||
step=1,
|
step=1,
|
||||||
precision=4,
|
precision=4,
|
||||||
subtype = 'DISTANCE'
|
subtype='DISTANCE',
|
||||||
)
|
)
|
||||||
cls.aperture_blades = IntProperty(
|
cls.aperture_blades = IntProperty(
|
||||||
name="Aperture Blades",
|
name="Aperture Blades",
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ class CyclesRender_PT_performance(CyclesButtonsPanel, Panel):
|
|||||||
sub.label(text="Final Render:")
|
sub.label(text="Final Render:")
|
||||||
sub.prop(rd, "use_persistent_data", text="Persistent Images")
|
sub.prop(rd, "use_persistent_data", text="Persistent Images")
|
||||||
|
|
||||||
|
|
||||||
class CyclesRender_PT_opengl(CyclesButtonsPanel, Panel):
|
class CyclesRender_PT_opengl(CyclesButtonsPanel, Panel):
|
||||||
bl_label = "OpenGL Render"
|
bl_label = "OpenGL Render"
|
||||||
bl_options = {'DEFAULT_CLOSED'}
|
bl_options = {'DEFAULT_CLOSED'}
|
||||||
@@ -230,18 +230,18 @@ class CyclesRender_PT_opengl(CyclesButtonsPanel, Panel):
|
|||||||
rd = context.scene.render
|
rd = context.scene.render
|
||||||
|
|
||||||
split = layout.split()
|
split = layout.split()
|
||||||
|
|
||||||
col = split.column()
|
col = split.column()
|
||||||
col.prop(rd, "use_antialiasing")
|
col.prop(rd, "use_antialiasing")
|
||||||
sub = col.row()
|
sub = col.row()
|
||||||
sub.active = rd.use_antialiasing
|
sub.active = rd.use_antialiasing
|
||||||
sub.prop(rd, "antialiasing_samples", expand=True)
|
sub.prop(rd, "antialiasing_samples", expand=True)
|
||||||
|
|
||||||
col = split.column()
|
col = split.column()
|
||||||
col.label(text="Alpha:")
|
col.label(text="Alpha:")
|
||||||
col.prop(rd, "alpha_mode", text="")
|
col.prop(rd, "alpha_mode", text="")
|
||||||
|
|
||||||
|
|
||||||
class CyclesRender_PT_layers(CyclesButtonsPanel, Panel):
|
class CyclesRender_PT_layers(CyclesButtonsPanel, Panel):
|
||||||
bl_label = "Layers"
|
bl_label = "Layers"
|
||||||
bl_options = {'DEFAULT_CLOSED'}
|
bl_options = {'DEFAULT_CLOSED'}
|
||||||
@@ -872,8 +872,8 @@ class CyclesTexture_PT_context(CyclesButtonsPanel, Panel):
|
|||||||
split = layout.split(percentage=0.2)
|
split = layout.split(percentage=0.2)
|
||||||
split.label(text="Type:")
|
split.label(text="Type:")
|
||||||
split.prop(tex, "type", text="")
|
split.prop(tex, "type", text="")
|
||||||
|
|
||||||
|
|
||||||
class CyclesTexture_PT_node(CyclesButtonsPanel, Panel):
|
class CyclesTexture_PT_node(CyclesButtonsPanel, Panel):
|
||||||
bl_label = "Node"
|
bl_label = "Node"
|
||||||
bl_context = "texture"
|
bl_context = "texture"
|
||||||
@@ -902,7 +902,7 @@ class CyclesTexture_PT_mapping(CyclesButtonsPanel, Panel):
|
|||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
node = context.texture_node
|
node = context.texture_node
|
||||||
|
|
||||||
mapping = node.texture_mapping
|
mapping = node.texture_mapping
|
||||||
@@ -934,7 +934,7 @@ class CyclesTexture_PT_colors(CyclesButtonsPanel, Panel):
|
|||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
node = context.texture_node
|
node = context.texture_node
|
||||||
|
|
||||||
mapping = node.color_mapping
|
mapping = node.color_mapping
|
||||||
|
|||||||
@@ -446,7 +446,7 @@ def dump_py_messages_from_files(msgs, reports, files, settings):
|
|||||||
nds_ls.extend(nds)
|
nds_ls.extend(nds)
|
||||||
ret = _extract_string_merge(estr_ls, nds_ls)
|
ret = _extract_string_merge(estr_ls, nds_ls)
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
def extract_strings_split(node):
|
def extract_strings_split(node):
|
||||||
"""
|
"""
|
||||||
Returns a list args as returned by 'extract_strings()', But split into groups based on separate_nodes, this way
|
Returns a list args as returned by 'extract_strings()', But split into groups based on separate_nodes, this way
|
||||||
|
|||||||
@@ -240,7 +240,7 @@ PYGETTEXT_KEYWORDS = (() +
|
|||||||
for it in ("IFACE_", "TIP_", "DATA_", "N_")) +
|
for it in ("IFACE_", "TIP_", "DATA_", "N_")) +
|
||||||
|
|
||||||
tuple((r"{}\(\s*" + _ctxt_re + r"\s*,\s*" + _msg_re + r"\s*\)").format(it)
|
tuple((r"{}\(\s*" + _ctxt_re + r"\s*,\s*" + _msg_re + r"\s*\)").format(it)
|
||||||
for it in ("CTX_IFACE_", "CTX_TIP_", "CTX_DATA_", "CTX_N_")) +
|
for it in ("CTX_IFACE_", "CTX_TIP_", "CTX_DATA_", "CTX_N_")) +
|
||||||
|
|
||||||
tuple(("{}\\((?:[^\"',]+,){{1,2}}\\s*" + _msg_re + r"\s*(?:\)|,)").format(it)
|
tuple(("{}\\((?:[^\"',]+,){{1,2}}\\s*" + _msg_re + r"\s*(?:\)|,)").format(it)
|
||||||
for it in ("BKE_report", "BKE_reportf", "BKE_reports_prepend", "BKE_reports_prependf",
|
for it in ("BKE_report", "BKE_reportf", "BKE_reports_prepend", "BKE_reports_prependf",
|
||||||
@@ -252,7 +252,7 @@ PYGETTEXT_KEYWORDS = (() +
|
|||||||
tuple(("{}\\((?:[^\"',]+,)\\s*" + _msg_re + r"\s*(?:\)|,)").format(it)
|
tuple(("{}\\((?:[^\"',]+,)\\s*" + _msg_re + r"\s*(?:\)|,)").format(it)
|
||||||
for it in ("modifier_setError",)) +
|
for it in ("modifier_setError",)) +
|
||||||
|
|
||||||
tuple((r"{}\(\s*" + _msg_re + r"\s*,\s*(?:" + \
|
tuple((r"{}\(\s*" + _msg_re + r"\s*,\s*(?:" +
|
||||||
r"\s*,\s*)?(?:".join(_ctxt_re_gen(i) for i in range(PYGETTEXT_MAX_MULTI_CTXT)) + r")?\s*\)").format(it)
|
r"\s*,\s*)?(?:".join(_ctxt_re_gen(i) for i in range(PYGETTEXT_MAX_MULTI_CTXT)) + r")?\s*\)").format(it)
|
||||||
for it in ("BLF_I18N_MSGID_MULTI_CTXT",))
|
for it in ("BLF_I18N_MSGID_MULTI_CTXT",))
|
||||||
)
|
)
|
||||||
@@ -354,7 +354,7 @@ PARSER_PY_ID = "__PY__"
|
|||||||
PARSER_PY_MARKER_BEGIN = "\n# ##### BEGIN AUTOGENERATED I18N SECTION #####\n"
|
PARSER_PY_MARKER_BEGIN = "\n# ##### BEGIN AUTOGENERATED I18N SECTION #####\n"
|
||||||
PARSER_PY_MARKER_END = "\n# ##### END AUTOGENERATED I18N SECTION #####\n"
|
PARSER_PY_MARKER_END = "\n# ##### END AUTOGENERATED I18N SECTION #####\n"
|
||||||
|
|
||||||
PARSER_MAX_FILE_SIZE = 2**24 # in bytes, i.e. 16 Mb.
|
PARSER_MAX_FILE_SIZE = 2 ** 24 # in bytes, i.e. 16 Mb.
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# PATHS
|
# PATHS
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ class I18nMessage:
|
|||||||
self.comment_lines.remove(l)
|
self.comment_lines.remove(l)
|
||||||
lines_src = []
|
lines_src = []
|
||||||
lines_src_custom = []
|
lines_src_custom = []
|
||||||
for src in sources:
|
for src in sources:
|
||||||
if is_valid_po_path(src):
|
if is_valid_po_path(src):
|
||||||
lines_src.append(self.settings.PO_COMMENT_PREFIX_SOURCE + src)
|
lines_src.append(self.settings.PO_COMMENT_PREFIX_SOURCE + src)
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ def bake_action(frame_start,
|
|||||||
euler_prev = None
|
euler_prev = None
|
||||||
|
|
||||||
for (f, matrix) in zip(frame_range, obj_info):
|
for (f, matrix) in zip(frame_range, obj_info):
|
||||||
name = "Action Bake" # XXX: placeholder
|
name = "Action Bake" # XXX: placeholder
|
||||||
obj.matrix_basis = matrix
|
obj.matrix_basis = matrix
|
||||||
|
|
||||||
obj.keyframe_insert("location", -1, f, name, options)
|
obj.keyframe_insert("location", -1, f, name, options)
|
||||||
|
|||||||
@@ -729,6 +729,7 @@ class Menu(StructRNA, _GenericUI, metaclass=RNAMeta):
|
|||||||
self.preset_operator,
|
self.preset_operator,
|
||||||
filter_ext=lambda ext: ext.lower() in {".py", ".xml"})
|
filter_ext=lambda ext: ext.lower() in {".py", ".xml"})
|
||||||
|
|
||||||
|
|
||||||
class Region(StructRNA):
|
class Region(StructRNA):
|
||||||
__slots__ = ()
|
__slots__ = ()
|
||||||
|
|
||||||
@@ -782,9 +783,11 @@ def gen_valid_identifier(seq):
|
|||||||
if ch == '_' or ch.isalpha() or ch.isdigit():
|
if ch == '_' or ch.isalpha() or ch.isdigit():
|
||||||
yield ch
|
yield ch
|
||||||
|
|
||||||
|
|
||||||
def sanitize_identifier(name):
|
def sanitize_identifier(name):
|
||||||
return ''.join(gen_valid_identifier(name))
|
return ''.join(gen_valid_identifier(name))
|
||||||
|
|
||||||
|
|
||||||
def unique_identifier(name, identifier_list):
|
def unique_identifier(name, identifier_list):
|
||||||
# First some basic sanitation, to make a usable identifier string from the name
|
# First some basic sanitation, to make a usable identifier string from the name
|
||||||
base = sanitize_identifier(name)
|
base = sanitize_identifier(name)
|
||||||
@@ -796,6 +799,7 @@ def unique_identifier(name, identifier_list):
|
|||||||
identifier = base + str(index)
|
identifier = base + str(index)
|
||||||
return identifier
|
return identifier
|
||||||
|
|
||||||
|
|
||||||
class RNAMetaNode(RNAMetaPropGroup):
|
class RNAMetaNode(RNAMetaPropGroup):
|
||||||
def __new__(cls, name, bases, classdict, **args):
|
def __new__(cls, name, bases, classdict, **args):
|
||||||
# Wrapper for node.init, to add sockets from templates
|
# Wrapper for node.init, to add sockets from templates
|
||||||
@@ -846,7 +850,7 @@ class Node(StructRNA, metaclass=RNAMetaNode):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def poll(cls, ntree):
|
def poll(cls, ntree):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
class NodeSocket(StructRNA, metaclass=RNAMetaPropGroup):
|
class NodeSocket(StructRNA, metaclass=RNAMetaPropGroup):
|
||||||
@@ -870,17 +874,18 @@ class CompositorNode(Node):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def poll(cls, ntree):
|
def poll(cls, ntree):
|
||||||
return ntree.bl_idname == 'CompositorNodeTree'
|
return ntree.bl_idname == 'CompositorNodeTree'
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
self.tag_need_exec()
|
self.tag_need_exec()
|
||||||
|
|
||||||
|
|
||||||
class ShaderNode(Node):
|
class ShaderNode(Node):
|
||||||
__slots__ = ()
|
__slots__ = ()
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def poll(cls, ntree):
|
def poll(cls, ntree):
|
||||||
return ntree.bl_idname == 'ShaderNodeTree'
|
return ntree.bl_idname == 'ShaderNodeTree'
|
||||||
|
|
||||||
|
|
||||||
class TextureNode(Node):
|
class TextureNode(Node):
|
||||||
@@ -888,5 +893,4 @@ class TextureNode(Node):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def poll(cls, ntree):
|
def poll(cls, ntree):
|
||||||
return ntree.bl_idname == 'TextureNodeTree'
|
return ntree.bl_idname == 'TextureNodeTree'
|
||||||
|
|
||||||
|
|||||||
@@ -111,10 +111,11 @@ def module_list(path):
|
|||||||
else:
|
else:
|
||||||
folder_list = []
|
folder_list = []
|
||||||
#folder_list = glob.glob(os.path.join(path,'*'))
|
#folder_list = glob.glob(os.path.join(path,'*'))
|
||||||
folder_list = [p for p in folder_list \
|
folder_list = [
|
||||||
if os.path.exists(os.path.join(path, p, '__init__.py')) \
|
p for p in folder_list
|
||||||
or p[-3:] in {'.py', '.so'} \
|
if (os.path.exists(os.path.join(path, p, '__init__.py')) or
|
||||||
or p[-4:] in {'.pyc', '.pyo', '.pyd'}]
|
p[-3:] in {'.py', '.so'} or
|
||||||
|
p[-4:] in {'.pyc', '.pyo', '.pyd'})]
|
||||||
|
|
||||||
folder_list = [os.path.basename(p).split('.')[0] for p in folder_list]
|
folder_list = [os.path.basename(p).split('.')[0] for p in folder_list]
|
||||||
return folder_list
|
return folder_list
|
||||||
|
|||||||
@@ -127,7 +127,8 @@ def node_class_items_iter(node_class, context):
|
|||||||
tree_idname = context.space_data.edit_tree.bl_idname
|
tree_idname = context.space_data.edit_tree.bl_idname
|
||||||
for group in bpy.data.node_groups:
|
for group in bpy.data.node_groups:
|
||||||
if group.bl_idname == tree_idname:
|
if group.bl_idname == tree_idname:
|
||||||
yield (group.name, "", {"node_tree":group}) # XXX empty string should be replaced by description from tree
|
# XXX empty string should be replaced by description from tree
|
||||||
|
yield (group.name, "", {"node_tree": group})
|
||||||
else:
|
else:
|
||||||
yield (node_class.bl_rna.name, node_class.bl_rna.description, {})
|
yield (node_class.bl_rna.name, node_class.bl_rna.description, {})
|
||||||
|
|
||||||
@@ -169,7 +170,7 @@ class NODE_OT_add_search(NodeAddOperator, Operator):
|
|||||||
for index, item in enumerate(node_items_iter(context)):
|
for index, item in enumerate(node_items_iter(context)):
|
||||||
if str(index) == self.type:
|
if str(index) == self.type:
|
||||||
node = self.create_node(context, item[0].bl_rna.identifier)
|
node = self.create_node(context, item[0].bl_rna.identifier)
|
||||||
for prop,value in item[3].items():
|
for prop, value in item[3].items():
|
||||||
setattr(node, prop, value)
|
setattr(node, prop, value)
|
||||||
break
|
break
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
@@ -257,4 +258,3 @@ class NODE_OT_tree_path_parent(Operator):
|
|||||||
space.path.pop()
|
space.path.pop()
|
||||||
|
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ class BakeToKeyframes(Operator):
|
|||||||
# this is a little roundabout but there's no better way right now
|
# this is a little roundabout but there's no better way right now
|
||||||
aa = mat.to_quaternion().to_axis_angle()
|
aa = mat.to_quaternion().to_axis_angle()
|
||||||
obj.rotation_axis_angle = (aa[1], ) + aa[0][:]
|
obj.rotation_axis_angle = (aa[1], ) + aa[0][:]
|
||||||
else: # euler
|
else: # euler
|
||||||
# make sure euler rotation is compatible to previous frame
|
# make sure euler rotation is compatible to previous frame
|
||||||
obj.rotation_euler = mat.to_euler(rot_mode, obj_prev.rotation_euler)
|
obj.rotation_euler = mat.to_euler(rot_mode, obj_prev.rotation_euler)
|
||||||
|
|
||||||
@@ -275,10 +275,10 @@ class ConnectRigidBodies(Operator):
|
|||||||
self._add_constraint(context, objs_sorted[i-1], objs_sorted[i])
|
self._add_constraint(context, objs_sorted[i-1], objs_sorted[i])
|
||||||
change = True
|
change = True
|
||||||
|
|
||||||
else: # SELECTED_TO_ACTIVE
|
else: # SELECTED_TO_ACTIVE
|
||||||
for obj in objects:
|
for obj in objects:
|
||||||
self._add_constraint(context, obj_act, obj)
|
self._add_constraint(context, obj_act, obj)
|
||||||
change = True;
|
change = True
|
||||||
|
|
||||||
if change:
|
if change:
|
||||||
# restore selection
|
# restore selection
|
||||||
|
|||||||
@@ -830,7 +830,7 @@ def _wm_doc_get_id(doc_id, do_url=True, url_prefix=""):
|
|||||||
rna = "bpy.ops.%s.%s" % (class_name, class_prop)
|
rna = "bpy.ops.%s.%s" % (class_name, class_prop)
|
||||||
else:
|
else:
|
||||||
rna_class = getattr(bpy.types, class_name)
|
rna_class = getattr(bpy.types, class_name)
|
||||||
|
|
||||||
# an operator setting (selected from a running operator), rare case
|
# an operator setting (selected from a running operator), rare case
|
||||||
# note: Py defined operators are subclass of Operator,
|
# note: Py defined operators are subclass of Operator,
|
||||||
# C defined operators are subclass of OperatorProperties.
|
# C defined operators are subclass of OperatorProperties.
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ def brush_texture_settings(layout, brush, sculpt):
|
|||||||
col.prop(brush, "texture_angle_source_random", text="")
|
col.prop(brush, "texture_angle_source_random", text="")
|
||||||
else:
|
else:
|
||||||
col.prop(brush, "texture_angle_source_no_random", text="")
|
col.prop(brush, "texture_angle_source_no_random", text="")
|
||||||
|
|
||||||
else:
|
else:
|
||||||
col.prop(brush, "texture_angle_source_random", text="")
|
col.prop(brush, "texture_angle_source_random", text="")
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -474,12 +474,12 @@ class RENDER_PT_output(RenderButtonsPanel, Panel):
|
|||||||
layout.prop(rd, "filepath", text="")
|
layout.prop(rd, "filepath", text="")
|
||||||
|
|
||||||
split = layout.split()
|
split = layout.split()
|
||||||
|
|
||||||
col = split.column()
|
col = split.column()
|
||||||
col.active = not rd.is_movie_format
|
col.active = not rd.is_movie_format
|
||||||
col.prop(rd, "use_overwrite")
|
col.prop(rd, "use_overwrite")
|
||||||
col.prop(rd, "use_placeholder")
|
col.prop(rd, "use_placeholder")
|
||||||
|
|
||||||
split.prop(rd, "use_file_extension")
|
split.prop(rd, "use_file_extension")
|
||||||
|
|
||||||
layout.template_image_settings(image_settings, color_management=False)
|
layout.template_image_settings(image_settings, color_management=False)
|
||||||
|
|||||||
@@ -778,7 +778,7 @@ class IMAGE_PT_paint_stroke(BrushButtonsPanel, Panel):
|
|||||||
|
|
||||||
toolsettings = context.tool_settings.image_paint
|
toolsettings = context.tool_settings.image_paint
|
||||||
brush = toolsettings.brush
|
brush = toolsettings.brush
|
||||||
|
|
||||||
col = layout.column()
|
col = layout.column()
|
||||||
col.prop(toolsettings, "input_samples")
|
col.prop(toolsettings, "input_samples")
|
||||||
|
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ class NLA_MT_add(Menu):
|
|||||||
layout.separator()
|
layout.separator()
|
||||||
layout.operator("nla.tracks_add").above_selected = False
|
layout.operator("nla.tracks_add").above_selected = False
|
||||||
layout.operator("nla.tracks_add", text="Add Tracks Above Selected").above_selected = True
|
layout.operator("nla.tracks_add", text="Add Tracks Above Selected").above_selected = True
|
||||||
|
|
||||||
layout.separator()
|
layout.separator()
|
||||||
layout.operator("nla.selected_objects_add")
|
layout.operator("nla.selected_objects_add")
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ class NODE_HT_header(Header):
|
|||||||
row.menu("NODE_MT_node")
|
row.menu("NODE_MT_node")
|
||||||
|
|
||||||
layout.prop(snode, "tree_type", text="", expand=True)
|
layout.prop(snode, "tree_type", text="", expand=True)
|
||||||
|
|
||||||
if snode.tree_type == 'ShaderNodeTree':
|
if snode.tree_type == 'ShaderNodeTree':
|
||||||
if scene.render.use_shading_nodes:
|
if scene.render.use_shading_nodes:
|
||||||
layout.prop(snode, "shader_type", text="", expand=True)
|
layout.prop(snode, "shader_type", text="", expand=True)
|
||||||
@@ -84,7 +84,7 @@ class NODE_HT_header(Header):
|
|||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
row.prop(snode, "backdrop_channels", text="", expand=True)
|
row.prop(snode, "backdrop_channels", text="", expand=True)
|
||||||
layout.prop(snode, "use_auto_render")
|
layout.prop(snode, "use_auto_render")
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# Custom node tree is edited as independent ID block
|
# Custom node tree is edited as independent ID block
|
||||||
layout.template_ID(snode, "node_tree", new="node.new_node_tree")
|
layout.template_ID(snode, "node_tree", new="node.new_node_tree")
|
||||||
@@ -292,7 +292,7 @@ class NODE_UL_interface_sockets(bpy.types.UIList):
|
|||||||
if self.layout_type in {'DEFAULT', 'COMPACT'}:
|
if self.layout_type in {'DEFAULT', 'COMPACT'}:
|
||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
|
|
||||||
# inputs get icon on the left
|
# inputs get icon on the left
|
||||||
if socket.in_out == 'IN':
|
if socket.in_out == 'IN':
|
||||||
row.template_node_socket(color)
|
row.template_node_socket(color)
|
||||||
|
|
||||||
|
|||||||
@@ -1180,7 +1180,7 @@ class VIEW3D_PT_tools_projectpaint(View3DPanel, Panel):
|
|||||||
|
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.prop(ipaint, "use_normal_falloff")
|
row.prop(ipaint, "use_normal_falloff")
|
||||||
|
|
||||||
sub = row.row()
|
sub = row.row()
|
||||||
sub.active = (ipaint.use_normal_falloff)
|
sub.active = (ipaint.use_normal_falloff)
|
||||||
sub.prop(ipaint, "normal_angle", text="")
|
sub.prop(ipaint, "normal_angle", text="")
|
||||||
@@ -1214,7 +1214,7 @@ class VIEW3D_PT_tools_projectpaint(View3DPanel, Panel):
|
|||||||
|
|
||||||
col.operator("paint.project_image", text="Apply Camera Image")
|
col.operator("paint.project_image", text="Apply Camera Image")
|
||||||
col.operator("image.save_dirty", text="Save All Edited")
|
col.operator("image.save_dirty", text="Save All Edited")
|
||||||
|
|
||||||
|
|
||||||
class VIEW3D_PT_imagepaint_options(View3DPaintPanel):
|
class VIEW3D_PT_imagepaint_options(View3DPaintPanel):
|
||||||
bl_label = "Options"
|
bl_label = "Options"
|
||||||
|
|||||||
@@ -970,7 +970,7 @@ static void do_sub_effect_byte(float facf0, float facf1, int x, int y, unsigned
|
|||||||
tempc[2] = max_ff(rt1[2] - fac1 * rt2[2], 0.0f);
|
tempc[2] = max_ff(rt1[2] - fac1 * rt2[2], 0.0f);
|
||||||
tempc[3] = max_ff(rt1[3] - fac1 * rt2[3], 0.0f);
|
tempc[3] = max_ff(rt1[3] - fac1 * rt2[3], 0.0f);
|
||||||
|
|
||||||
if (tempc[3] < 1e-6)
|
if (tempc[3] < 1e-6f)
|
||||||
tempc[3] = 0.0f;
|
tempc[3] = 0.0f;
|
||||||
|
|
||||||
premul_float_to_straight_uchar(rt, tempc);
|
premul_float_to_straight_uchar(rt, tempc);
|
||||||
@@ -992,7 +992,7 @@ static void do_sub_effect_byte(float facf0, float facf1, int x, int y, unsigned
|
|||||||
tempc[2] = max_ff(rt1[2] - fac3 * rt2[2], 0.0f);
|
tempc[2] = max_ff(rt1[2] - fac3 * rt2[2], 0.0f);
|
||||||
tempc[3] = max_ff(rt1[3] - fac3 * rt2[3], 0.0f);
|
tempc[3] = max_ff(rt1[3] - fac3 * rt2[3], 0.0f);
|
||||||
|
|
||||||
if (tempc[3] < 1e-6)
|
if (tempc[3] < 1e-6f)
|
||||||
tempc[3] = 0.0f;
|
tempc[3] = 0.0f;
|
||||||
|
|
||||||
premul_float_to_straight_uchar(rt, tempc);
|
premul_float_to_straight_uchar(rt, tempc);
|
||||||
@@ -1024,7 +1024,7 @@ static void do_sub_effect_float(float facf0, float facf1, int x, int y, float *r
|
|||||||
rt[2] = max_ff(rt1[2] - fac1 * rt2[2], 0.0f);
|
rt[2] = max_ff(rt1[2] - fac1 * rt2[2], 0.0f);
|
||||||
rt[3] = max_ff(rt1[3] - fac1 * rt2[3], 0.0f);
|
rt[3] = max_ff(rt1[3] - fac1 * rt2[3], 0.0f);
|
||||||
|
|
||||||
if (rt[3] < 1e-6)
|
if (rt[3] < 1e-6f)
|
||||||
rt[3] = 0.0f;
|
rt[3] = 0.0f;
|
||||||
|
|
||||||
rt1 += 4; rt2 += 4; rt += 4;
|
rt1 += 4; rt2 += 4; rt += 4;
|
||||||
@@ -1041,7 +1041,7 @@ static void do_sub_effect_float(float facf0, float facf1, int x, int y, float *r
|
|||||||
rt[2] = max_ff(rt1[2] - fac3 * rt2[2], 0.0f);
|
rt[2] = max_ff(rt1[2] - fac3 * rt2[2], 0.0f);
|
||||||
rt[3] = max_ff(rt1[3] - fac3 * rt2[3], 0.0f);
|
rt[3] = max_ff(rt1[3] - fac3 * rt2[3], 0.0f);
|
||||||
|
|
||||||
if (rt[3] < 1e-6)
|
if (rt[3] < 1e-6f)
|
||||||
rt[3] = 0.0f;
|
rt[3] = 0.0f;
|
||||||
|
|
||||||
rt1 += 4; rt2 += 4; rt += 4;
|
rt1 += 4; rt2 += 4; rt += 4;
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ void bmo_contextual_create_exec(BMesh *bm, BMOperator *op)
|
|||||||
else ok = false; /* only ever want one of these */
|
else ok = false; /* only ever want one of these */
|
||||||
}
|
}
|
||||||
else if (tot_edges == 1) {
|
else if (tot_edges == 1) {
|
||||||
if (v_a == NULL) v_a = v;
|
if (v_a == NULL) v_a = v;
|
||||||
else if (v_b == NULL) v_b = v;
|
else if (v_b == NULL) v_b = v;
|
||||||
else ok = false; /* only ever want 2 of these */
|
else ok = false; /* only ever want 2 of these */
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -823,9 +823,10 @@ static int node_select_same_type_step_exec(bContext *C, wmOperator *op)
|
|||||||
|
|
||||||
/* is note outside view? */
|
/* is note outside view? */
|
||||||
if (active->totr.xmax < ar->v2d.cur.xmin || active->totr.xmin > ar->v2d.cur.xmax ||
|
if (active->totr.xmax < ar->v2d.cur.xmin || active->totr.xmin > ar->v2d.cur.xmax ||
|
||||||
active->totr.ymax < ar->v2d.cur.ymin || active->totr.ymin > ar->v2d.cur.ymax)
|
active->totr.ymax < ar->v2d.cur.ymin || active->totr.ymin > ar->v2d.cur.ymax)
|
||||||
space_node_view_flag(C, snode, CTX_wm_region(C), NODE_SELECT);
|
{
|
||||||
|
space_node_view_flag(C, snode, CTX_wm_region(C), NODE_SELECT);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (node_array)
|
if (node_array)
|
||||||
|
|||||||
@@ -229,7 +229,7 @@ void WM_init(bContext *C, int argc, const char **argv)
|
|||||||
* however python is not initialized when called from this function.
|
* however python is not initialized when called from this function.
|
||||||
*
|
*
|
||||||
* unlikey any handlers are set but its possible,
|
* unlikey any handlers are set but its possible,
|
||||||
* note that recovering the last session does its own callbacks callbacks. */
|
* note that recovering the last session does its own callbacks. */
|
||||||
BLI_callback_exec(CTX_data_main(C), NULL, BLI_CB_EVT_LOAD_POST);
|
BLI_callback_exec(CTX_data_main(C), NULL, BLI_CB_EVT_LOAD_POST);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user