pep8 changes
This commit is contained in:
parent
fbadf21b00
commit
95069f2909
@ -898,7 +898,7 @@ class ExportOBJ(bpy.types.Operator):
|
||||
|
||||
path = StringProperty(name="File Path", description="File path used for exporting the OBJ file", maxlen= 1024, default= "")
|
||||
check_existing = BoolProperty(name="Check Existing", description="Check and warn on overwriting existing files", default=True, hidden=True)
|
||||
|
||||
|
||||
# context group
|
||||
use_selection = BoolProperty(name="Selection Only", description="", default= False)
|
||||
use_all_scenes = BoolProperty(name="All Scenes", description="", default= False)
|
||||
|
@ -281,7 +281,6 @@ class ExportPLY(bpy.types.Operator):
|
||||
use_uvs = BoolProperty(name="UVs", description="Exort the active UV layer", default=True)
|
||||
use_colors = BoolProperty(name="Vertex Colors", description="Exort the active vertex color layer", default=True)
|
||||
|
||||
|
||||
def poll(self, context):
|
||||
return context.active_object != None
|
||||
|
||||
@ -328,4 +327,3 @@ bpy.types.INFO_MT_file_export.append(menu_func)
|
||||
|
||||
if __name__ == "__main__":
|
||||
bpy.ops.export.ply(path="/tmp/test.ply")
|
||||
|
||||
|
@ -626,7 +626,7 @@ class x3d_class:
|
||||
texCoordList.append(uv)
|
||||
j=j+1
|
||||
texIndexList.append(-1)
|
||||
|
||||
|
||||
if self.writingtexture == 0:
|
||||
self.file.write("\n\t\t\ttexCoordIndex=\"")
|
||||
texIndxStr=""
|
||||
@ -1228,7 +1228,7 @@ class ExportX3D(bpy.types.Operator):
|
||||
# to the class instance from the operator settings before calling.
|
||||
path = StringProperty(name="File Path", description="File path used for exporting the X3D file", maxlen= 1024, default= "")
|
||||
check_existing = BoolProperty(name="Check Existing", description="Check and warn on overwriting existing files", default=True, hidden=True)
|
||||
|
||||
|
||||
apply_modifiers = BoolProperty(name="Apply Modifiers", description="Use transformed mesh data from each object.", default=True)
|
||||
triangulate = BoolProperty(name="Triangulate", description="Triangulate quads.", default=False)
|
||||
compress = BoolProperty(name="Compress", description="GZip the resulting file, requires a full python install.", default=False)
|
||||
|
@ -34,4 +34,4 @@ blacklist = []
|
||||
|
||||
init_file = ""
|
||||
init_data = True
|
||||
init_address = True
|
||||
init_address = True
|
||||
|
@ -24,7 +24,7 @@ import netrender.model
|
||||
class RatingRule:
|
||||
def __init__(self):
|
||||
self.enabled = True
|
||||
|
||||
|
||||
def rate(self, job):
|
||||
return 0
|
||||
|
||||
@ -58,7 +58,7 @@ class Balancer:
|
||||
for rule in self.exceptions:
|
||||
if id(rule) == rule_id:
|
||||
return rule
|
||||
|
||||
|
||||
return None
|
||||
|
||||
def addRule(self, rule):
|
||||
@ -129,7 +129,7 @@ class NewJobPriority(PriorityRule):
|
||||
def __init__(self, limit = 1):
|
||||
super().__init__()
|
||||
self.limit = limit
|
||||
|
||||
|
||||
def setLimit(self, value):
|
||||
self.limit = int(value)
|
||||
|
||||
@ -175,7 +175,7 @@ class ExcludeSlavesLimit(ExclusionRule):
|
||||
|
||||
def setLimit(self, value):
|
||||
self.limit = float(value)
|
||||
|
||||
|
||||
def str_limit(self):
|
||||
return "more than %.0f%% of all slaves" % (self.limit * 100)
|
||||
|
||||
|
@ -75,9 +75,9 @@ class MRenderJob(netrender.model.RenderJob):
|
||||
self.last_update = 0
|
||||
self.save_path = ""
|
||||
self.files = [MRenderFile(rfile.filepath, rfile.index, rfile.start, rfile.end) for rfile in job_info.files]
|
||||
|
||||
|
||||
self.resolution = None
|
||||
|
||||
|
||||
def initInfo(self):
|
||||
if not self.resolution:
|
||||
self.resolution = tuple(getFileInfo(self.files[0].filepath, ["bpy.context.scene.render_data.resolution_x", "bpy.context.scene.render_data.resolution_y", "bpy.context.scene.render_data.resolution_percentage"]))
|
||||
@ -113,11 +113,11 @@ class MRenderJob(netrender.model.RenderJob):
|
||||
break
|
||||
else:
|
||||
self.status = JOB_FINISHED
|
||||
|
||||
|
||||
def pause(self, status = None):
|
||||
if self.status not in {JOB_PAUSED, JOB_QUEUED}:
|
||||
return
|
||||
|
||||
return
|
||||
|
||||
if status == None:
|
||||
self.status = JOB_PAUSED if self.status == JOB_QUEUED else JOB_QUEUED
|
||||
elif status:
|
||||
@ -238,7 +238,7 @@ class RenderHandler(http.server.BaseHTTPRequestHandler):
|
||||
if match:
|
||||
job_id = match.groups()[0]
|
||||
frame_number = int(match.groups()[1])
|
||||
|
||||
|
||||
job = self.server.getJobID(job_id)
|
||||
|
||||
if job:
|
||||
@ -249,9 +249,9 @@ class RenderHandler(http.server.BaseHTTPRequestHandler):
|
||||
self.send_head(http.client.ACCEPTED)
|
||||
elif frame.status == DONE:
|
||||
self.server.stats("", "Sending result to client")
|
||||
|
||||
|
||||
filename = job.save_path + "%04d" % frame_number + ".exr"
|
||||
|
||||
|
||||
f = open(filename, 'rb')
|
||||
self.send_head(content = "image/x-exr")
|
||||
shutil.copyfileobj(f, self.wfile)
|
||||
@ -285,7 +285,7 @@ class RenderHandler(http.server.BaseHTTPRequestHandler):
|
||||
self.send_head(http.client.ACCEPTED)
|
||||
elif frame.status == DONE:
|
||||
filename = job.save_path + "%04d" % frame_number + ".exr"
|
||||
|
||||
|
||||
thumbname = thumbnail(filename)
|
||||
|
||||
if thumbname:
|
||||
@ -527,7 +527,7 @@ class RenderHandler(http.server.BaseHTTPRequestHandler):
|
||||
rule.setLimit(limit)
|
||||
except:
|
||||
pass # invalid type
|
||||
|
||||
|
||||
self.send_head()
|
||||
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
||||
elif self.path == "/balance_enable":
|
||||
@ -537,7 +537,7 @@ class RenderHandler(http.server.BaseHTTPRequestHandler):
|
||||
rule = self.server.balancer.ruleByID(rule_id)
|
||||
if rule:
|
||||
rule.enabled = enabled
|
||||
|
||||
|
||||
self.send_head()
|
||||
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
||||
elif self.path.startswith("/cancel"):
|
||||
@ -545,13 +545,13 @@ class RenderHandler(http.server.BaseHTTPRequestHandler):
|
||||
|
||||
if match:
|
||||
length = int(self.headers['content-length'])
|
||||
|
||||
|
||||
if length > 0:
|
||||
info_map = eval(str(self.rfile.read(length), encoding='utf8'))
|
||||
clear = info_map.get("clear", False)
|
||||
else:
|
||||
clear = False
|
||||
|
||||
|
||||
job_id = match.groups()[0]
|
||||
|
||||
job = self.server.getJobID(job_id)
|
||||
@ -572,13 +572,13 @@ class RenderHandler(http.server.BaseHTTPRequestHandler):
|
||||
|
||||
if match:
|
||||
length = int(self.headers['content-length'])
|
||||
|
||||
|
||||
if length > 0:
|
||||
info_map = eval(str(self.rfile.read(length), encoding='utf8'))
|
||||
status = info_map.get("status", None)
|
||||
else:
|
||||
status = None
|
||||
|
||||
|
||||
job_id = match.groups()[0]
|
||||
|
||||
job = self.server.getJobID(job_id)
|
||||
@ -597,7 +597,7 @@ class RenderHandler(http.server.BaseHTTPRequestHandler):
|
||||
elif self.path == "/clear":
|
||||
# cancel all jobs
|
||||
length = int(self.headers['content-length'])
|
||||
|
||||
|
||||
if length > 0:
|
||||
info_map = eval(str(self.rfile.read(length), encoding='utf8'))
|
||||
clear = info_map.get("clear", False)
|
||||
@ -963,10 +963,10 @@ class RenderMasterServer(http.server.HTTPServer):
|
||||
def removeJob(self, job, clear_files = False):
|
||||
self.jobs.remove(job)
|
||||
self.jobs_map.pop(job.id)
|
||||
|
||||
|
||||
if clear_files:
|
||||
shutil.rmtree(job.save_path)
|
||||
|
||||
|
||||
for slave in self.slaves:
|
||||
if slave.job == job:
|
||||
slave.job = None
|
||||
|
@ -83,7 +83,7 @@ def get(handler):
|
||||
|
||||
def endTable():
|
||||
output("</table>")
|
||||
|
||||
|
||||
def checkbox(title, value, script=""):
|
||||
return """<input type="checkbox" title="%s" %s %s>""" % (title, "checked" if value else "", ("onclick=\"%s\"" % script) if script else "")
|
||||
|
||||
@ -114,29 +114,29 @@ def get(handler):
|
||||
headerTable("type", "enabled", "description", "limit")
|
||||
|
||||
for rule in handler.server.balancer.rules:
|
||||
rowTable(
|
||||
rowTable(
|
||||
"rating",
|
||||
checkbox("", rule.enabled, "balance_enable('%i', '%s')" % (id(rule), str(not rule.enabled))),
|
||||
rule,
|
||||
rule.str_limit() +
|
||||
rule.str_limit() +
|
||||
"""<button title="edit limit" onclick="balance_edit('%i', '%s');">edit</button>""" % (id(rule), str(rule.limit)) if hasattr(rule, "limit") else " "
|
||||
)
|
||||
|
||||
for rule in handler.server.balancer.priorities:
|
||||
rowTable(
|
||||
rowTable(
|
||||
"priority",
|
||||
checkbox("", rule.enabled, "balance_enable('%i', '%s')" % (id(rule), str(not rule.enabled))),
|
||||
rule,
|
||||
rule.str_limit() +
|
||||
rule.str_limit() +
|
||||
"""<button title="edit limit" onclick="balance_edit('%i', '%s');">edit</button>""" % (id(rule), str(rule.limit)) if hasattr(rule, "limit") else " "
|
||||
)
|
||||
|
||||
for rule in handler.server.balancer.exceptions:
|
||||
rowTable(
|
||||
rowTable(
|
||||
"exception",
|
||||
checkbox("", rule.enabled, "balance_enable('%i', '%s')" % (id(rule), str(not rule.enabled))),
|
||||
rule,
|
||||
rule.str_limit() +
|
||||
rule.str_limit() +
|
||||
"""<button title="edit limit" onclick="balance_edit('%i', '%s');">edit</button>""" % (id(rule), str(rule.limit)) if hasattr(rule, "limit") else " "
|
||||
)
|
||||
|
||||
@ -218,14 +218,14 @@ def get(handler):
|
||||
output("<h2>Render Information</h2>")
|
||||
|
||||
job.initInfo()
|
||||
|
||||
|
||||
startTable()
|
||||
|
||||
rowTable("resolution", "%ix%i at %i%%" % job.resolution)
|
||||
|
||||
endTable()
|
||||
|
||||
|
||||
|
||||
output("<h2>Files</h2>")
|
||||
|
||||
startTable()
|
||||
|
@ -217,11 +217,11 @@ def render_slave(engine, netsettings, threads):
|
||||
# send image back to server
|
||||
|
||||
filename = JOB_PREFIX + "%06d" % frame.number + ".exr"
|
||||
|
||||
|
||||
# thumbnail first
|
||||
if netsettings.slave_thumb:
|
||||
thumbname = thumbnail(filename)
|
||||
|
||||
|
||||
f = open(thumbname, 'rb')
|
||||
conn.request("PUT", "/thumb", f, headers=headers)
|
||||
f.close()
|
||||
@ -232,7 +232,7 @@ def render_slave(engine, netsettings, threads):
|
||||
f.close()
|
||||
if conn.getresponse().status == http.client.NO_CONTENT:
|
||||
continue
|
||||
|
||||
|
||||
elif job.type == netrender.model.JOB_PROCESS:
|
||||
conn.request("PUT", "/render", headers=headers)
|
||||
if conn.getresponse().status == http.client.NO_CONTENT:
|
||||
@ -255,7 +255,7 @@ def render_slave(engine, netsettings, threads):
|
||||
break
|
||||
|
||||
conn.close()
|
||||
|
||||
|
||||
if netsettings.slave_clear:
|
||||
clearSlave(NODE_PREFIX)
|
||||
|
||||
|
@ -44,14 +44,14 @@ def init_file():
|
||||
|
||||
def init_data(netsettings):
|
||||
init_file()
|
||||
|
||||
|
||||
if netrender.init_data:
|
||||
netrender.init_data = False
|
||||
|
||||
netsettings.active_slave_index = 0
|
||||
while(len(netsettings.slaves) > 0):
|
||||
netsettings.slaves.remove(0)
|
||||
|
||||
|
||||
netsettings.active_blacklisted_slave_index = 0
|
||||
while(len(netsettings.slaves_blacklist) > 0):
|
||||
netsettings.slaves_blacklist.remove(0)
|
||||
@ -59,18 +59,18 @@ def init_data(netsettings):
|
||||
netsettings.active_job_index = 0
|
||||
while(len(netsettings.jobs) > 0):
|
||||
netsettings.jobs.remove(0)
|
||||
|
||||
|
||||
def verify_address(netsettings):
|
||||
init_file()
|
||||
|
||||
if netrender.init_address:
|
||||
netrender.init_address = False
|
||||
|
||||
|
||||
try:
|
||||
conn = clientConnection(netsettings.server_address, netsettings.server_port, scan = False)
|
||||
except:
|
||||
conn = None
|
||||
|
||||
|
||||
if conn:
|
||||
conn.close()
|
||||
else:
|
||||
@ -97,7 +97,7 @@ class RENDER_PT_network_settings(RenderButtonsPanel):
|
||||
|
||||
scene = context.scene
|
||||
netsettings = scene.network_render
|
||||
|
||||
|
||||
verify_address(netsettings)
|
||||
|
||||
layout.prop(netsettings, "mode", expand=True)
|
||||
@ -106,13 +106,13 @@ class RENDER_PT_network_settings(RenderButtonsPanel):
|
||||
layout.operator("render.netclientstart", icon='PLAY')
|
||||
|
||||
layout.prop(netsettings, "path")
|
||||
|
||||
|
||||
split = layout.split(percentage=0.7)
|
||||
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Server Adress:")
|
||||
col.prop(netsettings, "server_address", text="")
|
||||
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Port:")
|
||||
col.prop(netsettings, "server_port", text="")
|
||||
@ -145,7 +145,7 @@ class RENDER_PT_network_slave_settings(RenderButtonsPanel):
|
||||
layout.prop(rd, "threads_mode", expand=True)
|
||||
sub = layout.column()
|
||||
sub.enabled = rd.threads_mode == 'THREADS_FIXED'
|
||||
sub.prop(rd, "threads")
|
||||
sub.prop(rd, "threads")
|
||||
@rnaType
|
||||
class RENDER_PT_network_master_settings(RenderButtonsPanel):
|
||||
bl_label = "Master Settings"
|
||||
@ -164,7 +164,7 @@ class RENDER_PT_network_master_settings(RenderButtonsPanel):
|
||||
|
||||
layout.prop(netsettings, "master_broadcast")
|
||||
layout.prop(netsettings, "master_clear")
|
||||
|
||||
|
||||
@rnaType
|
||||
class RENDER_PT_network_job(RenderButtonsPanel):
|
||||
bl_label = "Job Settings"
|
||||
@ -182,7 +182,7 @@ class RENDER_PT_network_job(RenderButtonsPanel):
|
||||
netsettings = scene.network_render
|
||||
|
||||
verify_address(netsettings)
|
||||
|
||||
|
||||
if netsettings.server_address != "[default]":
|
||||
layout.operator("render.netclientanim", icon='RENDER_ANIMATION')
|
||||
layout.operator("render.netclientsend", icon='FILE_BLEND')
|
||||
@ -190,17 +190,17 @@ class RENDER_PT_network_job(RenderButtonsPanel):
|
||||
row = layout.row()
|
||||
row.operator("screen.render", text="Get Image", icon='RENDER_STILL')
|
||||
row.operator("screen.render", text="Get Animation", icon='RENDER_ANIMATION').animation = True
|
||||
|
||||
|
||||
split = layout.split(percentage=0.3)
|
||||
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Name:")
|
||||
col.label(text="Category:")
|
||||
|
||||
|
||||
col = split.column()
|
||||
col.prop(netsettings, "job_name", text="")
|
||||
col.prop(netsettings, "job_category", text="")
|
||||
|
||||
|
||||
row = layout.row()
|
||||
row.prop(netsettings, "priority")
|
||||
row.prop(netsettings, "chunks")
|
||||
|
@ -104,7 +104,7 @@ def clientConnection(address, port, report = None, scan = True):
|
||||
# else:
|
||||
if not scan:
|
||||
return None
|
||||
|
||||
|
||||
address, port = clientScan()
|
||||
if address == "":
|
||||
return None
|
||||
@ -174,28 +174,28 @@ def prefixPath(prefix_directory, file_path, prefix_path):
|
||||
return full_path
|
||||
|
||||
def getFileInfo(filepath, infos):
|
||||
process = subprocess.Popen([sys.argv[0], "-b", "-noaudio", filepath, "-P", __file__, "--"] + infos, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
process = subprocess.Popen([sys.argv[0], "-b", "-noaudio", filepath, "-P", __file__, "--"] + infos, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
stdout = bytes()
|
||||
while process.poll() == None:
|
||||
stdout += process.stdout.read(1024)
|
||||
|
||||
# read leftovers if needed
|
||||
stdout += process.stdout.read()
|
||||
|
||||
|
||||
stdout = str(stdout, encoding="utf8")
|
||||
|
||||
|
||||
values = [eval(v[1:].strip()) for v in stdout.split("\n") if v.startswith("$")]
|
||||
|
||||
|
||||
return values
|
||||
|
||||
|
||||
def thumbnail(filename):
|
||||
root = os.path.splitext(filename)[0]
|
||||
imagename = os.path.split(filename)[1]
|
||||
thumbname = root + ".jpg"
|
||||
|
||||
|
||||
if os.path.exists(thumbname):
|
||||
return thumbname
|
||||
|
||||
|
||||
if bpy:
|
||||
sce = bpy.data.scenes[0]
|
||||
sce.render_data.file_format = "JPEG"
|
||||
@ -203,10 +203,10 @@ def thumbnail(filename):
|
||||
bpy.ops.image.open(path = filename)
|
||||
img = bpy.data.images[imagename]
|
||||
img.save(thumbname, scene = sce)
|
||||
|
||||
|
||||
try:
|
||||
process = subprocess.Popen(["convert", thumbname, "-resize", "300x300", thumbname])
|
||||
process.wait()
|
||||
process.wait()
|
||||
return thumbname
|
||||
except:
|
||||
pass
|
||||
|
@ -37,7 +37,6 @@ ops = _ops_module.ops_fake_module
|
||||
import sys as _sys
|
||||
|
||||
|
||||
|
||||
def _main():
|
||||
|
||||
# security issue, dont allow the $CWD in the path.
|
||||
|
@ -135,7 +135,7 @@ class bpy_ops_submodule_op(object):
|
||||
def idname(self):
|
||||
# submod.foo -> SUBMOD_OT_foo
|
||||
return self.module.upper() + "_OT_" + self.func
|
||||
|
||||
|
||||
def idname_py(self):
|
||||
# submod.foo -> SUBMOD_OT_foo
|
||||
return self.module + "." + self.func
|
||||
|
@ -27,6 +27,7 @@ import bpy as _bpy
|
||||
import os as _os
|
||||
import sys as _sys
|
||||
|
||||
|
||||
def load_scripts(reload_scripts=False, refresh_scripts=False):
|
||||
import traceback
|
||||
import time
|
||||
@ -65,7 +66,7 @@ def load_scripts(reload_scripts=False, refresh_scripts=False):
|
||||
module_name = getattr(type_class, "__module__", "")
|
||||
|
||||
if module_name and module_name != "bpy.types": # hard coded for C types
|
||||
loaded_modules.add(module_name)
|
||||
loaded_modules.add(module_name)
|
||||
|
||||
for module_name in loaded_modules:
|
||||
print("Reloading:", module_name)
|
||||
|
@ -61,6 +61,7 @@ class Object(bpy_types.ID):
|
||||
name = self.name
|
||||
return [scene for scene in bpy.data.scenes if name in scene.objects]
|
||||
|
||||
|
||||
class _GenericBone:
|
||||
"""
|
||||
functions for bones, common between Armature/Pose/Edit bones.
|
||||
@ -89,24 +90,24 @@ class _GenericBone:
|
||||
i += 1
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
@property
|
||||
def x_axis(self):
|
||||
""" Vector pointing down the x-axis of the bone.
|
||||
"""
|
||||
return self.matrix.rotation_part() * Vector(1,0,0)
|
||||
|
||||
return self.matrix.rotation_part() * Vector(1.0, 0.0, 0.0)
|
||||
|
||||
@property
|
||||
def y_axis(self):
|
||||
""" Vector pointing down the x-axis of the bone.
|
||||
"""
|
||||
return self.matrix.rotation_part() * Vector(0,1,0)
|
||||
|
||||
return self.matrix.rotation_part() * Vector(0.0, 1.0, 0.0)
|
||||
|
||||
@property
|
||||
def z_axis(self):
|
||||
""" Vector pointing down the x-axis of the bone.
|
||||
"""
|
||||
return self.matrix.rotation_part() * Vector(0,0,1)
|
||||
return self.matrix.rotation_part() * Vector(0.0, 0.0, 1.0)
|
||||
|
||||
@property
|
||||
def basename(self):
|
||||
@ -244,6 +245,7 @@ class EditBone(StructRNA, _GenericBone):
|
||||
self.tail_radius *= scalar
|
||||
self.align_roll(matrix * z_vec)
|
||||
|
||||
|
||||
def ord_ind(i1, i2):
|
||||
if i1 < i2:
|
||||
return i1, i2
|
||||
@ -388,6 +390,7 @@ class MeshEdge(StructRNA):
|
||||
|
||||
class MeshFace(StructRNA):
|
||||
__slots__ = ()
|
||||
|
||||
@property
|
||||
def center(self):
|
||||
"""The midpoint of the face."""
|
||||
@ -464,7 +467,7 @@ class _GenericUI:
|
||||
def prepend(cls, draw_func):
|
||||
"""Prepend a draw function to this menu, takes the same arguments as the menus draw function."""
|
||||
draw_funcs = cls._dyn_ui_initialize()
|
||||
draw_funcs.insert(0, draw_func)
|
||||
draw_funcs.insert(0, draw_func)
|
||||
|
||||
|
||||
class Panel(StructRNA, _GenericUI):
|
||||
|
@ -126,7 +126,7 @@ def draw(layout, context, context_member, use_edit=True):
|
||||
|
||||
class PropertyPanel(bpy.types.Panel):
|
||||
"""
|
||||
The subclass should have its own poll function
|
||||
The subclass should have its own poll function
|
||||
and the variable '_context_path' MUST be set.
|
||||
"""
|
||||
bl_label = "Custom Properties"
|
||||
@ -269,4 +269,3 @@ class WM_OT_properties_remove(bpy.types.Operator):
|
||||
item = eval("context.%s" % self.properties.path)
|
||||
del item[self.properties.property]
|
||||
return {'FINISHED'}
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
#
|
||||
# ##### END GPL LICENSE BLOCK #####
|
||||
|
||||
# <pep8-80 compliant>
|
||||
# <pep8 compliant>
|
||||
import bpy
|
||||
import Mathutils
|
||||
from math import cos, sin, pi
|
||||
@ -82,7 +82,7 @@ class AddTorus(bpy.types.Operator):
|
||||
bl_undo = True
|
||||
|
||||
major_radius = FloatProperty(name="Major Radius",
|
||||
description="Radius from center of torus to center of it's cross section",
|
||||
description="Radius from the origin to the center of the cross sections",
|
||||
default=1.0, min=0.01, max=100.0)
|
||||
minor_radius = FloatProperty(name="Minor Radius",
|
||||
description="Radius of the torus' cross section",
|
||||
@ -94,7 +94,8 @@ class AddTorus(bpy.types.Operator):
|
||||
description="Number of segments for the minor ring of the torus",
|
||||
default=16, min=3, max=256)
|
||||
use_abso = BoolProperty(name="Use Int+Ext Controls",
|
||||
description="Use the Int / Ext controls for torus dimensions", default=False)
|
||||
description="Use the Int / Ext controls for torus dimensions",
|
||||
default=False)
|
||||
abso_major_rad = FloatProperty(name="Exterior Radius",
|
||||
description="Total Exterior Radius of the torus",
|
||||
default=1.0, min=0.01, max=100.0)
|
||||
@ -103,16 +104,17 @@ class AddTorus(bpy.types.Operator):
|
||||
default=0.5, min=0.01, max=100.0)
|
||||
|
||||
def execute(self, context):
|
||||
props = self.properties
|
||||
|
||||
if self.properties.use_abso == True:
|
||||
extra_helper = (self.properties.abso_major_rad - self.properties.abso_minor_rad) * 0.5
|
||||
self.properties.major_radius = self.properties.abso_minor_rad + extra_helper
|
||||
self.properties.minor_radius = extra_helper
|
||||
if props.use_abso == True:
|
||||
extra_helper = (props.abso_major_rad - props.abso_minor_rad) * 0.5
|
||||
props.major_radius = props.abso_minor_rad + extra_helper
|
||||
props.minor_radius = extra_helper
|
||||
|
||||
verts_loc, faces = add_torus(self.properties.major_radius,
|
||||
self.properties.minor_radius,
|
||||
self.properties.major_segments,
|
||||
self.properties.minor_segments)
|
||||
verts_loc, faces = add_torus(props.major_radius,
|
||||
props.minor_radius,
|
||||
props.major_segments,
|
||||
props.minor_segments)
|
||||
|
||||
mesh = bpy.data.meshes.new("Torus")
|
||||
|
||||
@ -133,12 +135,12 @@ class AddTorus(bpy.types.Operator):
|
||||
ob_new.selected = True
|
||||
|
||||
ob_new.location = scene.cursor_location
|
||||
|
||||
|
||||
obj_act = scene.objects.active
|
||||
|
||||
|
||||
if obj_act and obj_act.mode == 'EDIT':
|
||||
bpy.ops.object.mode_set(mode='OBJECT')
|
||||
|
||||
|
||||
obj_act.selected = True
|
||||
scene.update() # apply location
|
||||
#scene.objects.active = ob_new
|
||||
|
@ -16,10 +16,11 @@
|
||||
#
|
||||
# ##### END GPL LICENSE BLOCK #####
|
||||
|
||||
# <pep8-80 compliant>
|
||||
# <pep8 compliant>
|
||||
|
||||
import bpy
|
||||
|
||||
|
||||
class MeshSelectInteriorFaces(bpy.types.Operator):
|
||||
'''Select faces where all edges have more then 2 face users.'''
|
||||
|
||||
@ -69,23 +70,23 @@ class MeshMirrorUV(bpy.types.Operator):
|
||||
bl_label = "Copy Mirrored UV coords"
|
||||
bl_register = True
|
||||
bl_undo = True
|
||||
|
||||
|
||||
def poll(self, context):
|
||||
ob = context.active_object
|
||||
return (ob and ob.type == 'MESH')
|
||||
|
||||
|
||||
def execute(self, context):
|
||||
DIR = 1 # TODO, make an option
|
||||
|
||||
|
||||
from Mathutils import Vector
|
||||
|
||||
|
||||
ob = context.active_object
|
||||
is_editmode = (ob.mode == 'EDIT')
|
||||
if is_editmode:
|
||||
bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
|
||||
|
||||
mesh = ob.data
|
||||
|
||||
|
||||
# mirror lookups
|
||||
mirror_gt = {}
|
||||
mirror_lt = {}
|
||||
@ -109,7 +110,7 @@ class MeshMirrorUV(bpy.types.Operator):
|
||||
j = mirror_b.get(nco)
|
||||
if j is not None:
|
||||
vmap[i] = j
|
||||
|
||||
|
||||
|
||||
active_uv_layer = None
|
||||
for lay in mesh.uv_textures:
|
||||
@ -119,13 +120,13 @@ class MeshMirrorUV(bpy.types.Operator):
|
||||
|
||||
fuvs = [(uv.uv1, uv.uv2, uv.uv3, uv.uv4) for uv in active_uv_layer]
|
||||
fuvs_cpy = [(uv[0].copy(), uv[1].copy(), uv[2].copy(), uv[3].copy()) for uv in fuvs]
|
||||
|
||||
|
||||
# as a list
|
||||
faces = mesh.faces[:]
|
||||
|
||||
|
||||
fuvsel = [(False not in uv.uv_selected) for uv in active_uv_layer]
|
||||
fcents = [f.center for f in faces]
|
||||
|
||||
|
||||
# find mirror faces
|
||||
mirror_fm = {}
|
||||
for i, f in enumerate(faces):
|
||||
@ -133,7 +134,7 @@ class MeshMirrorUV(bpy.types.Operator):
|
||||
verts.sort()
|
||||
verts = tuple(verts)
|
||||
mirror_fm[verts] = i
|
||||
|
||||
|
||||
fmap = {}
|
||||
for i, f in enumerate(faces):
|
||||
verts = [vmap.get(j) for j in f.verts]
|
||||
@ -142,10 +143,10 @@ class MeshMirrorUV(bpy.types.Operator):
|
||||
j = mirror_fm.get(tuple(verts))
|
||||
if j is not None:
|
||||
fmap[i] = j
|
||||
|
||||
|
||||
done = [False] * len(faces)
|
||||
for i, j in fmap.items():
|
||||
|
||||
|
||||
if not fuvsel[i] or not fuvsel[j]:
|
||||
continue
|
||||
elif DIR == 0 and fcents[i][0] < 0.0:
|
||||
@ -154,19 +155,19 @@ class MeshMirrorUV(bpy.types.Operator):
|
||||
continue
|
||||
|
||||
# copy UVs
|
||||
uv1= fuvs[i]
|
||||
uv2= fuvs_cpy[j]
|
||||
|
||||
uv1 = fuvs[i]
|
||||
uv2 = fuvs_cpy[j]
|
||||
|
||||
# get the correct rotation
|
||||
v1 = faces[j].verts[:]
|
||||
v2 = [vmap[k] for k in faces[i].verts[:]]
|
||||
|
||||
|
||||
|
||||
for k in range(len(uv1)):
|
||||
k_map = v1.index(v2[k])
|
||||
uv1[k].x = -(uv2[k_map].x-0.5) + 0.5
|
||||
uv1[k].x = - (uv2[k_map].x - 0.5) + 0.5
|
||||
uv1[k].y = uv2[k_map].y
|
||||
|
||||
|
||||
if is_editmode:
|
||||
bpy.ops.object.mode_set(mode='EDIT', toggle=False)
|
||||
|
||||
|
@ -109,17 +109,17 @@ class SubdivisionSet(bpy.types.Operator):
|
||||
mod.sculpt_levels = level
|
||||
elif obj.mode == 'OBJECT':
|
||||
if mod.levels != level:
|
||||
mod.levels = level
|
||||
mod.levels = level
|
||||
return
|
||||
else:
|
||||
if obj.mode == 'SCULPT':
|
||||
if mod.sculpt_levels+level <= mod.total_levels:
|
||||
if mod.sculpt_levels + level <= mod.total_levels:
|
||||
mod.sculpt_levels += level
|
||||
elif obj.mode == 'OBJECT':
|
||||
if mod.levels+level <= mod.total_levels:
|
||||
if mod.levels + level <= mod.total_levels:
|
||||
mod.levels += level
|
||||
return
|
||||
|
||||
|
||||
elif mod.type == 'SUBSURF':
|
||||
if relative:
|
||||
mod.levels += level
|
||||
@ -160,6 +160,7 @@ class ShapeTransfer(bpy.types.Operator):
|
||||
default=False)
|
||||
|
||||
def _main(self, ob_act, objects, mode='OFFSET', use_clamp=False):
|
||||
|
||||
def me_nos(verts):
|
||||
return [v.normal.copy() for v in verts]
|
||||
|
||||
@ -328,12 +329,12 @@ class JoinUVs(bpy.types.Operator):
|
||||
bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
|
||||
|
||||
len_faces = len(mesh.faces)
|
||||
|
||||
|
||||
uv_array = array.array('f', [0.0] * 8) * len_faces # seems to be the fastest way to create an array
|
||||
mesh.active_uv_texture.data.foreach_get("uv_raw", uv_array)
|
||||
|
||||
objects = context.selected_editable_objects[:]
|
||||
|
||||
|
||||
for obj_other in objects:
|
||||
if obj_other.type == 'MESH':
|
||||
obj_other.data.tag = False
|
||||
@ -344,7 +345,7 @@ class JoinUVs(bpy.types.Operator):
|
||||
if mesh_other != mesh:
|
||||
if mesh_other.tag == False:
|
||||
mesh_other.tag = True
|
||||
|
||||
|
||||
if len(mesh_other.faces) != len_faces:
|
||||
self.report({'WARNING'}, "Object: %s, Mesh: '%s' has %d faces, expected %d\n" % (obj_other.name, mesh_other.name, len(mesh_other.faces), len_faces))
|
||||
else:
|
||||
@ -352,7 +353,7 @@ class JoinUVs(bpy.types.Operator):
|
||||
if not uv_other:
|
||||
mesh_other.uv_texture_add() # should return the texture it adds
|
||||
uv_other = mesh_other.active_uv_texture
|
||||
|
||||
|
||||
# finally do the copy
|
||||
uv_other.data.foreach_set("uv_raw", uv_array)
|
||||
|
||||
|
@ -29,6 +29,7 @@ import subprocess
|
||||
import os
|
||||
import platform
|
||||
|
||||
|
||||
def guess_player_path(preset):
|
||||
if preset == 'BLENDER24':
|
||||
player_path = 'blender'
|
||||
|
@ -16,11 +16,12 @@
|
||||
#
|
||||
# ##### END GPL LICENSE BLOCK #####
|
||||
|
||||
# <pep8-80 compliant>
|
||||
# <pep8 compliant>
|
||||
|
||||
import bpy
|
||||
from bpy.props import *
|
||||
|
||||
|
||||
class ExportUVLayout(bpy.types.Operator):
|
||||
'''Export the Mesh as SVG.'''
|
||||
|
||||
@ -28,15 +29,15 @@ class ExportUVLayout(bpy.types.Operator):
|
||||
bl_label = "Export UV Layout"
|
||||
bl_register = True
|
||||
bl_undo = True
|
||||
|
||||
|
||||
path = StringProperty(name="File Path", description="File path used for exporting the SVG file", maxlen=1024, default="")
|
||||
check_existing = BoolProperty(name="Check Existing", description="Check and warn on overwriting existing files", default=True, hidden=True)
|
||||
only_selected = BoolProperty(name="Only Selected", description="Export Only the selected UVs", default=False)
|
||||
|
||||
|
||||
def poll(self, context):
|
||||
obj = context.active_object
|
||||
return (obj and obj.type == 'MESH')
|
||||
|
||||
|
||||
def _image_size(self, context, default_width=1024, default_height=1024):
|
||||
# fallback if not in image context.
|
||||
image_width, image_height = default_width, default_height
|
||||
@ -49,14 +50,14 @@ class ExportUVLayout(bpy.types.Operator):
|
||||
# incase no data is found.
|
||||
if width and height:
|
||||
image_width, image_height = width, height
|
||||
|
||||
|
||||
return image_width, image_height
|
||||
|
||||
def execute(self, context):
|
||||
# for making an XML compatible string
|
||||
from xml.sax.saxutils import escape
|
||||
from os.path import basename
|
||||
|
||||
|
||||
obj = context.active_object
|
||||
is_editmode = (obj.mode == 'EDIT')
|
||||
if is_editmode:
|
||||
@ -65,7 +66,7 @@ class ExportUVLayout(bpy.types.Operator):
|
||||
image_width, image_height = self._image_size(context)
|
||||
|
||||
mesh = obj.data
|
||||
|
||||
|
||||
active_uv_layer = None
|
||||
for lay in mesh.uv_textures:
|
||||
if lay.active:
|
||||
@ -74,21 +75,21 @@ class ExportUVLayout(bpy.types.Operator):
|
||||
|
||||
fuvs = [(uv.uv1, uv.uv2, uv.uv3, uv.uv4) for uv in active_uv_layer]
|
||||
fuvs_cpy = [(uv[0].copy(), uv[1].copy(), uv[2].copy(), uv[3].copy()) for uv in fuvs]
|
||||
|
||||
|
||||
# as a list
|
||||
faces = mesh.faces[:]
|
||||
|
||||
|
||||
fuvsel = [(False not in uv.uv_selected) for uv in active_uv_layer]
|
||||
|
||||
|
||||
file = open(self.properties.path, "w")
|
||||
fw = file.write
|
||||
|
||||
|
||||
fw('<?xml version="1.0" standalone="no"?>\n')
|
||||
fw('<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" \n')
|
||||
fw(' "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')
|
||||
fw('<svg width="%dpx" height="%dpx" viewBox="0px 0px %dpx %dpx"\n' % (image_width, image_height, image_width, image_height))
|
||||
fw(' xmlns="http://www.w3.org/2000/svg" version="1.1">\n')
|
||||
|
||||
|
||||
desc = "%s, %s, %s (Blender %s)" % (basename(bpy.data.filename), obj.name, mesh.name, bpy.app.version_string)
|
||||
fw('<desc>%s</desc>\n' % escape(desc))
|
||||
|
||||
@ -97,14 +98,14 @@ class ExportUVLayout(bpy.types.Operator):
|
||||
fill_default = 'fill="grey"'
|
||||
for mat in mesh.materials if mesh.materials else [None]:
|
||||
if mat:
|
||||
fill_settings.append('fill="rgb(%d, %d, %d)"' % tuple(int(c*255) for c in mat.diffuse_color))
|
||||
fill_settings.append('fill="rgb(%d, %d, %d)"' % tuple(int(c * 255) for c in mat.diffuse_color))
|
||||
else:
|
||||
fill_settings.append(fill_default)
|
||||
|
||||
|
||||
only_selected = self.properties.only_selected
|
||||
|
||||
|
||||
for i, uv in enumerate(active_uv_layer):
|
||||
|
||||
|
||||
if only_selected and False in uv.uv_selected:
|
||||
continue
|
||||
|
||||
@ -112,7 +113,7 @@ class ExportUVLayout(bpy.types.Operator):
|
||||
uvs = uv.uv1, uv.uv2, uv.uv3
|
||||
else:
|
||||
uvs = uv.uv1, uv.uv2, uv.uv3, uv.uv4
|
||||
|
||||
|
||||
try: # rare cases material index is invalid.
|
||||
fill = fill_settings[faces[i].material_index]
|
||||
except IndexError:
|
||||
@ -120,14 +121,14 @@ class ExportUVLayout(bpy.types.Operator):
|
||||
|
||||
fw('<polygon %s fill-opacity="0.5" stroke="black" stroke-width="1px" \n' % fill)
|
||||
fw(' points="')
|
||||
|
||||
|
||||
for j, uv in enumerate(uvs):
|
||||
x, y = uv.x, 1.0 - uv.y
|
||||
fw('%.3f,%.3f ' % (x * image_width, y * image_height))
|
||||
fw('" />\n')
|
||||
fw('\n')
|
||||
fw('</svg>\n')
|
||||
|
||||
|
||||
if is_editmode:
|
||||
bpy.ops.object.mode_set(mode='EDIT', toggle=False)
|
||||
|
||||
@ -141,6 +142,7 @@ class ExportUVLayout(bpy.types.Operator):
|
||||
# Register the operator
|
||||
bpy.types.register(ExportUVLayout)
|
||||
|
||||
|
||||
def menu_func(self, context):
|
||||
default_path = bpy.data.filename.replace(".blend", ".svg")
|
||||
self.layout.operator(ExportUVLayout.bl_idname).path = default_path
|
||||
|
@ -43,7 +43,9 @@ rna_reverse_prop = BoolProperty(name="Reverse",
|
||||
description="Cycle backwards", default=False)
|
||||
|
||||
rna_relative_prop = BoolProperty(name="Relative",
|
||||
description="Apply relative to the current value (delta)", default=False)
|
||||
description="Apply relative to the current value (delta)",
|
||||
default=False)
|
||||
|
||||
|
||||
def context_path_validate(context, path):
|
||||
import sys
|
||||
@ -105,7 +107,8 @@ class WM_OT_context_set_float(bpy.types.Operator): # same as enum
|
||||
bl_undo = True
|
||||
|
||||
path = rna_path_prop
|
||||
value = FloatProperty(name="Value", description="Assignment value", default=0.0)
|
||||
value = FloatProperty(name="Value",
|
||||
description="Assignment value", default=0.0)
|
||||
relative = rna_relative_prop
|
||||
|
||||
execute = execute_context_assign
|
||||
|
@ -63,4 +63,4 @@ menu_func = lambda self, context: self.layout.operator("export.some_data", text=
|
||||
bpy.types.INFO_MT_file_export.append(menu_func)
|
||||
|
||||
if __name__ == "__main__":
|
||||
bpy.ops.export.some_data('INVOKE_DEFAULT', path="/tmp/test.ply")
|
||||
bpy.ops.export.some_data('INVOKE_DEFAULT', path="/tmp/test.ply")
|
||||
|
@ -17,7 +17,7 @@ def main(context):
|
||||
for j, v_idx in enumerate(mesh.faces[i].verts):
|
||||
if uv.uv_selected[j]:
|
||||
# apply the location of the vertex as a UV
|
||||
uvs[j][:] = mesh.verts[v_idx].co.xy
|
||||
uvs[j][:] = mesh.verts[v_idx].co.xy
|
||||
|
||||
|
||||
if is_editmode:
|
||||
|
@ -5,10 +5,10 @@ class OBJECT_PT_hello(bpy.types.Panel):
|
||||
bl_space_type = "PROPERTIES"
|
||||
bl_region_type = "WINDOW"
|
||||
bl_context = "object"
|
||||
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
|
||||
obj = context.object
|
||||
|
||||
row = layout.row()
|
||||
|
@ -24,6 +24,7 @@ narrowui = 180
|
||||
################################################
|
||||
# Generic Panels (Independent of DataType)
|
||||
|
||||
|
||||
class MotionPathButtonsPanel(bpy.types.Panel):
|
||||
bl_space_type = 'PROPERTIES'
|
||||
bl_region_type = 'WINDOW'
|
||||
@ -31,9 +32,9 @@ class MotionPathButtonsPanel(bpy.types.Panel):
|
||||
|
||||
def draw_settings(self, context, avs, wide_ui, bones=False):
|
||||
layout = self.layout
|
||||
|
||||
|
||||
mps = avs.motion_paths
|
||||
|
||||
|
||||
if wide_ui:
|
||||
layout.prop(mps, "type", expand=True)
|
||||
else:
|
||||
@ -61,6 +62,7 @@ class MotionPathButtonsPanel(bpy.types.Panel):
|
||||
col.prop(mps, "highlight_keyframes", text="Keyframes")
|
||||
col.prop(mps, "show_keyframe_numbers", text="Keyframe Numbers")
|
||||
|
||||
|
||||
# FIXME: this panel still needs to be ported so that it will work correctly with animviz
|
||||
class OnionSkinButtonsPanel(bpy.types.Panel):
|
||||
bl_space_type = 'PROPERTIES'
|
||||
@ -99,21 +101,22 @@ class OnionSkinButtonsPanel(bpy.types.Panel):
|
||||
################################################
|
||||
# Specific Panels for DataTypes
|
||||
|
||||
|
||||
class OBJECT_PT_motion_paths(MotionPathButtonsPanel):
|
||||
#bl_label = "Object Motion Paths"
|
||||
bl_context = "object"
|
||||
|
||||
def poll(self, context):
|
||||
return (context.object)
|
||||
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
ob = context.object
|
||||
|
||||
ob = context.object
|
||||
wide_ui = context.region.width > narrowui
|
||||
|
||||
|
||||
self.draw_settings(context, ob.animation_visualisation, wide_ui)
|
||||
|
||||
|
||||
layout.separator()
|
||||
|
||||
split = layout.split()
|
||||
@ -124,7 +127,8 @@ class OBJECT_PT_motion_paths(MotionPathButtonsPanel):
|
||||
if wide_ui:
|
||||
col = split.column()
|
||||
col.operator("object.paths_clear", text="Clear Paths")
|
||||
|
||||
|
||||
|
||||
class DATA_PT_motion_paths(MotionPathButtonsPanel):
|
||||
#bl_label = "Bone Motion Paths"
|
||||
bl_context = "data"
|
||||
@ -132,15 +136,15 @@ class DATA_PT_motion_paths(MotionPathButtonsPanel):
|
||||
def poll(self, context):
|
||||
# XXX: include posemode check?
|
||||
return (context.object) and (context.armature)
|
||||
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
ob = context.object
|
||||
|
||||
ob = context.object
|
||||
wide_ui = context.region.width > narrowui
|
||||
|
||||
|
||||
self.draw_settings(context, ob.pose.animation_visualisation, wide_ui, bones=True)
|
||||
|
||||
|
||||
layout.separator()
|
||||
|
||||
split = layout.split()
|
||||
|
@ -162,7 +162,10 @@ class DATA_PT_bone_groups(DataButtonsPanel):
|
||||
#row.operator("object.bone_group_select", text="Select")
|
||||
#row.operator("object.bone_group_deselect", text="Deselect")
|
||||
|
||||
|
||||
# TODO: this panel will soon be depreceated too
|
||||
|
||||
|
||||
class DATA_PT_ghost(DataButtonsPanel):
|
||||
bl_label = "Ghost"
|
||||
|
||||
|
@ -121,7 +121,6 @@ class DATA_PT_camera(DataButtonsPanel):
|
||||
if cam.dof_object != None:
|
||||
col.enabled = False
|
||||
col.prop(cam, "dof_distance", text="Distance")
|
||||
|
||||
|
||||
|
||||
class DATA_PT_camera_display(DataButtonsPanel):
|
||||
|
@ -283,7 +283,7 @@ class DATA_PT_font(DataButtonsPanel):
|
||||
wide_ui = context.region.width > narrowui
|
||||
|
||||
layout.template_ID(text, "font", open="font.open", unlink="font.unlink")
|
||||
|
||||
|
||||
#if wide_ui:
|
||||
# layout.prop(text, "font")
|
||||
#else:
|
||||
|
@ -156,7 +156,7 @@ class DATA_PT_shape_keys(DataButtonsPanel):
|
||||
ob = context.object
|
||||
key = ob.data.shape_keys
|
||||
if key and len(key.keys):
|
||||
# this is so that we get the active shapekey from the
|
||||
# this is so that we get the active shapekey from the
|
||||
# shapekeys block, not from object data
|
||||
kb = key.keys[ob.active_shape_key.name]
|
||||
else:
|
||||
@ -299,4 +299,3 @@ bpy.types.register(DATA_PT_uv_texture)
|
||||
bpy.types.register(DATA_PT_vertex_colors)
|
||||
|
||||
bpy.types.register(DATA_PT_custom_props_mesh)
|
||||
|
||||
|
@ -140,5 +140,3 @@ bpy.types.register(DATA_PT_metaball)
|
||||
bpy.types.register(DATA_PT_metaball_element)
|
||||
|
||||
bpy.types.register(DATA_PT_custom_props_metaball)
|
||||
|
||||
|
||||
|
@ -22,6 +22,7 @@ import bpy
|
||||
narrowui = 180
|
||||
narrowmod = 260
|
||||
|
||||
|
||||
class DataButtonsPanel(bpy.types.Panel):
|
||||
bl_space_type = 'PROPERTIES'
|
||||
bl_region_type = 'WINDOW'
|
||||
@ -37,7 +38,7 @@ class DATA_PT_modifiers(DataButtonsPanel):
|
||||
ob = context.object
|
||||
wide_ui = context.region.width > narrowui
|
||||
compact_mod = context.region.width < narrowmod
|
||||
|
||||
|
||||
layout.operator_menu_enum("object.modifier_add", "type")
|
||||
|
||||
for md in ob.modifiers:
|
||||
@ -602,22 +603,22 @@ class DATA_PT_modifiers(DataButtonsPanel):
|
||||
|
||||
def SOLIDIFY(self, layout, ob, md, wide_ui):
|
||||
layout.prop(md, "offset")
|
||||
|
||||
|
||||
split = layout.split()
|
||||
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Crease:")
|
||||
col.prop(md, "edge_crease_inner",text="Inner")
|
||||
col.prop(md, "edge_crease_inner", text="Inner")
|
||||
col.prop(md, "edge_crease_outer", text="Outer")
|
||||
col.prop(md, "edge_crease_rim", text="Rim")
|
||||
|
||||
|
||||
if wide_ui:
|
||||
col = split.column()
|
||||
col.label()
|
||||
col.prop(md, "use_rim")
|
||||
col.prop(md, "use_even_offset")
|
||||
col.prop(md, "use_quality_normals")
|
||||
|
||||
|
||||
# col = layout.column()
|
||||
# col.label(text="Vertex Group:")
|
||||
# col.prop_object(md, "vertex_group", ob, "vertex_groups", text="")
|
||||
@ -728,4 +729,4 @@ class DATA_PT_modifiers(DataButtonsPanel):
|
||||
col.prop(md, "width", slider=True)
|
||||
col.prop(md, "narrowness", slider=True)
|
||||
|
||||
bpy.types.register(DATA_PT_modifiers)
|
||||
bpy.types.register(DATA_PT_modifiers)
|
||||
|
@ -103,7 +103,7 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel):
|
||||
col = row.column(align=True)
|
||||
col.operator("object.material_slot_add", icon='ZOOMIN', text="")
|
||||
col.operator("object.material_slot_remove", icon='ZOOMOUT', text="")
|
||||
|
||||
|
||||
col.menu("MATERIAL_MT_specials", icon='DOWNARROW_HLT', text="")
|
||||
|
||||
if ob.mode == 'EDIT':
|
||||
@ -653,6 +653,7 @@ class MATERIAL_PT_transp(MaterialButtonsPanel):
|
||||
sub.prop(rayt, "gloss_threshold", text="Threshold")
|
||||
sub.prop(rayt, "gloss_samples", text="Samples")
|
||||
|
||||
|
||||
class MATERIAL_PT_transp_game(MaterialButtonsPanel):
|
||||
bl_label = "Transparency"
|
||||
bl_default_closed = True
|
||||
@ -686,7 +687,7 @@ class MATERIAL_PT_transp_game(MaterialButtonsPanel):
|
||||
|
||||
col = split.column()
|
||||
col.prop(mat, "alpha")
|
||||
|
||||
|
||||
|
||||
class MATERIAL_PT_halo(MaterialButtonsPanel):
|
||||
bl_label = "Halo"
|
||||
@ -788,6 +789,7 @@ bpy.types.register(MATERIAL_PT_options)
|
||||
bpy.types.register(MATERIAL_PT_shadow)
|
||||
bpy.types.register(MATERIAL_PT_transp_game)
|
||||
|
||||
|
||||
class VolumeButtonsPanel(bpy.types.Panel):
|
||||
bl_space_type = 'PROPERTIES'
|
||||
bl_region_type = 'WINDOW'
|
||||
|
@ -179,7 +179,7 @@ class OBJECT_PT_groups(ObjectButtonsPanel):
|
||||
if wide_ui:
|
||||
col = split.column()
|
||||
col.prop(group, "dupli_offset", text="")
|
||||
|
||||
|
||||
prop = col.operator("wm.context_set_value", text="From Cursor")
|
||||
prop.path = "object.group_users[%d].dupli_offset" % index
|
||||
prop.value = value
|
||||
|
@ -460,12 +460,12 @@ class ConstraintButtonsPanel(bpy.types.Panel):
|
||||
layout.prop(con, "use_offset")
|
||||
|
||||
self.space_template(layout, con, wide_ui)
|
||||
|
||||
|
||||
def COPY_TRANSFORMS(self, context, layout, con, wide_ui):
|
||||
self.target_template(layout, con, wide_ui)
|
||||
|
||||
self.space_template(layout, con, wide_ui)
|
||||
|
||||
|
||||
|
||||
#def SCRIPT(self, context, layout, con):
|
||||
|
||||
@ -566,7 +566,7 @@ class ConstraintButtonsPanel(bpy.types.Panel):
|
||||
if wide_ui:
|
||||
row.label(text="Min/Max:")
|
||||
row.prop(con, "floor_location", expand=True)
|
||||
|
||||
|
||||
self.space_template(layout, con, wide_ui)
|
||||
|
||||
def RIGID_BODY_JOINT(self, context, layout, con, wide_ui):
|
||||
|
@ -168,6 +168,7 @@ class RENDER_PT_layers(RenderButtonsPanel):
|
||||
row.prop(rl, "pass_refraction")
|
||||
row.prop(rl, "pass_refraction_exclude", text="", icon='X')
|
||||
|
||||
|
||||
class RENDER_PT_shading(RenderButtonsPanel):
|
||||
bl_label = "Shading"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
||||
@ -567,12 +568,12 @@ class RENDER_PT_bake(RenderButtonsPanel):
|
||||
wide_ui = context.region.width > narrowui
|
||||
|
||||
layout.operator("object.bake_image", icon='RENDER_STILL')
|
||||
|
||||
|
||||
if wide_ui:
|
||||
layout.prop(rd, "bake_type")
|
||||
else:
|
||||
layout.prop(rd, "bake_type", text="")
|
||||
|
||||
|
||||
if rd.bake_type == 'NORMALS':
|
||||
if wide_ui:
|
||||
layout.prop(rd, "bake_normal_space")
|
||||
@ -580,19 +581,19 @@ class RENDER_PT_bake(RenderButtonsPanel):
|
||||
layout.prop(rd, "bake_normal_space", text="")
|
||||
elif rd.bake_type in ('DISPLACEMENT', 'AO'):
|
||||
layout.prop(rd, "bake_normalized")
|
||||
|
||||
|
||||
# col.prop(rd, "bake_aa_mode")
|
||||
# col.prop(rd, "bake_enable_aa")
|
||||
|
||||
|
||||
layout.separator()
|
||||
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.prop(rd, "bake_clear")
|
||||
col.prop(rd, "bake_margin")
|
||||
col.prop(rd, "bake_quad_split", text="Split")
|
||||
|
||||
|
||||
if wide_ui:
|
||||
col = split.column()
|
||||
col.prop(rd, "bake_active")
|
||||
@ -601,7 +602,7 @@ class RENDER_PT_bake(RenderButtonsPanel):
|
||||
sub.prop(rd, "bake_distance")
|
||||
sub.prop(rd, "bake_bias")
|
||||
|
||||
|
||||
|
||||
bpy.types.register(RENDER_MT_presets)
|
||||
bpy.types.register(RENDER_PT_render)
|
||||
bpy.types.register(RENDER_PT_layers)
|
||||
|
@ -74,7 +74,7 @@ class SCENE_PT_unit(SceneButtonsPanel):
|
||||
if wide_ui:
|
||||
col = split.column()
|
||||
col.prop(unit, "use_separate")
|
||||
|
||||
|
||||
layout.column().prop(unit, "rotation_units")
|
||||
|
||||
|
||||
@ -180,6 +180,7 @@ class SCENE_PT_physics(SceneButtonsPanel):
|
||||
else:
|
||||
layout.column().prop(scene, "gravity", text="")
|
||||
|
||||
|
||||
class SCENE_PT_simplify(SceneButtonsPanel):
|
||||
bl_label = "Simplify"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
||||
@ -188,7 +189,7 @@ class SCENE_PT_simplify(SceneButtonsPanel):
|
||||
scene = context.scene
|
||||
rd = scene.render_data
|
||||
self.layout.prop(rd, "use_simplify", text="")
|
||||
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
scene = context.scene
|
||||
@ -216,4 +217,3 @@ bpy.types.register(SCENE_PT_physics)
|
||||
bpy.types.register(SCENE_PT_simplify)
|
||||
|
||||
bpy.types.register(SCENE_PT_custom_props)
|
||||
|
||||
|
@ -103,23 +103,23 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel):
|
||||
col = row.column(align=True)
|
||||
col.operator("texture.slot_move", text="", icon='TRIA_UP').type = 'UP'
|
||||
col.operator("texture.slot_move", text="", icon='TRIA_DOWN').type = 'DOWN'
|
||||
|
||||
|
||||
if wide_ui:
|
||||
split = layout.split(percentage=0.65)
|
||||
col = split.column()
|
||||
else:
|
||||
col = layout.column()
|
||||
|
||||
|
||||
if tex_collection:
|
||||
col.template_ID(idblock, "active_texture", new="texture.new")
|
||||
elif node:
|
||||
col.template_ID(node, "texture", new="texture.new")
|
||||
elif idblock:
|
||||
col.template_ID(idblock, "texture", new="texture.new")
|
||||
|
||||
|
||||
if space.pin_id:
|
||||
col.template_ID(space, "pin_id")
|
||||
|
||||
|
||||
if wide_ui:
|
||||
col = split.column()
|
||||
|
||||
@ -281,7 +281,7 @@ class TEXTURE_PT_influence(TextureSlotPanel):
|
||||
idblock = context_tex_datablock(context)
|
||||
if type(idblock) == bpy.types.Brush:
|
||||
return False
|
||||
|
||||
|
||||
return context.texture_slot
|
||||
|
||||
def draw(self, context):
|
||||
@ -848,7 +848,7 @@ class TEXTURE_PT_voxeldata(TextureButtonsPanel):
|
||||
layout.prop(vd, "domain_object")
|
||||
layout.prop(vd, "smoke_data_type")
|
||||
elif vd.file_format == 'IMAGE_SEQUENCE':
|
||||
layout.template_image(tex, "image", tex.image_user)
|
||||
layout.template_image(tex, "image", tex.image_user)
|
||||
|
||||
layout.prop(vd, "still")
|
||||
row = layout.row()
|
||||
|
@ -181,6 +181,7 @@ class WORLD_PT_ambient_occlusion(WorldButtonsPanel):
|
||||
split.prop(light, "ao_factor", text="Factor")
|
||||
split.prop(light, "ao_blend_mode", text="")
|
||||
|
||||
|
||||
class WORLD_PT_environment_lighting(WorldButtonsPanel):
|
||||
bl_label = "Environment Lighting"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
||||
@ -199,6 +200,7 @@ class WORLD_PT_environment_lighting(WorldButtonsPanel):
|
||||
split.prop(light, "environment_energy", text="Energy")
|
||||
split.prop(light, "environment_color", text="")
|
||||
|
||||
|
||||
class WORLD_PT_indirect_lighting(WorldButtonsPanel):
|
||||
bl_label = "Indirect Lighting"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
||||
@ -217,6 +219,7 @@ class WORLD_PT_indirect_lighting(WorldButtonsPanel):
|
||||
split.prop(light, "indirect_factor", text="Factor")
|
||||
split.prop(light, "indirect_bounces", text="Bounces")
|
||||
|
||||
|
||||
class WORLD_PT_gather(WorldButtonsPanel):
|
||||
bl_label = "Gather"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
||||
|
@ -70,7 +70,7 @@ class GRAPH_MT_view(bpy.types.Menu):
|
||||
|
||||
layout.operator("graph.properties", icon='MENU_PANEL')
|
||||
layout.separator()
|
||||
|
||||
|
||||
layout.prop(st, "realtime_updates")
|
||||
layout.prop(st, "show_cframe_indicator")
|
||||
layout.prop(st, "show_cursor")
|
||||
|
@ -387,22 +387,24 @@ class IMAGE_PT_game_properties(bpy.types.Panel):
|
||||
col.separator()
|
||||
col.prop(ima, "mapping", expand=True)
|
||||
|
||||
|
||||
class IMAGE_PT_view_histogram(bpy.types.Panel):
|
||||
bl_space_type = 'IMAGE_EDITOR'
|
||||
bl_region_type = 'PREVIEW'
|
||||
bl_label = "Histogram"
|
||||
|
||||
|
||||
def poll(self, context):
|
||||
sima = context.space_data
|
||||
return (sima and sima.image)
|
||||
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
sima = context.space_data
|
||||
|
||||
|
||||
layout.template_histogram(sima, "histogram")
|
||||
|
||||
|
||||
class IMAGE_PT_view_properties(bpy.types.Panel):
|
||||
bl_space_type = 'IMAGE_EDITOR'
|
||||
bl_region_type = 'UI'
|
||||
|
@ -90,7 +90,7 @@ class INFO_MT_file(bpy.types.Menu):
|
||||
layout.separator()
|
||||
|
||||
layout.operator("screen.userpref_show", text="User Preferences...", icon='PREFERENCES')
|
||||
|
||||
|
||||
layout.operator_context = 'EXEC_AREA'
|
||||
layout.operator("wm.read_homefile", text="Load Factory Settings").factory = True
|
||||
|
||||
@ -129,6 +129,7 @@ class INFO_MT_file_open_recent(bpy.types.Menu):
|
||||
layout.operator("wm.open_mainfile", text=line, icon='FILE_BLEND').path = line
|
||||
file.close()
|
||||
|
||||
|
||||
class INFO_MT_file_import(bpy.types.Menu):
|
||||
bl_idname = "INFO_MT_file_import"
|
||||
bl_label = "Import"
|
||||
|
@ -120,7 +120,7 @@ class NODE_MT_node(bpy.types.Menu):
|
||||
|
||||
layout.separator()
|
||||
layout.operator("node.link_make")
|
||||
layout.operator("node.link_make", text="Make and Replace Links").replace=True
|
||||
layout.operator("node.link_make", text="Make and Replace Links").replace = True
|
||||
|
||||
layout.separator()
|
||||
layout.operator("node.group_edit")
|
||||
|
@ -18,10 +18,14 @@
|
||||
|
||||
# <pep8 compliant>
|
||||
import bpy
|
||||
import os, re, shutil
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
|
||||
|
||||
# General UI Theme Settings (User Interface)
|
||||
def ui_items_general(col, context):
|
||||
""" General UI Theme Settings (User Interface)
|
||||
"""
|
||||
row = col.row()
|
||||
sub = row.column()
|
||||
sub.prop(context, "outline")
|
||||
@ -38,9 +42,10 @@ def ui_items_general(col, context):
|
||||
subsub.active = context.shaded
|
||||
subsub.prop(context, "shadetop")
|
||||
subsub.prop(context, "shadedown")
|
||||
|
||||
|
||||
col.separator()
|
||||
|
||||
|
||||
|
||||
def opengl_lamp_buttons(column, lamp):
|
||||
split = column.split(percentage=0.1)
|
||||
|
||||
@ -236,14 +241,14 @@ class USERPREF_PT_interface(bpy.types.Panel):
|
||||
col.prop(view, "auto_perspective")
|
||||
col.prop(view, "smooth_view")
|
||||
col.prop(view, "rotation_angle")
|
||||
|
||||
|
||||
col.separator()
|
||||
col.separator()
|
||||
|
||||
|
||||
col.label(text="2D Viewports:")
|
||||
col.prop(view, "view2d_grid_minimum_spacing", text="Minimum Grid Spacing")
|
||||
col.prop(view, "timecode_style")
|
||||
|
||||
|
||||
row.separator()
|
||||
row.separator()
|
||||
|
||||
@ -427,10 +432,10 @@ class USERPREF_PT_system(bpy.types.Panel):
|
||||
col.separator()
|
||||
col.separator()
|
||||
col.separator()
|
||||
|
||||
|
||||
col.label(text="Screencast:")
|
||||
col.prop(system, "screencast_fps")
|
||||
col.prop(system, "screencast_wait_time")
|
||||
col.prop(system, "screencast_wait_time")
|
||||
col.separator()
|
||||
col.separator()
|
||||
col.separator()
|
||||
@ -448,7 +453,7 @@ class USERPREF_PT_system(bpy.types.Panel):
|
||||
#col.separator()
|
||||
|
||||
#col.prop(system, "use_textured_fonts")
|
||||
|
||||
|
||||
|
||||
# 2. Column
|
||||
column = split.column()
|
||||
@ -475,7 +480,7 @@ class USERPREF_PT_system(bpy.types.Panel):
|
||||
col.label(text="Sequencer:")
|
||||
col.prop(system, "prefetch_frames")
|
||||
col.prop(system, "memory_cache_limit")
|
||||
|
||||
|
||||
|
||||
# 3. Column
|
||||
column = split.column()
|
||||
@ -486,27 +491,27 @@ class USERPREF_PT_system(bpy.types.Panel):
|
||||
split.label()
|
||||
split.label(text="Colors:")
|
||||
split.label(text="Direction:")
|
||||
|
||||
|
||||
lamp = system.solid_lights[0]
|
||||
opengl_lamp_buttons(column, lamp)
|
||||
|
||||
|
||||
lamp = system.solid_lights[1]
|
||||
opengl_lamp_buttons(column, lamp)
|
||||
|
||||
|
||||
lamp = system.solid_lights[2]
|
||||
opengl_lamp_buttons(column, lamp)
|
||||
|
||||
column.separator()
|
||||
column.separator()
|
||||
column.separator()
|
||||
|
||||
|
||||
column.label(text="Color Picker Type:")
|
||||
column.row().prop(system, "color_picker_type", text="")
|
||||
|
||||
|
||||
column.separator()
|
||||
column.separator()
|
||||
column.separator()
|
||||
|
||||
|
||||
column.prop(system, "use_weight_color_range", text="Custom Weight Paint Range")
|
||||
sub = column.column()
|
||||
sub.active = system.use_weight_color_range
|
||||
@ -532,7 +537,7 @@ class USERPREF_PT_theme(bpy.types.Panel):
|
||||
split_themes.prop(theme, "theme_area", expand=True)
|
||||
|
||||
split = split_themes.split()
|
||||
|
||||
|
||||
if theme.theme_area == 'USER_INTERFACE':
|
||||
col = split.column()
|
||||
|
||||
@ -939,19 +944,18 @@ class USERPREF_PT_theme(bpy.types.Panel):
|
||||
|
||||
col = split.column()
|
||||
col.prop(prefs, "header_text")
|
||||
|
||||
|
||||
elif theme.theme_area == 'CONSOLE':
|
||||
prefs = theme.console
|
||||
|
||||
|
||||
col = split.column()
|
||||
col.prop(prefs, "header")
|
||||
|
||||
|
||||
col = split.column()
|
||||
col.prop(prefs, "line_output")
|
||||
col.prop(prefs, "line_input")
|
||||
col.prop(prefs, "line_info")
|
||||
col.prop(prefs, "line_error")
|
||||
|
||||
|
||||
|
||||
class USERPREF_PT_file(bpy.types.Panel):
|
||||
@ -1062,7 +1066,7 @@ class USERPREF_PT_input(bpy.types.Panel):
|
||||
row = col.row()
|
||||
row.prop(km, "children_expanded", text="", no_bg=True)
|
||||
row.label(text=km.name)
|
||||
|
||||
|
||||
row.label()
|
||||
row.label()
|
||||
|
||||
@ -1156,7 +1160,7 @@ class USERPREF_PT_input(bpy.types.Panel):
|
||||
# Expanded, additional event settings
|
||||
if kmi.expanded:
|
||||
box = col.box()
|
||||
|
||||
|
||||
box.enabled = km.user_defined
|
||||
|
||||
if map_type not in ('TEXTINPUT', 'TIMER'):
|
||||
@ -1186,8 +1190,8 @@ class USERPREF_PT_input(bpy.types.Panel):
|
||||
subrow.prop(kmi, "alt")
|
||||
subrow.prop(kmi, "oskey", text="Cmd")
|
||||
subrow.prop(kmi, "key_modifier", text="", event=True)
|
||||
|
||||
def display_properties(properties, title = None):
|
||||
|
||||
def display_properties(properties, title=None):
|
||||
box.separator()
|
||||
if title:
|
||||
box.label(text=title)
|
||||
@ -1196,7 +1200,7 @@ class USERPREF_PT_input(bpy.types.Panel):
|
||||
if not properties.is_property_hidden(pname):
|
||||
value = eval("properties." + pname)
|
||||
if isinstance(value, bpy.types.OperatorProperties):
|
||||
display_properties(value, title = pname)
|
||||
display_properties(value, title=pname)
|
||||
else:
|
||||
flow.prop(properties, pname)
|
||||
|
||||
@ -1301,9 +1305,9 @@ class USERPREF_PT_input(bpy.types.Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
|
||||
#import time
|
||||
|
||||
|
||||
#start = time.time()
|
||||
|
||||
userpref = context.user_preferences
|
||||
@ -1328,7 +1332,7 @@ class USERPREF_PT_input(bpy.types.Panel):
|
||||
row = subcol.row()
|
||||
row.prop_object(wm, "active_keyconfig", wm, "keyconfigs", text="Configuration:")
|
||||
|
||||
layout.set_context_pointer("keyconfig", wm.active_keyconfig)
|
||||
layout.set_context_pointer("keyconfig", wm.active_keyconfig)
|
||||
row.operator("wm.keyconfig_remove", text="", icon='X')
|
||||
|
||||
row.prop(kc, "filter", icon="VIEWZOOM")
|
||||
@ -1339,7 +1343,7 @@ class USERPREF_PT_input(bpy.types.Panel):
|
||||
self.draw_filtered(kc, col)
|
||||
else:
|
||||
self.draw_hierarchy(kc, col)
|
||||
|
||||
|
||||
#print("runtime", time.time() - start)
|
||||
|
||||
bpy.types.register(USERPREF_HT_header)
|
||||
@ -1383,7 +1387,7 @@ class WM_OT_keyconfig_test(bpy.types.Operator):
|
||||
s.append(", key_modifier=\'%s\'" % kmi.key_modifier)
|
||||
|
||||
s.append(")\n")
|
||||
|
||||
|
||||
def export_properties(prefix, properties):
|
||||
for pname in dir(properties):
|
||||
if not properties.is_property_hidden(pname):
|
||||
@ -1489,6 +1493,7 @@ def _string_value(value):
|
||||
|
||||
return result
|
||||
|
||||
|
||||
class WM_OT_keyconfig_import(bpy.types.Operator):
|
||||
"Import key configuration from a python script."
|
||||
bl_idname = "wm.keyconfig_import"
|
||||
@ -1515,28 +1520,28 @@ class WM_OT_keyconfig_import(bpy.types.Operator):
|
||||
|
||||
for line in f.readlines():
|
||||
match = name_pattern.match(line)
|
||||
|
||||
|
||||
if match:
|
||||
config_name = match.groups()[0]
|
||||
|
||||
|
||||
f.close()
|
||||
|
||||
|
||||
path = os.path.split(os.path.split(__file__)[0])[0] # remove ui/space_userpref.py
|
||||
path = os.path.join(path, "cfg")
|
||||
|
||||
|
||||
# create config folder if needed
|
||||
if not os.path.exists(path):
|
||||
os.mkdir(path)
|
||||
|
||||
os.mkdir(path)
|
||||
|
||||
path = os.path.join(path, config_name + ".py")
|
||||
|
||||
|
||||
if self.properties.keep_original:
|
||||
shutil.copy(self.properties.path, path)
|
||||
else:
|
||||
shutil.move(self.properties.path, path)
|
||||
|
||||
__import__(config_name)
|
||||
|
||||
|
||||
__import__(config_name)
|
||||
|
||||
wm = bpy.data.window_managers[0]
|
||||
wm.active_keyconfig = wm.keyconfigs[config_name]
|
||||
|
||||
@ -1546,7 +1551,8 @@ class WM_OT_keyconfig_import(bpy.types.Operator):
|
||||
wm = context.manager
|
||||
wm.add_fileselect(self)
|
||||
return {'RUNNING_MODAL'}
|
||||
|
||||
|
||||
|
||||
class WM_OT_keyconfig_export(bpy.types.Operator):
|
||||
"Export key configuration to a python script."
|
||||
bl_idname = "wm.keyconfig_export"
|
||||
@ -1615,9 +1621,9 @@ class WM_OT_keyconfig_export(bpy.types.Operator):
|
||||
value = _string_value(value)
|
||||
if value != "":
|
||||
f.write(prefix + ".%s = %s\n" % (pname, value))
|
||||
|
||||
|
||||
props = kmi.properties
|
||||
|
||||
|
||||
if props is not None:
|
||||
export_properties("kmi.properties", props)
|
||||
|
||||
@ -1670,7 +1676,7 @@ class WM_OT_keyitem_restore(bpy.types.Operator):
|
||||
bl_idname = "wm.keyitem_restore"
|
||||
bl_label = "Restore Key Map Item"
|
||||
|
||||
item_id = IntProperty(attr="item_id", name="Item Identifier", description="Identifier of the item to remove")
|
||||
item_id = IntProperty(attr="item_id", name="Item Identifier", description="Identifier of the item to remove")
|
||||
|
||||
def execute(self, context):
|
||||
wm = context.manager
|
||||
@ -1711,8 +1717,8 @@ class WM_OT_keyitem_remove(bpy.types.Operator):
|
||||
bl_idname = "wm.keyitem_remove"
|
||||
bl_label = "Remove Key Map Item"
|
||||
|
||||
item_id = IntProperty(attr="item_id", name="Item Identifier", description="Identifier of the item to remove")
|
||||
|
||||
item_id = IntProperty(attr="item_id", name="Item Identifier", description="Identifier of the item to remove")
|
||||
|
||||
def execute(self, context):
|
||||
wm = context.manager
|
||||
km = context.keymap
|
||||
@ -1720,6 +1726,7 @@ class WM_OT_keyitem_remove(bpy.types.Operator):
|
||||
km.remove_item(kmi)
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
class WM_OT_keyconfig_remove(bpy.types.Operator):
|
||||
"Remove key config."
|
||||
bl_idname = "wm.keyconfig_remove"
|
||||
@ -1731,18 +1738,18 @@ class WM_OT_keyconfig_remove(bpy.types.Operator):
|
||||
|
||||
def execute(self, context):
|
||||
wm = context.manager
|
||||
|
||||
|
||||
keyconfig = wm.active_keyconfig
|
||||
|
||||
|
||||
module = __import__(keyconfig.name)
|
||||
|
||||
|
||||
os.remove(module.__file__)
|
||||
|
||||
compiled_path = module.__file__ + "c" # for .pyc
|
||||
|
||||
|
||||
if os.path.exists(compiled_path):
|
||||
os.remove(compiled_path)
|
||||
|
||||
|
||||
wm.remove_keyconfig(keyconfig)
|
||||
return {'FINISHED'}
|
||||
|
||||
|
@ -854,6 +854,7 @@ class VIEW3D_MT_vertex_group(bpy.types.Menu):
|
||||
|
||||
# ********** Weight paint menu **********
|
||||
|
||||
|
||||
class VIEW3D_MT_paint_weight(bpy.types.Menu):
|
||||
bl_label = "Weights"
|
||||
|
||||
@ -1012,7 +1013,7 @@ class VIEW3D_MT_pose(bpy.types.Menu):
|
||||
layout.operator("pose.autoside_names", text="AutoName Top/Bottom").axis = 'ZAXIS'
|
||||
|
||||
layout.operator("pose.flip_names")
|
||||
|
||||
|
||||
layout.operator("pose.quaternions_flip")
|
||||
|
||||
layout.separator()
|
||||
@ -1756,6 +1757,7 @@ class VIEW3D_PT_3dview_display(bpy.types.Panel):
|
||||
row.enabled = region.lock_rotation and region.box_preview
|
||||
row.prop(region, "box_clip")
|
||||
|
||||
|
||||
class VIEW3D_PT_3dview_meshdisplay(bpy.types.Panel):
|
||||
bl_space_type = 'VIEW_3D'
|
||||
bl_region_type = 'UI'
|
||||
@ -1834,7 +1836,7 @@ class VIEW3D_PT_background_image(bpy.types.Panel):
|
||||
layout = self.layout
|
||||
|
||||
view = context.space_data
|
||||
|
||||
|
||||
col = layout.column()
|
||||
col.operator("view3d.add_background_image", text="Add Image")
|
||||
|
||||
@ -1845,9 +1847,9 @@ class VIEW3D_PT_background_image(bpy.types.Panel):
|
||||
row.prop(bg, "show_expanded", text="", no_bg=True)
|
||||
row.label(text=getattr(bg.image, "name", "Not Set"))
|
||||
row.operator("view3d.remove_background_image", text="", icon='X').index = i
|
||||
|
||||
|
||||
box.prop(bg, "view_axis", text="Axis")
|
||||
|
||||
|
||||
if bg.show_expanded:
|
||||
row = box.row()
|
||||
row.template_ID(bg, "image", open="image.open")
|
||||
@ -1859,7 +1861,7 @@ class VIEW3D_PT_background_image(bpy.types.Panel):
|
||||
row = box.row(align=True)
|
||||
row.prop(bg, "offset_x", text="X")
|
||||
row.prop(bg, "offset_y", text="Y")
|
||||
|
||||
|
||||
|
||||
class VIEW3D_PT_transform_orientations(bpy.types.Panel):
|
||||
bl_space_type = 'VIEW_3D'
|
||||
|
@ -644,13 +644,14 @@ class VIEW3D_PT_tools_brush_texture(PaintPanel):
|
||||
settings = self.paint_settings(context)
|
||||
brush = settings.brush
|
||||
tex_slot = brush.texture_slot
|
||||
|
||||
|
||||
col = layout.column()
|
||||
|
||||
|
||||
col.template_ID_preview(brush, "texture", new="texture.new", rows=2, cols=4)
|
||||
|
||||
|
||||
col.row().prop(tex_slot, "map_mode", expand=True)
|
||||
|
||||
|
||||
|
||||
class VIEW3D_PT_tools_brush_tool(PaintPanel):
|
||||
bl_label = "Tool"
|
||||
bl_default_closed = True
|
||||
@ -658,7 +659,7 @@ class VIEW3D_PT_tools_brush_tool(PaintPanel):
|
||||
def poll(self, context):
|
||||
settings = self.paint_settings(context)
|
||||
return (settings and settings.brush and
|
||||
(context.sculpt_object or context.texture_paint_object or
|
||||
(context.sculpt_object or context.texture_paint_object or
|
||||
context.vertex_paint_object or context.weight_paint_object))
|
||||
|
||||
def draw(self, context):
|
||||
|
Loading…
x
Reference in New Issue
Block a user