Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArystanbek Dyussenov <arystan.d@gmail.com>2009-09-15 22:01:18 +0400
committerArystanbek Dyussenov <arystan.d@gmail.com>2009-09-15 22:01:18 +0400
commit816377cc02fe5dd4be945c0f3d415861114b4980 (patch)
tree306e9d1363aa66bc919e43b80b3380fab9f60ea9 /release
parentc8af263e5d8d9d41a757e8438cdcf3b64d57e0c0 (diff)
parentee768ada680ce0a8aa184c882005c0ef1c0140fb (diff)
Undo revision 23130 which was a merge with 2.5, a messy one because I did something wrong (`svn status` output: http://www.pasteall.org/7887).soc-2009-kazanbas
The command: svn merge -r 23130:23129 https://svn.blender.org/svnroot/bf-blender/branches/soc-2009-kazanbas
Diffstat (limited to 'release')
-rw-r--r--release/datafiles/blenderbuttonsbin182512 -> 179274 bytes
-rw-r--r--release/datafiles/datatoc.c102
-rw-r--r--release/datafiles/splash.jpgbin197165 -> 197158 bytes
-rw-r--r--release/io/engine_render_pov.py224
-rw-r--r--release/io/export_ply.py11
-rw-r--r--release/io/netrender/__init__.py17
-rw-r--r--release/io/netrender/client.py204
-rw-r--r--release/io/netrender/master.py615
-rw-r--r--release/io/netrender/model.py162
-rw-r--r--release/io/netrender/operators.py236
-rw-r--r--release/io/netrender/slave.py169
-rw-r--r--release/io/netrender/ui.py283
-rw-r--r--release/io/netrender/utils.py61
-rw-r--r--release/scripts/export_map.py2
-rw-r--r--release/scripts/help_getting_started.py50
-rw-r--r--release/scripts/help_manual.py48
-rw-r--r--release/scripts/help_release_notes.py47
-rw-r--r--release/scripts/help_tutorials.py47
-rw-r--r--release/scripts/help_web_blender.py48
-rw-r--r--release/scripts/help_web_devcomm.py47
-rw-r--r--release/scripts/help_web_eshop.py47
-rw-r--r--release/scripts/help_web_usercomm.py47
-rw-r--r--release/test/rna_array.py279
-rw-r--r--release/ui/bpy_ops.py28
-rw-r--r--release/ui/buttons_data_armature.py31
-rw-r--r--release/ui/buttons_data_bone.py36
-rw-r--r--release/ui/buttons_data_camera.py8
-rw-r--r--release/ui/buttons_data_curve.py208
-rw-r--r--release/ui/buttons_data_empty.py8
-rw-r--r--release/ui/buttons_data_lamp.py21
-rw-r--r--release/ui/buttons_data_lattice.py6
-rw-r--r--release/ui/buttons_data_mesh.py67
-rw-r--r--release/ui/buttons_data_metaball.py4
-rw-r--r--release/ui/buttons_data_modifier.py114
-rw-r--r--release/ui/buttons_data_text.py119
-rw-r--r--release/ui/buttons_game.py42
-rw-r--r--release/ui/buttons_material.py371
-rw-r--r--release/ui/buttons_object.py8
-rw-r--r--release/ui/buttons_object_constraint.py22
-rw-r--r--release/ui/buttons_physics_cloth.py93
-rw-r--r--release/ui/buttons_physics_field.py16
-rw-r--r--release/ui/buttons_physics_fluid.py30
-rw-r--r--release/ui/buttons_physics_smoke.py115
-rw-r--r--release/ui/buttons_physics_softbody.py219
-rw-r--r--release/ui/buttons_scene.py63
-rw-r--r--release/ui/buttons_texture.py204
-rw-r--r--release/ui/buttons_world.py47
-rw-r--r--release/ui/space_buttons.py4
-rw-r--r--release/ui/space_console.py12
-rw-r--r--release/ui/space_filebrowser.py7
-rw-r--r--release/ui/space_image.py121
-rw-r--r--release/ui/space_info.py43
-rw-r--r--release/ui/space_logic.py24
-rw-r--r--release/ui/space_node.py21
-rw-r--r--release/ui/space_outliner.py4
-rw-r--r--release/ui/space_sequencer.py72
-rw-r--r--release/ui/space_text.py40
-rw-r--r--release/ui/space_time.py57
-rw-r--r--release/ui/space_userpref.py58
-rw-r--r--release/ui/space_view3d.py664
-rw-r--r--release/ui/space_view3d_toolbar.py172
-rw-r--r--release/windows/inno/blender.iss92
-rw-r--r--release/windows/inno/copyright.txt56
-rw-r--r--release/windows/inno/header.bmpbin25818 -> 0 bytes
-rw-r--r--release/windows/inno/installer.bmpbin154542 -> 0 bytes
-rw-r--r--release/windows/inno/installer.icobin25214 -> 0 bytes
66 files changed, 1816 insertions, 4257 deletions
diff --git a/release/datafiles/blenderbuttons b/release/datafiles/blenderbuttons
index 79d6138e3f0..98c321cd954 100644
--- a/release/datafiles/blenderbuttons
+++ b/release/datafiles/blenderbuttons
Binary files differ
diff --git a/release/datafiles/datatoc.c b/release/datafiles/datatoc.c
new file mode 100644
index 00000000000..46b935c7fd6
--- /dev/null
+++ b/release/datafiles/datatoc.c
@@ -0,0 +1,102 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+int main(int argc, char**argv) {
+ FILE *fpin, *fpout;
+ char cname[256];
+ char sizest[256];
+ size_t size;
+ int i;
+
+ if (argc<1) {
+ printf ("Usage: datatoc <data_file>\n");
+ exit(1);
+ }
+
+ fpin= fopen(argv[1], "rb");
+ if (!fpin) {
+ printf ("Unable to open input <%s>\n", argv[1]);
+ exit(1);
+ }
+
+ fseek (fpin, 0L, SEEK_END);
+ size= ftell(fpin);
+ fseek (fpin, 0L, SEEK_SET);
+
+ if (argv[1][0]=='.') argv[1]++;
+
+ sprintf(cname, "%s.c", argv[1]);
+ printf ("Making C file <%s>\n", cname);
+
+ for (i=0; i < (int)strlen(argv[1]); i++)
+ if (argv[1][i]=='.') argv[1][i]='_';
+
+ sprintf(sizest, "%d", (int)size);
+ printf ("Input filesize is %ld, Output size should be %ld\n", size, ((int)size)*4 + strlen("/* DataToC output of file <> */\n\n") + strlen("char datatoc_[]= {\"") + strlen ("\"};\n") + (strlen(argv[1])*3) + strlen(sizest) + strlen("int datatoc__size= ;\n") +(((int)(size/256)+1)*5));
+
+ fpout= fopen(cname, "w");
+ if (!fpout) {
+ printf ("Unable to open output <%s>\n", cname);
+ exit(1);
+ }
+
+ fprintf (fpout, "/* DataToC output of file <%s> */\n\n",argv[1]);
+ fprintf (fpout, "int datatoc_%s_size= %s;\n", argv[1], sizest);
+ /*
+ fprintf (fpout, "char datatoc_%s[]= {\"", argv[1]);
+
+ while (size--) {
+ if(size%256==0)
+ fprintf(fpout, "\" \\\n\"");
+
+ fprintf (fpout, "\\x%02x", getc(fpin));
+ }
+
+ fprintf (fpout, "\"};\n");
+ */
+
+ fprintf (fpout, "char datatoc_%s[]= {\n", argv[1]);
+ while (size--) {
+ if(size%32==31)
+ fprintf(fpout, "\n");
+
+ /* fprintf (fpout, "\\x%02x", getc(fpin)); */
+ fprintf (fpout, "%3d,", getc(fpin));
+ }
+ /* null terminate for the case it is a string */
+ fprintf (fpout, "\n 0};\n\n");
+
+ fclose(fpin);
+ fclose(fpout);
+ return 0;
+}
diff --git a/release/datafiles/splash.jpg b/release/datafiles/splash.jpg
index e35a26a2c23..1c34cf36f75 100644
--- a/release/datafiles/splash.jpg
+++ b/release/datafiles/splash.jpg
Binary files differ
diff --git a/release/io/engine_render_pov.py b/release/io/engine_render_pov.py
index 22cf1a36dbb..65add2baacb 100644
--- a/release/io/engine_render_pov.py
+++ b/release/io/engine_render_pov.py
@@ -82,8 +82,8 @@ def write_pov(filename, scene=None, info_callback = None):
file.write('#declare %s = finish {\n' % name)
if material:
- file.write('\tdiffuse %.3g\n' % material.diffuse_intensity)
- file.write('\tspecular %.3g\n' % material.specular_intensity)
+ file.write('\tdiffuse %.3g\n' % material.diffuse_reflection)
+ file.write('\tspecular %.3g\n' % material.specular_reflection)
file.write('\tambient %.3g\n' % material.ambient)
#file.write('\tambient rgb <%.3g, %.3g, %.3g>\n' % tuple([c*material.ambient for c in world.ambient_color])) # povray blends the global value
@@ -101,10 +101,10 @@ def write_pov(filename, scene=None, info_callback = None):
if material.raytrace_mirror.enabled:
raytrace_mirror= material.raytrace_mirror
- if raytrace_mirror.reflect_factor:
+ if raytrace_mirror.reflect:
file.write('\treflection {\n')
file.write('\t\trgb <%.3g, %.3g, %.3g>' % tuple(material.mirror_color))
- file.write('\t\tfresnel 1 falloff %.3g exponent %.3g metallic %.3g} ' % (raytrace_mirror.fresnel, raytrace_mirror.fresnel_factor, raytrace_mirror.reflect_factor))
+ file.write('\t\tfresnel 1 falloff %.3g exponent %.3g metallic %.3g} ' % (raytrace_mirror.fresnel, raytrace_mirror.fresnel_fac, raytrace_mirror.reflect))
else:
file.write('\tdiffuse 0.8\n')
@@ -300,7 +300,14 @@ def write_pov(filename, scene=None, info_callback = None):
try: vcol_layer = me.active_vertex_color.data
except:vcol_layer = None
- faces_verts = [f.verts for f in me.faces]
+
+ def regular_face(f):
+ fv = f.verts
+ if fv[3]== 0:
+ return fv[0], fv[1], fv[2]
+ return fv[0], fv[1], fv[2], fv[3]
+
+ faces_verts = [regular_face(f) for f in me.faces]
faces_normals = [tuple(f.normal) for f in me.faces]
verts_normals = [tuple(v.normal) for v in me.verts]
@@ -616,7 +623,7 @@ def write_pov_ini(filename_ini, filename_pov, filename_image):
file.write('Display=0\n')
file.write('Pause_When_Done=0\n')
- file.write('Output_File_Type=T\n') # TGA, best progressive loading
+ file.write('Output_File_Type=C\n') # TGA, best progressive loading
file.write('Output_Alpha=1\n')
if render.antialiasing:
@@ -628,89 +635,11 @@ def write_pov_ini(filename_ini, filename_pov, filename_image):
file.close()
-# Radiosity panel, use in the scene for now.
-FloatProperty= bpy.types.Scene.FloatProperty
-IntProperty= bpy.types.Scene.IntProperty
-BoolProperty= bpy.types.Scene.BoolProperty
-
-# Not a real pov option, just to know if we should write
-BoolProperty( attr="pov_radio_enable",
- name="Enable Radiosity",
- description="Enable povrays radiosity calculation.",
- default= False)
-BoolProperty( attr="pov_radio_display_advanced",
- name="Advanced Options",
- description="Show advanced options.",
- default= False)
-
-# Real pov options
-FloatProperty( attr="pov_radio_adc_bailout",
- name="ADC Bailout",
- description="The adc_bailout for radiosity rays. Use adc_bailout = 0.01 / brightest_ambient_object for good results.",
- min=0.0, max=1000.0, soft_min=0.0, soft_max=1.0, default= 0.01)
-
-BoolProperty( attr="pov_radio_always_sample",
- name="Always Sample",
- description="Only use the data from the pretrace step and not gather any new samples during the final radiosity pass..",
- default= True)
-
-FloatProperty( attr="pov_radio_brightness",
- name="Brightness",
- description="Ammount objects are brightened before being returned upwards to the rest of the system.",
- min=0.0, max=1000.0, soft_min=0.0, soft_max=10.0, default= 1.0)
-
-IntProperty( attr="pov_radio_count",
- name="Ray Count",
- description="number of rays that are sent out whenever a new radiosity value has to be calculated.",
- min=1, max=1600, default= 35)
-
-FloatProperty( attr="pov_radio_error_bound",
- name="Error Bound",
- description="one of the two main speed/quality tuning values, lower values are more accurate.",
- min=0.0, max=1000.0, soft_min=0.1, soft_max=10.0, default= 1.8)
-
-FloatProperty( attr="pov_radio_gray_threshold",
- name="Gray Threshold",
- description="one of the two main speed/quality tuning values, lower values are more accurate.",
- min=0.0, max=1.0, soft_min=0, soft_max=1, default= 0.0)
-
-FloatProperty( attr="pov_radio_low_error_factor",
- name="Low Error Factor",
- description="If you calculate just enough samples, but no more, you will get an image which has slightly blotchy lighting.",
- min=0.0, max=1.0, soft_min=0.0, soft_max=1.0, default= 0.5)
-
-# max_sample - not available yet
-BoolProperty( attr="pov_radio_media",
- name="Media",
- description="Radiosity estimation can be affected by media.",
- default= False)
-
-FloatProperty( attr="pov_radio_minimum_reuse",
- name="Minimum Reuse",
- description="Fraction of the screen width which sets the minimum radius of reuse for each sample point (At values higher than 2% expect errors).",
- min=0.0, max=1.0, soft_min=0.1, soft_max=0.1, default= 0.015)
-
-IntProperty( attr="pov_radio_nearest_count",
- name="Nearest Count",
- description="Number of old ambient values blended together to create a new interpolated value.",
- min=1, max=20, default= 5)
-
-BoolProperty( attr="pov_radio_normal",
- name="Normals",
- description="Radiosity estimation can be affected by normals.",
- default= False)
-
-IntProperty( attr="pov_radio_recursion_limit",
- name="Recursion Limit",
- description="how many recursion levels are used to calculate the diffuse inter-reflection.",
- min=1, max=20, default= 3)
-
class PovrayRender(bpy.types.RenderEngine):
__idname__ = 'POVRAY_RENDER'
__label__ = "Povray"
DELAY = 0.02
-
def _export(self, scene):
import tempfile
@@ -740,13 +669,10 @@ class PovrayRender(bpy.types.RenderEngine):
pov_binary = "povray"
if sys.platform=='win32':
- import winreg
- regKey = winreg.OpenKey(winreg.HKEY_CURRENT_USER, 'Software\\POV-Ray\\v3.6\\Windows')
-
if bitness == 64:
- pov_binary = winreg.QueryValueEx(regKey, 'Home')[0] + '\\bin\\pvengine64'
+ pov_binary = "pvengine64"
else:
- pov_binary = winreg.QueryValueEx(regKey, 'Home')[0] + '\\bin\\pvengine'
+ pov_binary = "pvengine"
if 1:
self.process = subprocess.Popen([pov_binary, self.temp_file_ini]) # stdout=subprocess.PIPE, stderr=subprocess.PIPE
@@ -835,8 +761,11 @@ class PovrayRender(bpy.types.RenderEngine):
self._cleanup()
+
bpy.types.register(PovrayRender)
+
+
# Use some of the existing buttons.
import buttons_scene
buttons_scene.SCENE_PT_render.COMPAT_ENGINES.add('POVRAY_RENDER')
@@ -862,8 +791,8 @@ for member in dir(buttons_material):
del buttons_material
class RenderButtonsPanel(bpy.types.Panel):
- __space_type__ = 'PROPERTIES'
- __region_type__ = 'WINDOW'
+ __space_type__ = "PROPERTIES"
+ __region_type__ = "WINDOW"
__context__ = "scene"
# COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
@@ -871,6 +800,7 @@ class RenderButtonsPanel(bpy.types.Panel):
rd = context.scene.render_data
return (rd.use_game_engine==False) and (rd.engine in self.COMPAT_ENGINES)
+# Radiosity panel, use in the scene for now.
class SCENE_PT_povray_radiosity(RenderButtonsPanel):
__label__ = "Radiosity"
COMPAT_ENGINES = set(['POVRAY_RENDER'])
@@ -891,38 +821,100 @@ class SCENE_PT_povray_radiosity(RenderButtonsPanel):
col = split.column()
- col.itemR(scene, "pov_radio_count", text="Rays")
- col.itemR(scene, "pov_radio_recursion_limit", text="Recursions")
- col = split.column()
- col.itemR(scene, "pov_radio_error_bound", text="Error")
+ col.itemR(scene, "pov_radio_count")
+ col.itemR(scene, "pov_radio_recursion_limit")
+ col.itemR(scene, "pov_radio_error_bound")
- layout.itemR(scene, "pov_radio_display_advanced")
+ col.itemR(scene, "pov_radio_display_advanced")
if scene.pov_radio_display_advanced:
- split = layout.split()
-
- col = split.column()
- col.itemR(scene, "pov_radio_adc_bailout", slider=True)
- col.itemR(scene, "pov_radio_gray_threshold", slider=True)
- col.itemR(scene, "pov_radio_low_error_factor", slider=True)
-
-
-
- col = split.column()
+ col.itemR(scene, "pov_radio_adc_bailout")
col.itemR(scene, "pov_radio_brightness")
- col.itemR(scene, "pov_radio_minimum_reuse", text="Min Reuse")
- col.itemR(scene, "pov_radio_nearest_count")
-
-
- split = layout.split()
-
- col = split.column()
- col.itemL(text="Estimation Influence:")
+ col.itemR(scene, "pov_radio_gray_threshold")
+ col.itemR(scene, "pov_radio_low_error_factor")
+ col.itemR(scene, "pov_radio_minimum_reuse")
col.itemR(scene, "pov_radio_media")
+ col.itemR(scene, "pov_radio_nearest_count")
col.itemR(scene, "pov_radio_normal")
-
- col = split.column()
col.itemR(scene, "pov_radio_always_sample")
bpy.types.register(SCENE_PT_povray_radiosity)
+
+
+FloatProperty= bpy.types.Scene.FloatProperty
+IntProperty= bpy.types.Scene.IntProperty
+BoolProperty= bpy.types.Scene.BoolProperty
+
+# Not a real pov option, just to know if we should write
+BoolProperty( attr="pov_radio_enable",
+ name="Enable Radiosity",
+ description="Enable povrays radiosity calculation.",
+ default= False)
+BoolProperty( attr="pov_radio_display_advanced",
+ name="Advanced Options",
+ description="Show advanced options.",
+ default= False)
+
+# Real pov options
+FloatProperty( attr="pov_radio_adc_bailout",
+ name="ADC Bailout",
+ description="The adc_bailout for radiosity rays. Use adc_bailout = 0.01 / brightest_ambient_object for good results.",
+ min=0.0, max=1000.0, soft_min=0.0, soft_max=1.0, default= 0.01)
+
+BoolProperty( attr="pov_radio_always_sample",
+ name="Always Sample",
+ description="Only use the data from the pretrace step and not gather any new samples during the final radiosity pass..",
+ default= True)
+
+FloatProperty( attr="pov_radio_brightness",
+ name="Brightness",
+ description="Ammount objects are brightened before being returned upwards to the rest of the system.",
+ min=0.0, max=1000.0, soft_min=0.0, soft_max=10.0, default= 1.0)
+
+IntProperty( attr="pov_radio_count",
+ name="Ray Count",
+ description="number of rays that are sent out whenever a new radiosity value has to be calculated.",
+ min=1, max=1600, default= 35)
+
+FloatProperty( attr="pov_radio_error_bound",
+ name="Error Bound",
+ description="one of the two main speed/quality tuning values, lower values are more accurate.",
+ min=0.0, max=1000.0, soft_min=0.1, soft_max=10.0, default= 1.8)
+
+FloatProperty( attr="pov_radio_gray_threshold",
+ name="Gray Threshold",
+ description="one of the two main speed/quality tuning values, lower values are more accurate.",
+ min=0.0, max=1.0, default= 0.0)
+
+FloatProperty( attr="pov_radio_low_error_factor",
+ name="Low Error Factor",
+ description="If you calculate just enough samples, but no more, you will get an image which has slightly blotchy lighting.",
+ min=0.0, max=1.0, default= 0.5)
+
+# max_sample - not available yet
+
+BoolProperty( attr="pov_radio_media",
+ name="Use Media",
+ description="Radiosity estimation can be affected by media.",
+ default= False)
+
+FloatProperty( attr="pov_radio_minimum_reuse",
+ name="Minimum Reuse",
+ description="Fraction of the screen width which sets the minimum radius of reuse for each sample point (At values higher than 2% expect errors).",
+ min=0.0, max=1.0, soft_min=0.1, soft_max=0.1, default= 0.015)
+
+IntProperty( attr="pov_radio_nearest_count",
+ name="Nearest Count",
+ description="Number of old ambient values blended together to create a new interpolated value.",
+ min=1, max=20, default= 5)
+
+BoolProperty( attr="pov_radio_normal",
+ name="Normals",
+ description="Radiosity estimation can be affected by normals.",
+ default= False)
+
+IntProperty( attr="pov_radio_recursion_limit",
+ name="Recursion Limit",
+ description="how many recursion levels are used to calculate the diffuse inter-reflection.",
+ min=1, max=20, default= 3)
diff --git a/release/io/export_ply.py b/release/io/export_ply.py
index 65238eb247c..2f10875c970 100644
--- a/release/io/export_ply.py
+++ b/release/io/export_ply.py
@@ -88,9 +88,9 @@ def write(filename, scene, ob, \
# mesh.transform(ob.matrixWorld) # XXX
- faceUV = len(mesh.uv_textures) > 0
+ faceUV = len(mesh.uv_layers) > 0
vertexUV = len(mesh.sticky) > 0
- vertexColors = len(mesh.vertex_colors) > 0
+ vertexColors = len(mesh.vcol_layers) > 0
if (not faceUV) and (not vertexUV): EXPORT_UV = False
if not vertexColors: EXPORT_COLORS = False
@@ -100,7 +100,7 @@ def write(filename, scene, ob, \
if faceUV:
active_uv_layer = None
- for lay in mesh.uv_textures:
+ for lay in mesh.uv_layers:
if lay.active:
active_uv_layer= lay.data
break
@@ -110,7 +110,7 @@ def write(filename, scene, ob, \
if vertexColors:
active_col_layer = None
- for lay in mesh.vertex_colors:
+ for lay in mesh.vcol_layers:
if lay.active:
active_col_layer= lay.data
if not active_col_layer:
@@ -141,7 +141,8 @@ def write(filename, scene, ob, \
col = active_col_layer[i]
col = col.color1, col.color2, col.color3, col.color4
- f_verts= f.verts
+ f_verts= list(f.verts)
+ if not f_verts[3]: f_verts.pop() # XXX face length should be 3/4, not always 4
pf= ply_faces[i]
for j, vidx in enumerate(f_verts):
diff --git a/release/io/netrender/__init__.py b/release/io/netrender/__init__.py
deleted file mode 100644
index 1eb91abb938..00000000000
--- a/release/io/netrender/__init__.py
+++ /dev/null
@@ -1,17 +0,0 @@
-# This directory is a Python package.
-
-import model
-import operators
-import client
-import slave
-import master
-import utils
-import ui
-
-# store temp data in bpy module
-
-import bpy
-
-bpy.data.netrender_jobs = []
-bpy.data.netrender_slaves = []
-bpy.data.netrender_blacklist = [] \ No newline at end of file
diff --git a/release/io/netrender/client.py b/release/io/netrender/client.py
deleted file mode 100644
index 0c60bd1603c..00000000000
--- a/release/io/netrender/client.py
+++ /dev/null
@@ -1,204 +0,0 @@
-import bpy
-import sys, os
-import http, http.client, http.server, urllib
-import subprocess, shutil, time, hashlib
-
-import netrender.slave as slave
-import netrender.master as master
-from netrender.utils import *
-
-
-def clientSendJob(conn, scene, anim = False, chunks = 5):
- netsettings = scene.network_render
- job = netrender.model.RenderJob()
-
- if anim:
- for f in range(scene.start_frame, scene.end_frame + 1):
- job.addFrame(f)
- else:
- job.addFrame(scene.current_frame)
-
- filename = bpy.data.filename
- job.addFile(filename)
-
- job_name = netsettings.job_name
- path, name = os.path.split(filename)
- if job_name == "[default]":
- job_name = name
-
- ###########################
- # LIBRARIES
- ###########################
- for lib in bpy.data.libraries:
- lib_path = lib.filename
-
- if lib_path.startswith("//"):
- lib_path = path + os.sep + lib_path[2:]
-
- job.addFile(lib_path)
-
- ###########################
- # POINT CACHES
- ###########################
-
- root, ext = os.path.splitext(name)
- cache_path = path + os.sep + "blendcache_" + root + os.sep # need an API call for that
-
- if os.path.exists(cache_path):
- caches = {}
- pattern = re.compile("([a-zA-Z0-9]+)_([0-9]+)_[0-9]+\.bphys")
- for cache_file in sorted(os.listdir(cache_path)):
- match = pattern.match(cache_file)
-
- if match:
- cache_id = match.groups()[0]
- cache_frame = int(match.groups()[1])
-
- cache_files = caches.get(cache_id, [])
- cache_files.append((cache_frame, cache_file))
- caches[cache_id] = cache_files
-
- for cache in caches.values():
- cache.sort()
-
- if len(cache) == 1:
- cache_frame, cache_file = cache[0]
- job.addFile(cache_path + cache_file, cache_frame, cache_frame)
- else:
- for i in range(len(cache)):
- current_item = cache[i]
- next_item = cache[i+1] if i + 1 < len(cache) else None
- previous_item = cache[i - 1] if i > 0 else None
-
- current_frame, current_file = current_item
-
- if not next_item and not previous_item:
- job.addFile(cache_path + current_file, current_frame, current_frame)
- elif next_item and not previous_item:
- next_frame = next_item[0]
- job.addFile(cache_path + current_file, current_frame, next_frame - 1)
- elif not next_item and previous_item:
- previous_frame = previous_item[0]
- job.addFile(cache_path + current_file, previous_frame + 1, current_frame)
- else:
- next_frame = next_item[0]
- previous_frame = previous_item[0]
- job.addFile(cache_path + current_file, previous_frame + 1, next_frame - 1)
-
- ###########################
- # IMAGES
- ###########################
- for image in bpy.data.images:
- if image.source == "FILE" and not image.packed_file:
- job.addFile(image.filename)
-
- # print(job.files)
-
- job.name = job_name
-
- for slave in scene.network_render.slaves_blacklist:
- job.blacklist.append(slave.id)
-
- job.chunks = netsettings.chunks
- job.priority = netsettings.priority
-
- # try to send path first
- conn.request("POST", "job", repr(job.serialize()))
- response = conn.getresponse()
-
- job_id = response.getheader("job-id")
-
- # if not ACCEPTED (but not processed), send files
- if response.status == http.client.ACCEPTED:
- for filepath in job.files:
- f = open(filepath, "rb")
- conn.request("PUT", "file", f, headers={"job-id": job_id, "job-file": filepath})
- f.close()
- response = conn.getresponse()
-
- # server will reply with NOT_FOUD until all files are found
-
- return job_id
-
-def clientRequestResult(conn, scene, job_id):
- conn.request("GET", "render", headers={"job-id": job_id, "job-frame":str(scene.current_frame)})
-
-class NetworkRenderEngine(bpy.types.RenderEngine):
- __idname__ = 'NET_RENDER'
- __label__ = "Network Render"
- def render(self, scene):
- if scene.network_render.mode == "RENDER_CLIENT":
- self.render_client(scene)
- elif scene.network_render.mode == "RENDER_SLAVE":
- self.render_slave(scene)
- elif scene.network_render.mode == "RENDER_MASTER":
- self.render_master(scene)
- else:
- print("UNKNOWN OPERATION MODE")
-
- def render_master(self, scene):
- server_address = (scene.network_render.server_address, scene.network_render.server_port)
- httpd = master.RenderMasterServer(server_address, master.RenderHandler, scene.network_render.path)
- httpd.timeout = 1
- httpd.stats = self.update_stats
- while not self.test_break():
- httpd.handle_request()
-
- def render_slave(self, scene):
- slave.render_slave(self, scene)
-
- def render_client(self, scene):
- netsettings = scene.network_render
- self.update_stats("", "Network render client initiation")
-
- conn = clientConnection(scene)
-
- if conn:
- # Sending file
-
- self.update_stats("", "Network render exporting")
-
- job_id = netsettings.job_id
-
- # reading back result
-
- self.update_stats("", "Network render waiting for results")
-
- clientRequestResult(conn, scene, job_id)
- response = conn.getresponse()
-
- if response.status == http.client.NO_CONTENT:
- netsettings.job_id = clientSendJob(conn, scene)
- clientRequestResult(conn, scene, job_id)
-
- while response.status == http.client.ACCEPTED and not self.test_break():
- print("waiting")
- time.sleep(1)
- clientRequestResult(conn, scene, job_id)
- response = conn.getresponse()
-
- if response.status != http.client.OK:
- conn.close()
- return
-
- r = scene.render_data
- x= int(r.resolution_x*r.resolution_percentage*0.01)
- y= int(r.resolution_y*r.resolution_percentage*0.01)
-
- f = open(netsettings.path + "output.exr", "wb")
- buf = response.read(1024)
-
- while buf:
- f.write(buf)
- buf = response.read(1024)
-
- f.close()
-
- result = self.begin_result(0, 0, x, y)
- result.load_from_file(netsettings.path + "output.exr", 0, 0)
- self.end_result(result)
-
- conn.close()
-
-bpy.types.register(NetworkRenderEngine)
-
diff --git a/release/io/netrender/master.py b/release/io/netrender/master.py
deleted file mode 100644
index 78e9243bc9d..00000000000
--- a/release/io/netrender/master.py
+++ /dev/null
@@ -1,615 +0,0 @@
-import sys, os
-import http, http.client, http.server, urllib
-import subprocess, shutil, time, hashlib
-
-from netrender.utils import *
-import netrender.model
-
-JOB_WAITING = 0 # before all data has been entered
-JOB_PAUSED = 1 # paused by user
-JOB_QUEUED = 2 # ready to be dispatched
-
-class MRenderFile:
- def __init__(self, filepath, start, end):
- self.filepath = filepath
- self.start = start
- self.end = end
- self.found = False
-
- def test(self):
- self.found = os.path.exists(self.filepath)
- return self.found
-
-
-class MRenderSlave(netrender.model.RenderSlave):
- def __init__(self, name, address, stats):
- super().__init__()
- self.id = hashlib.md5(bytes(repr(name) + repr(address), encoding='utf8')).hexdigest()
- self.name = name
- self.address = address
- self.stats = stats
- self.last_seen = time.time()
-
- self.job = None
- self.frame = None
-
- netrender.model.RenderSlave._slave_map[self.id] = self
-
- def seen(self):
- self.last_seen = time.time()
-
-# sorting key for jobs
-def groupKey(job):
- return (job.status, job.framesLeft() > 0, job.priority, job.credits)
-
-class MRenderJob(netrender.model.RenderJob):
- def __init__(self, job_id, name, files, chunks = 1, priority = 1, credits = 100.0, blacklist = []):
- super().__init__()
- self.id = job_id
- self.name = name
- self.files = files
- self.frames = []
- self.chunks = chunks
- self.priority = priority
- self.credits = credits
- self.blacklist = blacklist
- self.last_dispatched = time.time()
-
- # special server properties
- self.save_path = ""
- self.files_map = {path: MRenderFile(path, start, end) for path, start, end in files}
- self.status = JOB_WAITING
-
- def save(self):
- if self.save_path:
- f = open(self.save_path + "job.txt", "w")
- f.write(repr(self.serialize()))
- f.close()
-
- def testStart(self):
- for f in self.files_map.values():
- if not f.test():
- return False
-
- self.start()
- return True
-
- def start(self):
- self.status = JOB_QUEUED
-
- def update(self):
- self.credits -= 5 # cost of one frame
- self.credits += (time.time() - self.last_dispatched) / 60
- self.last_dispatched = time.time()
-
- def addFrame(self, frame_number):
- frame = MRenderFrame(frame_number)
- self.frames.append(frame)
- return frame
-
- def framesLeft(self):
- total = 0
- for j in self.frames:
- if j.status == QUEUED:
- total += 1
-
- return total
-
- def reset(self, all):
- for f in self.frames:
- f.reset(all)
-
- def getFrames(self):
- frames = []
- for f in self.frames:
- if f.status == QUEUED:
- self.update()
- frames.append(f)
- if len(frames) >= self.chunks:
- break
-
- return frames
-
-class MRenderFrame(netrender.model.RenderFrame):
- def __init__(self, frame):
- super().__init__()
- self.number = frame
- self.slave = None
- self.time = 0
- self.status = QUEUED
-
- def reset(self, all):
- if all or self.status == ERROR:
- self.slave = None
- self.time = 0
- self.status = QUEUED
-
-
-# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-
-class RenderHandler(http.server.BaseHTTPRequestHandler):
- def send_head(self, code = http.client.OK, headers = {}):
- self.send_response(code)
- self.send_header("Content-type", "application/octet-stream")
-
- for key, value in headers.items():
- self.send_header(key, value)
-
- self.end_headers()
-
- def do_HEAD(self):
- print(self.path)
-
- if self.path == "status":
- job_id = self.headers.get('job-id', "")
- job_frame = int(self.headers.get('job-frame', -1))
-
- if job_id:
- print("status:", job_id, "\n")
-
- job = self.server.getJobByID(job_id)
- if job:
- if job_frame != -1:
- frame = job[frame]
-
- if not frame:
- # no such frame
- self.send_heat(http.client.NO_CONTENT)
- return
- else:
- # no such job id
- self.send_head(http.client.NO_CONTENT)
- return
-
- self.send_head()
-
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-
- def do_GET(self):
- print(self.path)
-
- if self.path == "version":
- self.send_head()
- self.server.stats("", "New client connection")
- self.wfile.write(VERSION)
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- elif self.path == "render":
- job_id = self.headers['job-id']
- job_frame = int(self.headers['job-frame'])
- print("render:", job_id, job_frame)
-
- job = self.server.getJobByID(job_id)
-
- if job:
- frame = job[job_frame]
-
- if frame:
- if frame.status in (QUEUED, DISPATCHED):
- self.send_head(http.client.ACCEPTED)
- elif frame.status == DONE:
- self.server.stats("", "Sending result back to client")
- f = open(job.save_path + "%04d" % job_frame + ".exr", 'rb')
-
- self.send_head()
-
- shutil.copyfileobj(f, self.wfile)
-
- f.close()
- elif frame.status == ERROR:
- self.send_head(http.client.PARTIAL_CONTENT)
- else:
- # no such frame
- self.send_head(http.client.NO_CONTENT)
- else:
- # no such job id
- self.send_head(http.client.NO_CONTENT)
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- elif self.path == "log":
- job_id = self.headers['job-id']
- job_frame = int(self.headers['job-frame'])
- print("log:", job_id, job_frame)
-
- job = self.server.getJobByID(job_id)
-
- if job:
- frame = job[job_frame]
-
- if frame:
- if frame.status in (QUEUED, DISPATCHED):
- self.send_head(http.client.PROCESSING)
- else:
- self.server.stats("", "Sending log back to client")
- f = open(job.save_path + "%04d" % job_frame + ".log", 'rb')
-
- self.send_head()
-
- shutil.copyfileobj(f, self.wfile)
-
- f.close()
- else:
- # no such frame
- self.send_head(http.client.NO_CONTENT)
- else:
- # no such job id
- self.send_head(http.client.NO_CONTENT)
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- elif self.path == "status":
- job_id = self.headers.get('job-id', "")
- job_frame = int(self.headers.get('job-frame', -1))
-
- if job_id:
- print("status:", job_id, "\n")
-
- job = self.server.getJobByID(job_id)
- if job:
- if job_frame != -1:
- frame = job[frame]
-
- if frame:
- message = frame.serialize()
- else:
- # no such frame
- self.send_heat(http.client.NO_CONTENT)
- return
- else:
- message = job.serialize()
- else:
- # no such job id
- self.send_head(http.client.NO_CONTENT)
- return
- else: # status of all jobs
- message = []
-
- for job in self.server:
- message.append(job.serialize())
-
- self.send_head()
- self.wfile.write(bytes(repr(message), encoding='utf8'))
-
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- elif self.path == "job":
- self.server.update()
-
- slave_id = self.headers['slave-id']
-
- print("slave-id", slave_id)
-
- slave = self.server.updateSlave(slave_id)
-
- if slave: # only if slave id is valid
- job, frames = self.server.getNewJob(slave_id)
-
- if job and frames:
- for f in frames:
- print("dispatch", f.number)
- f.status = DISPATCHED
- f.slave = slave
-
- self.send_head(headers={"job-id": job.id})
-
- message = job.serialize(frames)
-
- self.wfile.write(bytes(repr(message), encoding='utf8'))
-
- self.server.stats("", "Sending job frame to render node")
- else:
- # no job available, return error code
- self.send_head(http.client.ACCEPTED)
- else: # invalid slave id
- self.send_head(http.client.NO_CONTENT)
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- elif self.path == "file":
- slave_id = self.headers['slave-id']
-
- slave = self.server.updateSlave(slave_id)
-
- if slave: # only if slave id is valid
- job_id = self.headers['job-id']
- job_file = self.headers['job-file']
- print("job:", job_id, "\n")
- print("file:", job_file, "\n")
-
- job = self.server.getJobByID(job_id)
-
- if job:
- render_file = job.files_map.get(job_file, None)
-
- if render_file:
- self.server.stats("", "Sending file to render node")
- f = open(render_file.path, 'rb')
-
- shutil.copyfileobj(f, self.wfile)
-
- f.close()
- else:
- # no such file
- self.send_head(http.client.NO_CONTENT)
- else:
- # no such job id
- self.send_head(http.client.NO_CONTENT)
- else: # invalid slave id
- self.send_head(http.client.NO_CONTENT)
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- elif self.path == "slave":
- message = []
-
- for slave in self.server.slaves:
- message.append(slave.serialize())
-
- self.send_head()
-
- self.wfile.write(bytes(repr(message), encoding='utf8'))
-
-
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- def do_POST(self):
- print(self.path)
-
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- if self.path == "job":
- print("posting job info")
- self.server.stats("", "Receiving job")
-
- length = int(self.headers['content-length'])
-
- job_info = netrender.model.RenderJob.materialize(eval(str(self.rfile.read(length), encoding='utf8')))
-
- job_id = self.server.nextJobID()
-
- print(job_info.files)
-
- job = MRenderJob(job_id, job_info.name, job_info.files, chunks = job_info.chunks, priority = job_info.priority, blacklist = job_info.blacklist)
-
- for frame in job_info.frames:
- frame = job.addFrame(frame.number)
-
- self.server.addJob(job)
-
- headers={"job-id": job_id}
-
- if job.testStart():
- self.send_head(headers=headers)
- else:
- self.send_head(http.client.ACCEPTED, headers=headers)
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- elif self.path == "cancel":
- job_id = self.headers.get('job-id', "")
- if job_id:
- print("cancel:", job_id, "\n")
- self.server.removeJob(job_id)
- else: # cancel all jobs
- self.server.clear()
-
- self.send_head()
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- elif self.path == "reset":
- job_id = self.headers.get('job-id', "")
- job_frame = int(self.headers.get('job-frame', "-1"))
- all = bool(self.headers.get('reset-all', "False"))
-
- job = self.server.getJobByID(job_id)
-
- if job:
- if job_frame != -1:
- job[job_frame].reset(all)
- else:
- job.reset(all)
-
- self.send_head()
- else: # job not found
- self.send_head(http.client.NO_CONTENT)
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- elif self.path == "slave":
- length = int(self.headers['content-length'])
- job_frame_string = self.headers['job-frame']
-
- slave_info = netrender.model.RenderSlave.materialize(eval(str(self.rfile.read(length), encoding='utf8')))
-
- slave_id = self.server.addSlave(slave_info.name, self.client_address, slave_info.stats)
-
- self.send_head(headers = {"slave-id": slave_id})
-
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- def do_PUT(self):
- print(self.path)
-
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- if self.path == "file":
- print("writing blend file")
- self.server.stats("", "Receiving job")
-
- length = int(self.headers['content-length'])
- job_id = self.headers['job-id']
- job_file = self.headers['job-file']
-
- job = self.server.getJobByID(job_id)
-
- if job:
-
- render_file = job.files_map.get(job_file, None)
-
- if render_file:
- main_file = job.files[0]
-
- main_path, main_name = os.path.split(main_file)
-
- if job_file != main_file:
- file_path = prefixPath(job.save_path, job_file, main_path)
- else:
- file_path = job.save_path + main_name
-
- buf = self.rfile.read(length)
-
- # add same temp file + renames as slave
-
- f = open(file_path, "wb")
- f.write(buf)
- f.close()
- del buf
-
- render_file.path = file_path # set the new path
-
- if job.testStart():
- self.send_head(headers=headers)
- else:
- self.send_head(http.client.ACCEPTED, headers=headers)
- else: # invalid file
- self.send_head(http.client.NO_CONTENT)
- else: # job not found
- self.send_head(http.client.NO_CONTENT)
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- elif self.path == "render":
- print("writing result file")
- self.server.stats("", "Receiving render result")
-
- slave_id = self.headers['slave-id']
-
- slave = self.server.updateSlave(slave_id)
-
- if slave: # only if slave id is valid
- job_id = self.headers['job-id']
-
- job = self.server.getJobByID(job_id)
-
- if job:
- job_frame = int(self.headers['job-frame'])
- job_result = int(self.headers['job-result'])
- job_time = float(self.headers['job-time'])
-
- frame = job[job_frame]
-
- if job_result == DONE:
- length = int(self.headers['content-length'])
- buf = self.rfile.read(length)
- f = open(job.save_path + "%04d" % job_frame + ".exr", 'wb')
- f.write(buf)
- f.close()
-
- del buf
- elif job_result == ERROR:
- # blacklist slave on this job on error
- job.blacklist.append(slave.id)
-
- frame.status = job_result
- frame.time = job_time
-
- self.server.updateSlave(self.headers['slave-id'])
-
- self.send_head()
- else: # job not found
- self.send_head(http.client.NO_CONTENT)
- else: # invalid slave id
- self.send_head(http.client.NO_CONTENT)
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- elif self.path == "log":
- print("writing log file")
- self.server.stats("", "Receiving log file")
-
- job_id = self.headers['job-id']
-
- job = self.server.getJobByID(job_id)
-
- if job:
- length = int(self.headers['content-length'])
- job_frame = int(self.headers['job-frame'])
-
- buf = self.rfile.read(length)
- f = open(job.save_path + "%04d" % job_frame + ".log", 'wb')
- f.write(buf)
- f.close()
-
- del buf
-
- self.server.updateSlave(self.headers['slave-id'])
-
- self.send_head()
- else: # job not found
- self.send_head(http.client.NO_CONTENT)
-
-class RenderMasterServer(http.server.HTTPServer):
- def __init__(self, address, handler_class, path):
- super().__init__(address, handler_class)
- self.jobs = []
- self.jobs_map = {}
- self.slaves = []
- self.slaves_map = {}
- self.job_id = 0
- self.path = path + "master_" + str(os.getpid()) + os.sep
-
- if not os.path.exists(self.path):
- os.mkdir(self.path)
-
- def nextJobID(self):
- self.job_id += 1
- return str(self.job_id)
-
- def addSlave(self, name, address, stats):
- slave = MRenderSlave(name, address, stats)
- self.slaves.append(slave)
- self.slaves_map[slave.id] = slave
-
- return slave.id
-
- def getSlave(self, slave_id):
- return self.slaves_map.get(slave_id, None)
-
- def updateSlave(self, slave_id):
- slave = self.getSlave(slave_id)
- if slave:
- slave.seen()
-
- return slave
-
- def clear(self):
- self.jobs_map = {}
- self.jobs = []
-
- def update(self):
- self.jobs.sort(key = groupKey)
-
- def removeJob(self, id):
- job = self.jobs_map.pop(id)
-
- if job:
- self.jobs.remove(job)
-
- def addJob(self, job):
- self.jobs.append(job)
- self.jobs_map[job.id] = job
-
- # create job directory
- job.save_path = self.path + "job_" + job.id + os.sep
- if not os.path.exists(job.save_path):
- os.mkdir(job.save_path)
-
- job.save()
-
- def getJobByID(self, id):
- return self.jobs_map.get(id, None)
-
- def __iter__(self):
- for job in self.jobs:
- yield job
-
- def getNewJob(self, slave_id):
- if self.jobs:
- for job in reversed(self.jobs):
- if job.status == JOB_QUEUED and job.framesLeft() > 0 and slave_id not in job.blacklist:
- return job, job.getFrames()
-
- return None, None
diff --git a/release/io/netrender/model.py b/release/io/netrender/model.py
deleted file mode 100644
index 7803ad034a7..00000000000
--- a/release/io/netrender/model.py
+++ /dev/null
@@ -1,162 +0,0 @@
-import sys, os
-import http, http.client, http.server, urllib
-import subprocess, shutil, time, hashlib
-
-from netrender.utils import *
-
-class RenderSlave:
- _slave_map = {}
-
- def __init__(self):
- self.id = ""
- self.name = ""
- self.address = (0,0)
- self.stats = ""
- self.total_done = 0
- self.total_error = 0
- self.last_seen = 0.0
-
- def serialize(self):
- return {
- "id": self.id,
- "name": self.name,
- "address": self.address,
- "stats": self.stats,
- "total_done": self.total_done,
- "total_error": self.total_error,
- "last_seen": self.last_seen
- }
-
- @staticmethod
- def materialize(data):
- if not data:
- return None
-
- slave_id = data["id"]
-
- if slave_id in RenderSlave._slave_map:
- return RenderSlave._slave_map[slave_id]
- else:
- slave = RenderSlave()
- slave.id = slave_id
- slave.name = data["name"]
- slave.address = data["address"]
- slave.stats = data["stats"]
- slave.total_done = data["total_done"]
- slave.total_error = data["total_error"]
- slave.last_seen = data["last_seen"]
-
- RenderSlave._slave_map[slave_id] = slave
-
- return slave
-
-class RenderJob:
- def __init__(self):
- self.id = ""
- self.name = ""
- self.files = []
- self.frames = []
- self.chunks = 0
- self.priority = 0
- self.credits = 0
- self.blacklist = []
- self.last_dispatched = 0.0
-
- def addFile(self, file_path, start=-1, end=-1):
- self.files.append((file_path, start, end))
-
- def addFrame(self, frame_number):
- frame = RenderFrame(frame_number)
- self.frames.append(frame)
- return frame
-
- def __len__(self):
- return len(self.frames)
-
- def framesStatus(self):
- results = {
- QUEUED: 0,
- DISPATCHED: 0,
- DONE: 0,
- ERROR: 0
- }
-
- for frame in self.frames:
- results[frame.status] += 1
-
- return results
-
- def __contains__(self, frame_number):
- for f in self.frames:
- if f.number == frame_number:
- return True
- else:
- return False
-
- def __getitem__(self, frame_number):
- for f in self.frames:
- if f.number == frame_number:
- return f
- else:
- return None
-
- def serialize(self, frames = None):
- min_frame = min((f.number for f in frames)) if frames else -1
- max_frame = max((f.number for f in frames)) if frames else -1
- return {
- "id": self.id,
- "name": self.name,
- "files": [f for f in self.files if f[1] == -1 or not frames or (f[1] <= min_frame <= f[2] or f[1] <= max_frame <= f[2])],
- "frames": [f.serialize() for f in self.frames if not frames or f in frames],
- "chunks": self.chunks,
- "priority": self.priority,
- "credits": self.credits,
- "blacklist": self.blacklist,
- "last_dispatched": self.last_dispatched
- }
-
- @staticmethod
- def materialize(data):
- if not data:
- return None
-
- job = RenderJob()
- job.id = data["id"]
- job.name = data["name"]
- job.files = data["files"]
- job.frames = [RenderFrame.materialize(f) for f in data["frames"]]
- job.chunks = data["chunks"]
- job.priority = data["priority"]
- job.credits = data["credits"]
- job.blacklist = data["blacklist"]
- job.last_dispatched = data["last_dispatched"]
-
- return job
-
-class RenderFrame:
- def __init__(self, number = 0):
- self.number = number
- self.time = 0
- self.status = QUEUED
- self.slave = None
-
- def serialize(self):
- return {
- "number": self.number,
- "time": self.time,
- "status": self.status,
- "slave": None if not self.slave else self.slave.serialize()
- }
-
- @staticmethod
- def materialize(data):
- if not data:
- return None
-
- frame = RenderFrame()
- frame.number = data["number"]
- frame.time = data["time"]
- frame.status = data["status"]
- frame.slave = RenderSlave.materialize(data["slave"])
-
- return frame
diff --git a/release/io/netrender/operators.py b/release/io/netrender/operators.py
deleted file mode 100644
index 1c6d89c0043..00000000000
--- a/release/io/netrender/operators.py
+++ /dev/null
@@ -1,236 +0,0 @@
-import bpy
-import sys, os
-import http, http.client, http.server, urllib
-
-from netrender.utils import *
-import netrender.client as client
-import netrender.model
-
-class RENDER_OT_netclientsend(bpy.types.Operator):
- '''
- Operator documentation text, will be used for the operator tooltip and python docs.
- '''
- __idname__ = "render.netclientsend"
- __label__ = "Net Render Client Send"
-
- # List of operator properties, the attributes will be assigned
- # to the class instance from the operator settings before calling.
-
- __props__ = []
-
- def poll(self, context):
- return True
-
- def execute(self, context):
- scene = context.scene
-
- conn = clientConnection(scene)
-
- if conn:
- # Sending file
- scene.network_render.job_id = client.clientSendJob(conn, scene, True)
-
- return ('FINISHED',)
-
- def invoke(self, context, event):
- return self.execute(context)
-
-class RENDER_OT_netclientstatus(bpy.types.Operator):
- '''Operator documentation text, will be used for the operator tooltip and python docs.'''
- __idname__ = "render.netclientstatus"
- __label__ = "Net Render Client Status"
-
- # List of operator properties, the attributes will be assigned
- # to the class instance from the operator settings before calling.
-
- __props__ = []
-
- def poll(self, context):
- return True
-
- def execute(self, context):
- netsettings = context.scene.network_render
- conn = clientConnection(context.scene)
-
- if conn:
- conn.request("GET", "status")
-
- response = conn.getresponse()
- print( response.status, response.reason )
-
- jobs = (netrender.model.RenderJob.materialize(j) for j in eval(str(response.read(), encoding='utf8')))
-
- while(len(netsettings.jobs) > 0):
- netsettings.jobs.remove(0)
-
- bpy.data.netrender_jobs = []
-
- for j in jobs:
- bpy.data.netrender_jobs.append(j)
- netsettings.jobs.add()
- job = netsettings.jobs[-1]
-
- j.results = j.framesStatus() # cache frame status
-
- job.name = j.name
-
- return ('FINISHED',)
-
- def invoke(self, context, event):
- return self.execute(context)
-
-class RENDER_OT_netclientblacklistslave(bpy.types.Operator):
- '''Operator documentation text, will be used for the operator tooltip and python docs.'''
- __idname__ = "render.netclientblacklistslave"
- __label__ = "Net Render Client Blacklist Slave"
-
- # List of operator properties, the attributes will be assigned
- # to the class instance from the operator settings before calling.
-
- __props__ = []
-
- def poll(self, context):
- return True
-
- def execute(self, context):
- netsettings = context.scene.network_render
-
- if netsettings.active_slave_index >= 0:
-
- # deal with data
- slave = bpy.data.netrender_slaves.pop(netsettings.active_slave_index)
- bpy.data.netrender_blacklist.append(slave)
-
- # deal with rna
- netsettings.slaves_blacklist.add()
- netsettings.slaves_blacklist[-1].name = slave.name
-
- netsettings.slaves.remove(netsettings.active_slave_index)
- netsettings.active_slave_index = -1
-
- return ('FINISHED',)
-
- def invoke(self, context, event):
- return self.execute(context)
-
-class RENDER_OT_netclientwhitelistslave(bpy.types.Operator):
- '''Operator documentation text, will be used for the operator tooltip and python docs.'''
- __idname__ = "render.netclientwhitelistslave"
- __label__ = "Net Render Client Whitelist Slave"
-
- # List of operator properties, the attributes will be assigned
- # to the class instance from the operator settings before calling.
-
- __props__ = []
-
- def poll(self, context):
- return True
-
- def execute(self, context):
- netsettings = context.scene.network_render
-
- if netsettings.active_blacklisted_slave_index >= 0:
-
- # deal with data
- slave = bpy.data.netrender_blacklist.pop(netsettings.active_blacklisted_slave_index)
- bpy.data.netrender_slaves.append(slave)
-
- # deal with rna
- netsettings.slaves.add()
- netsettings.slaves[-1].name = slave.name
-
- netsettings.slaves_blacklist.remove(netsettings.active_blacklisted_slave_index)
- netsettings.active_blacklisted_slave_index = -1
-
- return ('FINISHED',)
-
- def invoke(self, context, event):
- return self.execute(context)
-
-
-class RENDER_OT_netclientslaves(bpy.types.Operator):
- '''Operator documentation text, will be used for the operator tooltip and python docs.'''
- __idname__ = "render.netclientslaves"
- __label__ = "Net Render Client Slaves"
-
- # List of operator properties, the attributes will be assigned
- # to the class instance from the operator settings before calling.
-
- __props__ = []
-
- def poll(self, context):
- return True
-
- def execute(self, context):
- netsettings = context.scene.network_render
- conn = clientConnection(context.scene)
-
- if conn:
- conn.request("GET", "slave")
-
- response = conn.getresponse()
- print( response.status, response.reason )
-
- slaves = (netrender.model.RenderSlave.materialize(s) for s in eval(str(response.read(), encoding='utf8')))
-
- while(len(netsettings.slaves) > 0):
- netsettings.slaves.remove(0)
-
- bpy.data.netrender_slaves = []
-
- for s in slaves:
- for i in range(len(bpy.data.netrender_blacklist)):
- slave = bpy.data.netrender_blacklist[i]
- if slave.id == s.id:
- bpy.data.netrender_blacklist[i] = s
- netsettings.slaves_blacklist[i].name = s.name
- break
- else:
- bpy.data.netrender_slaves.append(s)
-
- netsettings.slaves.add()
- slave = netsettings.slaves[-1]
- slave.name = s.name
-
- return ('FINISHED',)
-
- def invoke(self, context, event):
- return self.execute(context)
-
-class RENDER_OT_netclientcancel(bpy.types.Operator):
- '''Operator documentation text, will be used for the operator tooltip and python docs.'''
- __idname__ = "render.netclientcancel"
- __label__ = "Net Render Client Cancel"
-
- # List of operator properties, the attributes will be assigned
- # to the class instance from the operator settings before calling.
-
- __props__ = []
-
- def poll(self, context):
- netsettings = context.scene.network_render
- return netsettings.active_job_index >= 0 and len(netsettings.jobs) > 0
-
- def execute(self, context):
- netsettings = context.scene.network_render
- conn = clientConnection(context.scene)
-
- if conn:
- job = bpy.data.netrender_jobs[netsettings.active_job_index]
-
- conn.request("POST", "cancel", headers={"job-id":job.id})
-
- response = conn.getresponse()
- print( response.status, response.reason )
-
- return ('FINISHED',)
-
- def invoke(self, context, event):
- return self.execute(context)
-
-bpy.ops.add(RENDER_OT_netclientsend)
-bpy.ops.add(RENDER_OT_netclientstatus)
-bpy.ops.add(RENDER_OT_netclientslaves)
-bpy.ops.add(RENDER_OT_netclientblacklistslave)
-bpy.ops.add(RENDER_OT_netclientwhitelistslave)
-bpy.ops.add(RENDER_OT_netclientcancel) \ No newline at end of file
diff --git a/release/io/netrender/slave.py b/release/io/netrender/slave.py
deleted file mode 100644
index c12c846231d..00000000000
--- a/release/io/netrender/slave.py
+++ /dev/null
@@ -1,169 +0,0 @@
-import sys, os
-import http, http.client, http.server, urllib
-import subprocess, time
-
-from netrender.utils import *
-import netrender.model
-
-CANCEL_POLL_SPEED = 2
-MAX_TIMEOUT = 10
-INCREMENT_TIMEOUT = 1
-
-def slave_Info():
- sysname, nodename, release, version, machine = os.uname()
- slave = netrender.model.RenderSlave()
- slave.name = nodename
- slave.stats = sysname + " " + release + " " + machine
- return slave
-
-def testCancel(conn, job_id):
- conn.request("HEAD", "status", headers={"job-id":job_id})
- response = conn.getresponse()
-
- # cancelled if job isn't found anymore
- if response.status == http.client.NO_CONTENT:
- return True
- else:
- return False
-
-def testFile(conn, JOB_PREFIX, file_path, main_path = None):
- job_full_path = prefixPath(JOB_PREFIX, file_path, main_path)
-
- if not os.path.exists(job_full_path):
- temp_path = JOB_PREFIX + "slave.temp.blend"
- conn.request("GET", "file", headers={"job-id": job.id, "slave-id":slave_id, "job-file":file_path})
- response = conn.getresponse()
-
- if response.status != http.client.OK:
- return None # file for job not returned by server, need to return an error code to server
-
- f = open(temp_path, "wb")
- buf = response.read(1024)
-
- while buf:
- f.write(buf)
- buf = response.read(1024)
-
- f.close()
-
- os.renames(temp_path, job_full_path)
-
- return job_full_path
-
-
-def render_slave(engine, scene):
- netsettings = scene.network_render
- timeout = 1
-
- engine.update_stats("", "Network render node initiation")
-
- conn = clientConnection(scene)
-
- if conn:
- conn.request("POST", "slave", repr(slave_Info().serialize()))
- response = conn.getresponse()
-
- slave_id = response.getheader("slave-id")
-
- NODE_PREFIX = netsettings.path + "slave_" + slave_id + os.sep
- if not os.path.exists(NODE_PREFIX):
- os.mkdir(NODE_PREFIX)
-
- while not engine.test_break():
-
- conn.request("GET", "job", headers={"slave-id":slave_id})
- response = conn.getresponse()
-
- if response.status == http.client.OK:
- timeout = 1 # reset timeout on new job
-
- job = netrender.model.RenderJob.materialize(eval(str(response.read(), encoding='utf8')))
-
- JOB_PREFIX = NODE_PREFIX + "job_" + job.id + os.sep
- if not os.path.exists(JOB_PREFIX):
- os.mkdir(JOB_PREFIX)
-
- job_path = job.files[0][0] # data in files have format (path, start, end)
- main_path, main_file = os.path.split(job_path)
-
- job_full_path = testFile(conn, JOB_PREFIX, job_path)
- print("Fullpath", job_full_path)
- print("File:", main_file, "and %i other files" % (len(job.files) - 1,))
- engine.update_stats("", "Render File", main_file, "for job", job.id)
-
- for file_path, start, end in job.files[1:]:
- print("\t", file_path)
- testFile(conn, JOB_PREFIX, file_path, main_path)
-
- frame_args = []
-
- for frame in job.frames:
- print("frame", frame.number)
- frame_args += ["-f", str(frame.number)]
-
- start_t = time.time()
-
- process = subprocess.Popen([sys.argv[0], "-b", job_full_path, "-o", JOB_PREFIX + "######", "-E", "BLENDER_RENDER", "-F", "MULTILAYER"] + frame_args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
-
- cancelled = False
- stdout = bytes()
- run_t = time.time()
- while process.poll() == None and not cancelled:
- stdout += process.stdout.read(32)
- current_t = time.time()
- cancelled = engine.test_break()
- if current_t - run_t > CANCEL_POLL_SPEED:
- if testCancel(conn, job.id):
- cancelled = True
- else:
- run_t = current_t
-
- if cancelled:
- # kill process if needed
- if process.poll() == None:
- process.terminate()
- continue # to next frame
-
- total_t = time.time() - start_t
-
- avg_t = total_t / len(job.frames)
-
- status = process.returncode
-
- print("status", status)
-
- headers = {"job-id":job.id, "slave-id":slave_id, "job-time":str(avg_t)}
-
- if status == 0: # non zero status is error
- headers["job-result"] = str(DONE)
- for frame in job.frames:
- headers["job-frame"] = str(frame.number)
- # send result back to server
- f = open(JOB_PREFIX + "%06d" % frame.number + ".exr", 'rb')
- conn.request("PUT", "render", f, headers=headers)
- f.close()
- response = conn.getresponse()
- else:
- headers["job-result"] = str(ERROR)
- for frame in job.frames:
- headers["job-frame"] = str(frame.number)
- # send error result back to server
- conn.request("PUT", "render", headers=headers)
- response = conn.getresponse()
-
- for frame in job.frames:
- headers["job-frame"] = str(frame.number)
- # send log in any case
- conn.request("PUT", "log", stdout, headers=headers)
- response = conn.getresponse()
- else:
- if timeout < MAX_TIMEOUT:
- timeout += INCREMENT_TIMEOUT
-
- for i in range(timeout):
- time.sleep(1)
- if engine.test_break():
- conn.close()
- return
-
- conn.close()
diff --git a/release/io/netrender/ui.py b/release/io/netrender/ui.py
deleted file mode 100644
index 8faabe6ff2d..00000000000
--- a/release/io/netrender/ui.py
+++ /dev/null
@@ -1,283 +0,0 @@
-import bpy
-import sys, os
-import http, http.client, http.server, urllib
-import subprocess, shutil, time, hashlib
-
-import netrender.slave as slave
-import netrender.master as master
-
-from netrender.utils import *
-
-VERSION = b"0.3"
-
-PATH_PREFIX = "/tmp/"
-
-QUEUED = 0
-DISPATCHED = 1
-DONE = 2
-ERROR = 3
-
-class RenderButtonsPanel(bpy.types.Panel):
- __space_type__ = "PROPERTIES"
- __region_type__ = "WINDOW"
- __context__ = "scene"
- # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
-
- def poll(self, context):
- rd = context.scene.render_data
- return (rd.use_game_engine==False) and (rd.engine in self.COMPAT_ENGINES)
-
-# Setting panel, use in the scene for now.
-class SCENE_PT_network_settings(RenderButtonsPanel):
- __label__ = "Network Settings"
- COMPAT_ENGINES = set(['NET_RENDER'])
-
- def draw_header(self, context):
- layout = self.layout
- scene = context.scene
-
- def draw(self, context):
- layout = self.layout
- scene = context.scene
- rd = scene.render_data
-
- layout.active = True
-
- split = layout.split()
-
- col = split.column()
-
- col.itemR(scene.network_render, "mode")
- col.itemR(scene.network_render, "server_address")
- col.itemR(scene.network_render, "server_port")
- col.itemR(scene.network_render, "path")
-
- if scene.network_render.mode == "RENDER_CLIENT":
- col.itemR(scene.network_render, "chunks")
- col.itemR(scene.network_render, "priority")
- col.itemR(scene.network_render, "job_name")
- col.itemO("render.netclientsend", text="send job to server")
-bpy.types.register(SCENE_PT_network_settings)
-
-class SCENE_PT_network_slaves(RenderButtonsPanel):
- __label__ = "Slaves Status"
- COMPAT_ENGINES = set(['NET_RENDER'])
-
- def poll(self, context):
- scene = context.scene
- return super().poll(context) and scene.network_render.mode == "RENDER_CLIENT"
-
- def draw(self, context):
- layout = self.layout
-
- scene = context.scene
- netsettings = scene.network_render
-
- row = layout.row()
- row.template_list(netsettings, "slaves", netsettings, "active_slave_index", rows=2)
-
- col = row.column()
-
- subcol = col.column(align=True)
- subcol.itemO("render.netclientslaves", icon="ICON_FILE_REFRESH", text="")
- subcol.itemO("render.netclientblacklistslave", icon="ICON_ZOOMOUT", text="")
-
- if len(bpy.data.netrender_slaves) == 0 and len(netsettings.slaves) > 0:
- while(len(netsettings.slaves) > 0):
- netsettings.slaves.remove(0)
-
- if netsettings.active_slave_index >= 0 and len(netsettings.slaves) > 0:
- layout.itemS()
-
- slave = bpy.data.netrender_slaves[netsettings.active_slave_index]
-
- layout.itemL(text="Name: " + slave.name)
- layout.itemL(text="Address: " + slave.address[0])
- layout.itemL(text="Seen: " + time.ctime(slave.last_seen))
- layout.itemL(text="Stats: " + slave.stats)
-
-bpy.types.register(SCENE_PT_network_slaves)
-
-class SCENE_PT_network_slaves_blacklist(RenderButtonsPanel):
- __label__ = "Slaves Blacklist"
- COMPAT_ENGINES = set(['NET_RENDER'])
-
- def poll(self, context):
- scene = context.scene
- return super().poll(context) and scene.network_render.mode == "RENDER_CLIENT"
-
- def draw(self, context):
- layout = self.layout
-
- scene = context.scene
- netsettings = scene.network_render
-
- row = layout.row()
- row.template_list(netsettings, "slaves_blacklist", netsettings, "active_blacklisted_slave_index", rows=2)
-
- col = row.column()
-
- subcol = col.column(align=True)
- subcol.itemO("render.netclientwhitelistslave", icon="ICON_ZOOMOUT", text="")
-
- if len(bpy.data.netrender_blacklist) == 0 and len(netsettings.slaves_blacklist) > 0:
- while(len(netsettings.slaves_blacklist) > 0):
- netsettings.slaves_blacklist.remove(0)
-
- if netsettings.active_blacklisted_slave_index >= 0 and len(netsettings.slaves_blacklist) > 0:
- layout.itemS()
-
- slave = bpy.data.netrender_blacklist[netsettings.active_blacklisted_slave_index]
-
- layout.itemL(text="Name: " + slave.name)
- layout.itemL(text="Address: " + slave.address[0])
- layout.itemL(text="Seen: " + slave.last_seen)
- layout.itemL(text="Stats: " + time.ctime(slave.stats))
-
-bpy.types.register(SCENE_PT_network_slaves_blacklist)
-
-class SCENE_PT_network_jobs(RenderButtonsPanel):
- __label__ = "Jobs"
- COMPAT_ENGINES = set(['NET_RENDER'])
-
- def poll(self, context):
- scene = context.scene
- return super().poll(context) and scene.network_render.mode == "RENDER_CLIENT"
-
- def draw(self, context):
- layout = self.layout
-
- scene = context.scene
- netsettings = scene.network_render
-
- row = layout.row()
- row.template_list(netsettings, "jobs", netsettings, "active_job_index", rows=2)
-
- col = row.column()
-
- subcol = col.column(align=True)
- subcol.itemO("render.netclientstatus", icon="ICON_FILE_REFRESH", text="")
- subcol.itemO("render.netclientcancel", icon="ICON_ZOOMOUT", text="")
-
- if len(bpy.data.netrender_jobs) == 0 and len(netsettings.jobs) > 0:
- while(len(netsettings.jobs) > 0):
- netsettings.jobs.remove(0)
-
- if netsettings.active_job_index >= 0 and len(netsettings.jobs) > 0:
- layout.itemS()
-
- job = bpy.data.netrender_jobs[netsettings.active_job_index]
-
- layout.itemL(text="Name: %s" % job.name)
- layout.itemL(text="Length: %04i" % len(job))
- layout.itemL(text="Done: %04i" % job.results[DONE])
- layout.itemL(text="Error: %04i" % job.results[ERROR])
-
-bpy.types.register(SCENE_PT_network_jobs)
-
-class NetRenderSettings(bpy.types.IDPropertyGroup):
- pass
-
-class NetRenderSlave(bpy.types.IDPropertyGroup):
- pass
-
-class NetRenderJob(bpy.types.IDPropertyGroup):
- pass
-
-bpy.types.register(NetRenderSettings)
-bpy.types.register(NetRenderSlave)
-bpy.types.register(NetRenderJob)
-
-bpy.types.Scene.PointerProperty(attr="network_render", type=NetRenderSettings, name="Network Render", description="Network Render Settings")
-
-NetRenderSettings.StringProperty( attr="server_address",
- name="Server address",
- description="IP or name of the master render server",
- maxlen = 128,
- default = "127.0.0.1")
-
-NetRenderSettings.IntProperty( attr="server_port",
- name="Server port",
- description="port of the master render server",
- default = 8000,
- min=1,
- max=65535)
-
-NetRenderSettings.StringProperty( attr="path",
- name="Path",
- description="Path for temporary files",
- maxlen = 128,
- default = "/tmp/")
-
-NetRenderSettings.StringProperty( attr="job_name",
- name="Job name",
- description="Name of the job",
- maxlen = 128,
- default = "[default]")
-
-NetRenderSettings.IntProperty( attr="chunks",
- name="Chunks",
- description="Number of frame to dispatch to each slave in one chunk",
- default = 5,
- min=1,
- max=65535)
-
-NetRenderSettings.IntProperty( attr="priority",
- name="Priority",
- description="Priority of the job",
- default = 1,
- min=1,
- max=10)
-
-NetRenderSettings.StringProperty( attr="job_id",
- name="Network job id",
- description="id of the last sent render job",
- maxlen = 64,
- default = "")
-
-NetRenderSettings.IntProperty( attr="active_slave_index",
- name="Index of the active slave",
- description="",
- default = -1,
- min= -1,
- max=65535)
-
-NetRenderSettings.IntProperty( attr="active_blacklisted_slave_index",
- name="Index of the active slave",
- description="",
- default = -1,
- min= -1,
- max=65535)
-
-NetRenderSettings.IntProperty( attr="active_job_index",
- name="Index of the active job",
- description="",
- default = -1,
- min= -1,
- max=65535)
-
-NetRenderSettings.EnumProperty(attr="mode",
- items=(
- ("RENDER_CLIENT", "Client", "Act as render client"),
- ("RENDER_MASTER", "Master", "Act as render master"),
- ("RENDER_SLAVE", "Slave", "Act as render slave"),
- ),
- name="network mode",
- description="mode of operation of this instance",
- default="RENDER_CLIENT")
-
-NetRenderSettings.CollectionProperty(attr="slaves", type=NetRenderSlave, name="Slaves", description="")
-NetRenderSettings.CollectionProperty(attr="slaves_blacklist", type=NetRenderSlave, name="Slaves Blacklist", description="")
-NetRenderSettings.CollectionProperty(attr="jobs", type=NetRenderJob, name="Job List", description="")
-
-NetRenderSlave.StringProperty( attr="name",
- name="Name of the slave",
- description="",
- maxlen = 64,
- default = "")
-
-NetRenderJob.StringProperty( attr="name",
- name="Name of the job",
- description="",
- maxlen = 128,
- default = "")
diff --git a/release/io/netrender/utils.py b/release/io/netrender/utils.py
deleted file mode 100644
index d1b383f7a97..00000000000
--- a/release/io/netrender/utils.py
+++ /dev/null
@@ -1,61 +0,0 @@
-import bpy
-import sys, os
-import re
-import http, http.client, http.server, urllib
-import subprocess, shutil, time, hashlib
-
-import netrender.model
-
-VERSION = b"0.5"
-
-QUEUED = 0
-DISPATCHED = 1
-DONE = 2
-ERROR = 3
-
-def clientConnection(scene):
- netrender = scene.network_render
-
- conn = http.client.HTTPConnection(netrender.server_address, netrender.server_port)
-
- if clientVerifyVersion(conn):
- return conn
- else:
- conn.close()
- return None
-
-def clientVerifyVersion(conn):
- conn.request("GET", "version")
- response = conn.getresponse()
-
- if response.status != http.client.OK:
- conn.close()
- return False
-
- server_version = response.read()
-
- if server_version != VERSION:
- print("Incorrect server version!")
- print("expected", VERSION, "received", server_version)
- return False
-
- return True
-
-def prefixPath(prefix_directory, file_path, prefix_path):
- if os.path.isabs(file_path):
- # if an absolute path, make sure path exists, if it doesn't, use relative local path
- full_path = file_path
- if not os.path.exists(full_path):
- p, n = os.path.split(full_path)
-
- if main_path and p.startswith(main_path):
- directory = prefix_directory + p[len(main_path):]
- full_path = directory + n
- if not os.path.exists(directory):
- os.mkdir(directory)
- else:
- full_path = prefix_directory + n
- else:
- full_path = prefix_directory + file_path
-
- return full_path \ No newline at end of file
diff --git a/release/scripts/export_map.py b/release/scripts/export_map.py
index 2262ae3b89b..aca02288c7a 100644
--- a/release/scripts/export_map.py
+++ b/release/scripts/export_map.py
@@ -197,7 +197,7 @@ def is_tricyl_facegroup(faces):
is the face group a tri cylinder
Returens a bool, true if the faces make an extruded tri solid
'''
-
+ return False
# cube must have 5 faces
if len(faces) != 5:
print '1'
diff --git a/release/scripts/help_getting_started.py b/release/scripts/help_getting_started.py
new file mode 100644
index 00000000000..77dda2cf88f
--- /dev/null
+++ b/release/scripts/help_getting_started.py
@@ -0,0 +1,50 @@
+#!BPY
+"""
+Name: 'Getting Started'
+Blender: 248
+Group: 'Help'
+Tooltip: 'Help for new users'
+"""
+
+__author__ = "Matt Ebb"
+__url__ = ("blender", "blenderartists.org")
+__version__ = "1.0.1"
+__bpydoc__ = """\
+This script opens the user's default web browser at www.blender.org's
+"Getting Started" page.
+"""
+
+# $Id$
+#
+# --------------------------------------------------------------------------
+# Getting Started Help Menu Item
+# --------------------------------------------------------------------------
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# ***** END GPL LICENCE BLOCK *****
+# --------------------------------------------------------------------------
+
+import Blender
+try: import webbrowser
+except: webbrowser = None
+
+if webbrowser:
+ webbrowser.open('http://www.blender.org/education-help/tutorials/getting-started/')
+else:
+ Blender.Draw.PupMenu("Error%t|This script requires a full python installation")
+
+
diff --git a/release/scripts/help_manual.py b/release/scripts/help_manual.py
new file mode 100644
index 00000000000..27900040eb4
--- /dev/null
+++ b/release/scripts/help_manual.py
@@ -0,0 +1,48 @@
+#!BPY
+"""
+Name: 'Manual'
+Blender: 248
+Group: 'Help'
+Tooltip: 'The Blender Wiki manual'
+"""
+
+__author__ = "Matt Ebb"
+__url__ = ("blender", "blenderartists.org")
+__version__ = "1.0.1"
+__bpydoc__ = """\
+This script opens the user's default web browser at www.blender.org's
+"Manual" page.
+"""
+
+# --------------------------------------------------------------------------
+# Manual Help Menu Item
+# --------------------------------------------------------------------------
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# ***** END GPL LICENCE BLOCK *****
+# --------------------------------------------------------------------------
+
+import Blender
+try: import webbrowser
+except: webbrowser = None
+
+if webbrowser:
+ webbrowser.open('http://wiki.blender.org/index.php/Manual')
+else:
+ Blender.Draw.PupMenu("Error%t|This script requires a full python installation")
+
+
diff --git a/release/scripts/help_release_notes.py b/release/scripts/help_release_notes.py
new file mode 100644
index 00000000000..870f2391487
--- /dev/null
+++ b/release/scripts/help_release_notes.py
@@ -0,0 +1,47 @@
+#!BPY
+"""
+Name: 'Release Logs'
+Blender: 248
+Group: 'Help'
+Tooltip: 'Information about the changes in this version of Blender'
+"""
+
+__author__ = "Matt Ebb"
+__url__ = ("blender", "blenderartists.org")
+__version__ = "1.0.1"
+__bpydoc__ = """\
+This script opens the user's default web browser at www.blender.org's
+"Release Logs" page.
+"""
+
+# --------------------------------------------------------------------------
+# Release Notes Help Menu Item
+# --------------------------------------------------------------------------
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# ***** END GPL LICENCE BLOCK *****
+# --------------------------------------------------------------------------
+
+import Blender
+try: import webbrowser
+except: webbrowser = None
+
+if webbrowser:
+ webbrowser.open('http://www.blender.org/development/release-logs/')
+else:
+ Blender.Draw.PupMenu("Error%t|This script requires a full python installation")
+
diff --git a/release/scripts/help_tutorials.py b/release/scripts/help_tutorials.py
new file mode 100644
index 00000000000..e0cef1abdbf
--- /dev/null
+++ b/release/scripts/help_tutorials.py
@@ -0,0 +1,47 @@
+#!BPY
+
+"""
+Name: 'Tutorials'
+Blender: 248
+Group: 'Help'
+Tooltip: 'Tutorials for learning to use Blender'
+"""
+
+__author__ = "Matt Ebb"
+__url__ = ("blender", "blenderartists.org")
+__version__ = "1.0.1"
+__bpydoc__ = """\
+This script opens the user's default web browser at www.blender.org's
+"Tutorials" page.
+"""
+
+# --------------------------------------------------------------------------
+# Tutorials Help Menu Item
+# --------------------------------------------------------------------------
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# ***** END GPL LICENCE BLOCK *****
+# --------------------------------------------------------------------------
+
+import Blender
+try: import webbrowser
+except: webbrowser = None
+
+if webbrowser:
+ webbrowser.open('http://www.blender.org/education-help/tutorials/')
+else:
+ Blender.Draw.PupMenu("Error%t|This script requires a full python installation")
diff --git a/release/scripts/help_web_blender.py b/release/scripts/help_web_blender.py
new file mode 100644
index 00000000000..2a0f90844ae
--- /dev/null
+++ b/release/scripts/help_web_blender.py
@@ -0,0 +1,48 @@
+#!BPY
+
+"""
+Name: 'Blender Website'
+Blender: 248
+Group: 'HelpWebsites'
+Tooltip: 'The official Blender website'
+"""
+
+__author__ = "Matt Ebb"
+__url__ = ("blender", "blenderartists.org")
+__version__ = "1.0.1"
+__bpydoc__ = """\
+This script opens the user's default web browser at Blender's main site,
+www.blender.org.
+"""
+
+
+# --------------------------------------------------------------------------
+# Blender Website Help Menu -> Websites Item
+# --------------------------------------------------------------------------
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# ***** END GPL LICENCE BLOCK *****
+# --------------------------------------------------------------------------
+
+import Blender
+try: import webbrowser
+except: webbrowser = None
+
+if webbrowser:
+ webbrowser.open('http://www.blender.org/')
+else:
+ Blender.Draw.PupMenu("Error%t|This script requires a full python installation")
diff --git a/release/scripts/help_web_devcomm.py b/release/scripts/help_web_devcomm.py
new file mode 100644
index 00000000000..46fa2487a89
--- /dev/null
+++ b/release/scripts/help_web_devcomm.py
@@ -0,0 +1,47 @@
+#!BPY
+
+"""
+Name: 'Developer Community'
+Blender: 248
+Group: 'HelpWebsites'
+Tooltip: 'Get involved with Blender development'
+"""
+
+__author__ = "Matt Ebb"
+__url__ = ("blender", "blenderartists.org")
+__version__ = "1.0.1"
+__bpydoc__ = """\
+This script opens the user's default web browser at www.blender.org's
+"Get Involved" page.
+"""
+
+# --------------------------------------------------------------------------
+# Blender Website Help Menu -> Websites Item
+# --------------------------------------------------------------------------
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# ***** END GPL LICENCE BLOCK *****
+# --------------------------------------------------------------------------
+
+import Blender
+try: import webbrowser
+except: webbrowser = None
+
+if webbrowser:
+ webbrowser.open('http://www.blender.org/community/get-involved/')
+else:
+ Blender.Draw.PupMenu("Error%t|This script requires a full python installation")
diff --git a/release/scripts/help_web_eshop.py b/release/scripts/help_web_eshop.py
new file mode 100644
index 00000000000..e40795b3a0d
--- /dev/null
+++ b/release/scripts/help_web_eshop.py
@@ -0,0 +1,47 @@
+#!BPY
+
+"""
+Name: 'Blender E-Shop'
+Blender: 248
+Group: 'HelpWebsites'
+Tooltip: 'Buy official Blender resources and merchandise online'
+"""
+
+__author__ = "Matt Ebb"
+__url__ = ("blender", "blenderartists.org")
+__version__ = "1.0.1"
+__bpydoc__ = """\
+This script opens the user's default web browser at www.blender.org's
+"E-Shop" section.
+"""
+
+# --------------------------------------------------------------------------
+# Blender Website Help Menu -> Websites Item
+# --------------------------------------------------------------------------
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# ***** END GPL LICENCE BLOCK *****
+# --------------------------------------------------------------------------
+
+import Blender
+try: import webbrowser
+except: webbrowser = None
+
+if webbrowser:
+ webbrowser.open('http://www.blender3d.org/e-shop')
+else:
+ Blender.Draw.PupMenu("Error%t|This script requires a full python installation")
diff --git a/release/scripts/help_web_usercomm.py b/release/scripts/help_web_usercomm.py
new file mode 100644
index 00000000000..dda5e42f34e
--- /dev/null
+++ b/release/scripts/help_web_usercomm.py
@@ -0,0 +1,47 @@
+#!BPY
+
+"""
+Name: 'User Community'
+Blender: 248
+Group: 'HelpWebsites'
+Tooltip: 'Get involved with other Blender users'
+"""
+
+__author__ = "Matt Ebb"
+__url__ = ("blender", "blenderartists.org")
+__version__ = "1.0.1"
+__bpydoc__ = """\
+This script opens the user's default web browser at www.blender.org's
+"User Community" page.
+"""
+
+# --------------------------------------------------------------------------
+# Blender Website Help Menu -> Websites Item
+# --------------------------------------------------------------------------
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# ***** END GPL LICENCE BLOCK *****
+# --------------------------------------------------------------------------
+
+import Blender
+try: import webbrowser
+except: webbrowser = None
+
+if webbrowser:
+ webbrowser.open('http://www.blender.org/community/user-community/')
+else:
+ Blender.Draw.PupMenu("Error%t|This script requires a full python installation")
diff --git a/release/test/rna_array.py b/release/test/rna_array.py
deleted file mode 100644
index 9b7c65ff017..00000000000
--- a/release/test/rna_array.py
+++ /dev/null
@@ -1,279 +0,0 @@
-import unittest
-import random
-
-test= bpy.data.test
-
-# farr - 1-dimensional array of float
-# fdarr - dynamic 1-dimensional array of float
-# fmarr - 3-dimensional ([3][4][5]) array of float
-# fdmarr - dynamic 3-dimensional (ditto size) array of float
-
-# same as above for other types except that the first letter is "i" for int and "b" for bool
-
-class TestArray(unittest.TestCase):
- # test that assignment works by: assign -> test value
- # - rvalue = list of float
- # - rvalue = list of numbers
- # test.object
- # bpy.data.test.farr[3], iarr[3], barr[...], fmarr, imarr, bmarr
-
- def setUp(self):
- test.farr= (1.0, 2.0, 3.0)
- test.iarr= (7, 8, 9)
- test.barr= (False, True, False)
-
- # test access
- # test slice access, negative indices
- def test_access(self):
- rvals= ([1.0, 2.0, 3.0], [7, 8, 9], [False, True, False])
- for arr, rval in zip((test.farr, test.iarr, test.barr), rvals):
- self.assertEqual(prop_to_list(arr), rval)
- self.assertEqual(arr[0:3], rval)
- self.assertEqual(arr[1:2], rval[1:2])
- self.assertEqual(arr[-1], arr[2])
- self.assertEqual(arr[-2], arr[1])
- self.assertEqual(arr[-3], arr[0])
-
- # fail when index out of bounds
- def test_access_fail(self):
- for arr in (test.farr, test.iarr, test.barr):
- self.assertRaises(IndexError, lambda : arr[4])
-
- # test assignment of a whole array
- def test_assign_array(self):
- # should accept int as float
- test.farr= (1, 2, 3)
-
- # fail when: unexpected no. of items, invalid item type
- def test_assign_array_fail(self):
- def assign_empty_list(arr):
- setattr(test, arr, ())
-
- for arr in ("farr", "iarr", "barr"):
- self.assertRaises(ValueError, assign_empty_list, arr)
-
- def assign_invalid_float():
- test.farr= (1.0, 2.0, "3.0")
-
- def assign_invalid_int():
- test.iarr= ("1", 2, 3)
-
- def assign_invalid_bool():
- test.barr= (True, 0.123, False)
-
- for func in [assign_invalid_float, assign_invalid_int, assign_invalid_bool]:
- self.assertRaises(TypeError, func)
-
- # shouldn't accept float as int
- def assign_float_as_int():
- test.iarr= (1, 2, 3.0)
- self.assertRaises(TypeError, assign_float_as_int)
-
- # non-dynamic arrays cannot change size
- def assign_different_size(arr, val):
- setattr(test, arr, val)
- for arr, val in zip(("iarr", "farr", "barr"), ((1, 2), (1.0, 2.0), (True, False))):
- self.assertRaises(ValueError, assign_different_size, arr, val)
-
- # test assignment of specific items
- def test_assign_item(self):
- for arr, rand_func in zip((test.farr, test.iarr, test.barr), (rand_float, rand_int, rand_bool)):
- for i in range(len(arr)):
- val= rand_func()
- arr[i]= val
-
- self.assertEqual(arr[i], val)
-
- # float prop should accept also int
- for i in range(len(test.farr)):
- val= rand_int()
- test.farr[i]= val
- self.assertEqual(test.farr[i], float(val))
-
- #
-
- def test_assign_item_fail(self):
- def assign_bad_index(arr):
- arr[4] = 1.0
-
- def assign_bad_type(arr):
- arr[1]= "123"
-
- for arr in [test.farr, test.iarr, test.barr]:
- self.assertRaises(IndexError, assign_bad_index, arr)
-
- # not testing bool because bool allows not only (True|False)
- for arr in [test.farr, test.iarr]:
- self.assertRaises(TypeError, assign_bad_type, arr)
-
- def test_dynamic_assign_array(self):
- # test various lengths here
- for arr, rand_func in zip(("fdarr", "idarr", "bdarr"), (rand_float, rand_int, rand_bool)):
- for length in range(1, 64):
- rval= make_random_array(length, rand_func)
- setattr(test, arr, rval)
- self.assertEqual(prop_to_list(getattr(test, arr)), rval)
-
- def test_dynamic_assign_array_fail(self):
- # could also test too big length here
-
- def assign_empty_list(arr):
- setattr(test, arr, ())
-
- for arr in ("fdarr", "idarr", "bdarr"):
- self.assertRaises(ValueError, assign_empty_list, arr)
-
-
-class TestMArray(unittest.TestCase):
- def setUp(self):
- # reset dynamic array sizes
- for arr, func in zip(("fdmarr", "idmarr", "bdmarr"), (rand_float, rand_int, rand_bool)):
- setattr(test, arr, make_random_3d_array((3, 4, 5), func))
-
- # test assignment
- def test_assign_array(self):
- for arr, func in zip(("fmarr", "imarr", "bmarr"), (rand_float, rand_int, rand_bool)):
- # assignment of [3][4][5]
- rval= make_random_3d_array((3, 4, 5), func)
- setattr(test, arr, rval)
- self.assertEqual(prop_to_list(getattr(test, arr)), rval)
-
- # test assignment of [2][4][5], [1][4][5] should work on dynamic arrays
-
- def test_assign_array_fail(self):
- def assign_empty_array():
- test.fmarr= ()
- self.assertRaises(ValueError, assign_empty_array)
-
- def assign_invalid_size(arr, rval):
- setattr(test, arr, rval)
-
- # assignment of 3,4,4 or 3,3,5 should raise ex
- for arr, func in zip(("fmarr", "imarr", "bmarr"), (rand_float, rand_int, rand_bool)):
- rval= make_random_3d_array((3, 4, 4), func)
- self.assertRaises(ValueError, assign_invalid_size, arr, rval)
-
- rval= make_random_3d_array((3, 3, 5), func)
- self.assertRaises(ValueError, assign_invalid_size, arr, rval)
-
- rval= make_random_3d_array((3, 3, 3), func)
- self.assertRaises(ValueError, assign_invalid_size, arr, rval)
-
- def test_assign_item(self):
- # arr[i] = x
- for arr, func in zip(("fmarr", "imarr", "bmarr", "fdmarr", "idmarr", "bdmarr"), (rand_float, rand_int, rand_bool) * 2):
- rval= make_random_2d_array((4, 5), func)
-
- for i in range(3):
- getattr(test, arr)[i]= rval
- self.assertEqual(prop_to_list(getattr(test, arr)[i]), rval)
-
- # arr[i][j] = x
- for arr, func in zip(("fmarr", "imarr", "bmarr", "fdmarr", "idmarr", "bdmarr"), (rand_float, rand_int, rand_bool) * 2):
-
- arr= getattr(test, arr)
- rval= make_random_array(5, func)
-
- for i in range(3):
- for j in range(4):
- arr[i][j]= rval
- self.assertEqual(prop_to_list(arr[i][j]), rval)
-
-
- def test_assign_item_fail(self):
- def assign_wrong_size(arr, i, rval):
- getattr(test, arr)[i]= rval
-
- # assign wrong size at level 2
- for arr, func in zip(("fmarr", "imarr", "bmarr"), (rand_float, rand_int, rand_bool)):
- rval1= make_random_2d_array((3, 5), func)
- rval2= make_random_2d_array((4, 3), func)
-
- for i in range(3):
- self.assertRaises(ValueError, assign_wrong_size, arr, i, rval1)
- self.assertRaises(ValueError, assign_wrong_size, arr, i, rval2)
-
- def test_dynamic_assign_array(self):
- for arr, func in zip(("fdmarr", "idmarr", "bdmarr"), (rand_float, rand_int, rand_bool)):
- # assignment of [3][4][5]
- rval= make_random_3d_array((3, 4, 5), func)
- setattr(test, arr, rval)
- self.assertEqual(prop_to_list(getattr(test, arr)), rval)
-
- # [2][4][5]
- rval= make_random_3d_array((2, 4, 5), func)
- setattr(test, arr, rval)
- self.assertEqual(prop_to_list(getattr(test, arr)), rval)
-
- # [1][4][5]
- rval= make_random_3d_array((1, 4, 5), func)
- setattr(test, arr, rval)
- self.assertEqual(prop_to_list(getattr(test, arr)), rval)
-
-
- # test access
- def test_access(self):
- pass
-
- # test slice access, negative indices
- def test_access_fail(self):
- pass
-
-random.seed()
-
-def rand_int():
- return random.randint(-1000, 1000)
-
-def rand_float():
- return float(rand_int())
-
-def rand_bool():
- return bool(random.randint(0, 1))
-
-def make_random_array(len, rand_func):
- arr= []
- for i in range(len):
- arr.append(rand_func())
-
- return arr
-
-def make_random_2d_array(dimsize, rand_func):
- marr= []
- for i in range(dimsize[0]):
- marr.append([])
-
- for j in range(dimsize[1]):
- marr[-1].append(rand_func())
-
- return marr
-
-def make_random_3d_array(dimsize, rand_func):
- marr= []
- for i in range(dimsize[0]):
- marr.append([])
-
- for j in range(dimsize[1]):
- marr[-1].append([])
-
- for k in range(dimsize[2]):
- marr[-1][-1].append(rand_func())
-
- return marr
-
-def prop_to_list(prop):
- ret= []
-
- for x in prop:
- if type(x) not in (bool, int, float):
- ret.append(prop_to_list(x))
- else:
- ret.append(x)
-
- return ret
-
-def suite():
- return unittest.TestSuite([unittest.TestLoader().loadTestsFromTestCase(TestArray), unittest.TestLoader().loadTestsFromTestCase(TestMArray)])
-
-if __name__ == "__main__":
- unittest.TextTestRunner(verbosity=2).run(suite())
-
diff --git a/release/ui/bpy_ops.py b/release/ui/bpy_ops.py
index dff8125fca1..aa9bfb460f0 100644
--- a/release/ui/bpy_ops.py
+++ b/release/ui/bpy_ops.py
@@ -5,18 +5,6 @@ from bpy.__ops__ import dir as op_dir
from bpy.__ops__ import call as op_call
from bpy.__ops__ import get_rna as op_get_rna
-# Keep in sync with WM_types.h
-context_dict = {
- 'INVOKE_DEFAULT':0,
- 'INVOKE_REGION_WIN':1,
- 'INVOKE_AREA':2,
- 'INVOKE_SCREEN':3,
- 'EXEC_DEFAULT':4,
- 'EXEC_REGION_WIN':5,
- 'EXEC_AREA':6,
- 'EXEC_SCREEN':7,
-}
-
class bpy_ops(object):
'''
Fake module like class.
@@ -106,22 +94,10 @@ class bpy_ops_submodule_op(object):
# submod.foo -> SUBMOD_OT_foo
return self.module.upper() + '_OT_' + self.func
- def __call__(self, *args, **kw):
+ def __call__(self, **kw):
# Get the operator from blender
- if len(args) > 1:
- raise ValueError("only one argument for the execution context is supported ")
-
- if args:
- try:
- context = context_dict[args[0]]
- except:
- raise ValueError("Expected a single context argument in: " + str(list(context_dict.keys())))
-
- return op_call(self.idname(), kw, context)
-
- else:
- return op_call(self.idname(), kw)
+ return op_call(self.idname(), kw)
def get_rna(self):
'''
diff --git a/release/ui/buttons_data_armature.py b/release/ui/buttons_data_armature.py
index 5924a2eb4ea..9b640776a9e 100644
--- a/release/ui/buttons_data_armature.py
+++ b/release/ui/buttons_data_armature.py
@@ -2,8 +2,8 @@
import bpy
class DataButtonsPanel(bpy.types.Panel):
- __space_type__ = 'PROPERTIES'
- __region_type__ = 'WINDOW'
+ __space_type__ = "PROPERTIES"
+ __region_type__ = "WINDOW"
__context__ = "data"
def poll(self, context):
@@ -41,22 +41,21 @@ class DATA_PT_skeleton(DataButtonsPanel):
split = layout.split()
col = split.column()
- col.itemL(text="Layers:")
- col.itemR(arm, "layer", text="")
- col.itemL(text="Protected Layers:")
- col.itemR(arm, "layer_protection", text="")
- col.itemL(text="Edit Options:")
- col.itemR(arm, "x_axis_mirror")
- col.itemR(arm, "auto_ik")
-
- col = split.column()
col.itemR(arm, "rest_position")
col.itemL(text="Deform:")
col.itemR(arm, "deform_vertexgroups", text="Vertex Groups")
col.itemR(arm, "deform_envelope", text="Envelopes")
col.itemR(arm, "deform_quaternion", text="Quaternion")
col.itemR(arm, "deform_bbone_rest", text="B-Bones Rest")
-
+ #col.itemR(arm, "x_axis_mirror")
+ #col.itemR(arm, "auto_ik")
+
+ col = split.column()
+ col.itemL(text="Layers:")
+ col.template_layers(arm, "layer")
+ col.itemL(text="Protected Layers:")
+ col.template_layers(arm, "layer_protection")
+
class DATA_PT_display(DataButtonsPanel):
__label__ = "Display"
@@ -84,15 +83,15 @@ class DATA_PT_bone_groups(DataButtonsPanel):
layout = self.layout
ob = context.object
- pose = ob.pose
+ pose= ob.pose
row = layout.row()
row.template_list(pose, "bone_groups", pose, "active_bone_group_index")
col = row.column(align=True)
col.active = (ob.proxy == None)
- col.itemO("pose.group_add", icon='ICON_ZOOMIN', text="")
- col.itemO("pose.group_remove", icon='ICON_ZOOMOUT', text="")
+ col.itemO("pose.group_add", icon="ICON_ZOOMIN", text="")
+ col.itemO("pose.group_remove", icon="ICON_ZOOMOUT", text="")
group = pose.active_bone_group
if group:
@@ -155,7 +154,7 @@ class DATA_PT_ghost(DataButtonsPanel):
split = layout.split()
col = split.column()
- col.itemR(arm, "ghost_type", text="")
+ col.itemR(arm, "ghost_type", text="Scope")
sub = col.column(align=True)
if arm.ghost_type == 'RANGE':
diff --git a/release/ui/buttons_data_bone.py b/release/ui/buttons_data_bone.py
index 0d379a4788f..1eb09377892 100644
--- a/release/ui/buttons_data_bone.py
+++ b/release/ui/buttons_data_bone.py
@@ -2,8 +2,8 @@
import bpy
class BoneButtonsPanel(bpy.types.Panel):
- __space_type__ = 'PROPERTIES'
- __region_type__ = 'WINDOW'
+ __space_type__ = "PROPERTIES"
+ __region_type__ = "WINDOW"
__context__ = "bone"
def poll(self, context):
@@ -20,7 +20,7 @@ class BONE_PT_context_bone(BoneButtonsPanel):
bone = context.edit_bone
row = layout.row()
- row.itemL(text="", icon='ICON_BONE_DATA')
+ row.itemL(text="", icon="ICON_BONE_DATA")
row.itemR(bone, "name", text="")
class BONE_PT_transform(BoneButtonsPanel):
@@ -74,15 +74,10 @@ class BONE_PT_bone(BoneButtonsPanel):
def draw(self, context):
layout = self.layout
- ob = context.object
bone = context.bone
arm = context.armature
-
if not bone:
bone = context.edit_bone
- pchan = None
- else:
- pchan = ob.pose.pose_channels[context.bone.name]
split = layout.split()
@@ -92,14 +87,14 @@ class BONE_PT_bone(BoneButtonsPanel):
col.itemR(bone, "parent", text="")
else:
col.item_pointerR(bone, "parent", arm, "edit_bones", text="")
-
+
row = col.row()
row.active = bone.parent != None
row.itemR(bone, "connected")
-
+
col.itemL(text="Layers:")
- col.itemR(bone, "layer", text="")
-
+ col.template_layers(bone, "layer")
+
col = split.column()
col.itemL(text="Inherit:")
col.itemR(bone, "hinge", text="Rotation")
@@ -107,17 +102,6 @@ class BONE_PT_bone(BoneButtonsPanel):
col.itemL(text="Display:")
col.itemR(bone, "draw_wire", text="Wireframe")
col.itemR(bone, "hidden", text="Hide")
-
- if ob and pchan:
- split = layout.split()
-
- col = split.column()
- col.itemL(text="Bone Group:")
- col.item_pointerR(pchan, "bone_group", ob.pose, "bone_groups", text="")
-
- col = split.column()
- col.itemL(text="Custom Shape:")
- col.itemR(pchan, "custom_shape", text="")
class BONE_PT_inverse_kinematics(BoneButtonsPanel):
__label__ = "Inverse Kinematics"
@@ -194,18 +178,18 @@ class BONE_PT_deform(BoneButtonsPanel):
__default_closed__ = True
def draw_header(self, context):
- bone = context.bone
+ layout = self.layout
+ bone = context.bone
if not bone:
bone = context.edit_bone
- self.layout.itemR(bone, "deform", text="")
+ layout.itemR(bone, "deform", text="")
def draw(self, context):
layout = self.layout
bone = context.bone
-
if not bone:
bone = context.edit_bone
diff --git a/release/ui/buttons_data_camera.py b/release/ui/buttons_data_camera.py
index aa107d8dbdd..f2fa4207ec8 100644
--- a/release/ui/buttons_data_camera.py
+++ b/release/ui/buttons_data_camera.py
@@ -2,12 +2,12 @@
import bpy
class DataButtonsPanel(bpy.types.Panel):
- __space_type__ = 'PROPERTIES'
- __region_type__ = 'WINDOW'
+ __space_type__ = "PROPERTIES"
+ __region_type__ = "WINDOW"
__context__ = "data"
def poll(self, context):
- return (context.camera)
+ return (context.camera != None)
class DATA_PT_context_camera(DataButtonsPanel):
__show_header__ = False
@@ -49,7 +49,7 @@ class DATA_PT_camera(DataButtonsPanel):
elif cam.type == 'ORTHO':
row.itemR(cam, "ortho_scale")
- layout.itemR(cam, "panorama")
+ layout.itemR(cam, "panorama");
split = layout.split()
diff --git a/release/ui/buttons_data_curve.py b/release/ui/buttons_data_curve.py
index 1124dfd1ae8..35d557afe32 100644
--- a/release/ui/buttons_data_curve.py
+++ b/release/ui/buttons_data_curve.py
@@ -2,28 +2,13 @@
import bpy
class DataButtonsPanel(bpy.types.Panel):
- __space_type__ = 'PROPERTIES'
- __region_type__ = 'WINDOW'
+ __space_type__ = "PROPERTIES"
+ __region_type__ = "WINDOW"
__context__ = "data"
def poll(self, context):
- return (context.object and context.object.type in ('CURVE', 'SURFACE') and context.curve)
-
-class DataButtonsPanelCurve(DataButtonsPanel):
- '''
- Same as above but for curves only
- '''
- def poll(self, context):
return (context.object and context.object.type == 'CURVE' and context.curve)
-class DataButtonsPanelActive(DataButtonsPanel):
- '''
- Same as above but for curves only
- '''
- def poll(self, context):
- curve = context.curve
- return (curve and curve.active_spline)
-
class DATA_PT_context_curve(DataButtonsPanel):
__show_header__ = False
@@ -52,170 +37,119 @@ class DATA_PT_shape_curve(DataButtonsPanel):
ob = context.object
curve = context.curve
space = context.space_data
- is_surf = (ob.type == 'SURFACE')
- if not is_surf:
- row = layout.row()
- row.itemR(curve, "curve_2d")
- row.itemR(curve, "use_twist_correction")
-
- split = layout.split()
-
- col = split.column()
+ if curve:
+ layout.itemR(curve, "curve_2d")
+
+ split = layout.split()
- if not is_surf:
- sub = col.column()
- sub.active = curve.curve_2d
- sub.itemL(text="Caps:")
- row = sub.row()
- row.itemR(curve, "front")
- row.itemR(curve, "back")
+ col = split.column()
+ colsub = col.column()
+ colsub.active = curve.curve_2d
+ colsub.itemL(text="Caps:")
+ colsub.itemR(curve, "front")
+ colsub.itemR(curve, "back")
- col.itemL(text="Textures:")
-# col.itemR(curve, "uv_orco")
- col.itemR(curve, "auto_texspace")
+ col.itemL(text="Textures:")
+# col.itemR(curve, "uv_orco")
+ col.itemR(curve, "auto_texspace")
- col = split.column()
- col.itemL(text="Resolution:")
- sub = col.column(align=True)
- sub.itemR(curve, "resolution_u", text="Preview U")
- sub.itemR(curve, "render_resolution_u", text="Render U")
-
- if is_surf:
- sub = col.column(align=True)
+ sub = split.column()
+ sub.itemL(text="Resolution:")
+ sub.itemR(curve, "resolution_u", text="Preview U")
sub.itemR(curve, "resolution_v", text="Preview V")
+ sub.itemR(curve, "render_resolution_u", text="Render U")
sub.itemR(curve, "render_resolution_v", text="Render V")
-
-# col.itemL(text="Display:")
-# col.itemL(text="HANDLES")
-# col.itemL(text="NORMALS")
-# col.itemR(curve, "vertex_normal_flip")
+# sub.itemL(text="Display:")
+# sub.itemL(text="HANDLES")
+# sub.itemL(text="NORMALS")
+# sub.itemR(curve, "vertex_normal_flip")
-class DATA_PT_geometry_curve(DataButtonsPanelCurve):
+class DATA_PT_geometry_curve(DataButtonsPanel):
__label__ = "Geometry "
def draw(self, context):
layout = self.layout
curve = context.curve
-
+
split = layout.split()
- col = split.column()
- col.itemL(text="Modification:")
- col.itemR(curve, "width")
- col.itemR(curve, "extrude")
- col.itemR(curve, "taper_object", icon='ICON_OUTLINER_OB_CURVE')
-
- col = split.column()
- col.itemL(text="Bevel:")
- col.itemR(curve, "bevel_depth", text="Depth")
- col.itemR(curve, "bevel_resolution", text="Resolution")
- col.itemR(curve, "bevel_object", icon='ICON_OUTLINER_OB_CURVE')
-
+ sub = split.column()
+ sub.itemL(text="Modification:")
+ sub.itemR(curve, "width")
+ sub.itemR(curve, "extrude")
+ sub.itemR(curve, "taper_object", icon="ICON_OUTLINER_OB_CURVE")
+
+ sub = split.column()
+ sub.itemL(text="Bevel:")
+ sub.itemR(curve, "bevel_depth", text="Depth")
+ sub.itemR(curve, "bevel_resolution", text="Resolution")
+ sub.itemR(curve, "bevel_object", icon="ICON_OUTLINER_OB_CURVE")
-class DATA_PT_pathanim(DataButtonsPanelCurve):
+class DATA_PT_pathanim(DataButtonsPanel):
__label__ = "Path Animation"
def draw_header(self, context):
+ layout = self.layout
+
curve = context.curve
- self.layout.itemR(curve, "use_path", text="")
+ layout.itemR(curve, "path", text="")
def draw(self, context):
layout = self.layout
curve = context.curve
- layout.active = curve.use_path
+ layout.active = curve.path
split = layout.split()
col = split.column()
col.itemR(curve, "path_length", text="Frames")
- col.itemR(curve, "use_path_follow")
+ col.itemR(curve, "follow")
col = split.column()
- col.itemR(curve, "use_stretch")
- col.itemR(curve, "use_time_offset", text="Offset Children")
+ col.itemR(curve, "stretch")
+ col.itemR(curve, "offset_path_distance", text="Offset Children")
-class DATA_PT_active_spline(DataButtonsPanelActive):
- __label__ = "Active Spline"
+class DATA_PT_current_curve(DataButtonsPanel):
+ __label__ = "Current Curve"
def draw(self, context):
layout = self.layout
- ob = context.object
- curve = context.curve
- act_spline = curve.active_spline
- is_surf = (ob.type == 'SURFACE')
- is_poly = (act_spline.type == 'POLY')
-
+ currentcurve = context.curve.curves[0] # XXX
+
split = layout.split()
+
+ col = split.column()
+ col.itemL(text="Cyclic:")
+ col.itemR(currentcurve, "cyclic_u", text="U")
+ col.itemR(currentcurve, "cyclic_v", text="V")
+ col.itemL(text="Order:")
+ col.itemR(currentcurve, "order_u", text="U")
+ col.itemR(currentcurve, "order_v", text="V")
+ col.itemL(text="Endpoints:")
+ col.itemR(currentcurve, "endpoint_u", text="U")
+ col.itemR(currentcurve, "endpoint_v", text="V")
- if is_poly:
- # These settings are below but its easier to have
- # poly's set aside since they use so few settings
- col = split.column()
- col.itemL(text="Cyclic:")
- col.itemR(act_spline, "smooth")
- col = split.column()
- col.itemR(act_spline, "cyclic_u", text="U")
+ col = split.column()
+ col.itemL(text="Bezier:")
+ col.itemR(currentcurve, "bezier_u", text="U")
+ col.itemR(currentcurve, "bezier_v", text="V")
+ col.itemL(text="Resolution:")
+ col.itemR(currentcurve, "resolution_u", text="U")
+ col.itemR(currentcurve, "resolution_v", text="V")
+ col.itemL(text="Interpolation:")
+ col.itemR(currentcurve, "tilt_interpolation", text="Tilt")
+ col.itemR(currentcurve, "radius_interpolation", text="Tilt")
+ col.itemR(currentcurve, "smooth")
- else:
- col = split.column()
- col.itemL(text="Cyclic:")
- if act_spline.type == 'NURBS':
- col.itemL(text="Bezier:")
- col.itemL(text="Endpoint:")
- col.itemL(text="Order:")
-
- col.itemL(text="Resolution:")
-
- col = split.column()
- col.itemR(act_spline, "cyclic_u", text="U")
-
- if act_spline.type == 'NURBS':
- sub = col.column()
- # sub.active = (not act_spline.cyclic_u)
- sub.itemR(act_spline, "bezier_u", text="U")
- sub.itemR(act_spline, "endpoint_u", text="U")
-
- sub = col.column()
- sub.itemR(act_spline, "order_u", text="U")
- col.itemR(act_spline, "resolution_u", text="U")
-
- if is_surf:
- col = split.column()
- col.itemR(act_spline, "cyclic_v", text="V")
-
- # its a surface, assume its a nurb.
- sub = col.column()
- sub.active = (not act_spline.cyclic_v)
- sub.itemR(act_spline, "bezier_v", text="V")
- sub.itemR(act_spline, "endpoint_v", text="V")
- sub = col.column()
- sub.itemR(act_spline, "order_v", text="V")
- sub.itemR(act_spline, "resolution_v", text="V")
-
-
- if not is_surf:
- split = layout.split()
- col = split.column()
- col.active = (not curve.curve_2d)
-
- col.itemL(text="Interpolation:")
- col.itemR(act_spline, "tilt_interpolation", text="Tilt")
- col.itemR(act_spline, "radius_interpolation", text="Radius")
-
- split = layout.split()
- col = split.column()
- col.itemR(act_spline, "smooth")
-
-
bpy.types.register(DATA_PT_context_curve)
bpy.types.register(DATA_PT_shape_curve)
bpy.types.register(DATA_PT_geometry_curve)
bpy.types.register(DATA_PT_pathanim)
-bpy.types.register(DATA_PT_active_spline)
+bpy.types.register(DATA_PT_current_curve)
diff --git a/release/ui/buttons_data_empty.py b/release/ui/buttons_data_empty.py
index 402699f82a4..02fea15dc2a 100644
--- a/release/ui/buttons_data_empty.py
+++ b/release/ui/buttons_data_empty.py
@@ -2,8 +2,8 @@
import bpy
class DataButtonsPanel(bpy.types.Panel):
- __space_type__ = 'PROPERTIES'
- __region_type__ = 'WINDOW'
+ __space_type__ = "PROPERTIES"
+ __region_type__ = "WINDOW"
__context__ = "data"
def poll(self, context):
@@ -17,7 +17,7 @@ class DATA_PT_empty(DataButtonsPanel):
ob = context.object
- layout.itemR(ob, "empty_draw_type", text="Draw Type")
- layout.itemR(ob, "empty_draw_size", text="Draw Size")
+ layout.itemR(ob, "empty_draw_type")
+ layout.itemR(ob, "empty_draw_size")
bpy.types.register(DATA_PT_empty) \ No newline at end of file
diff --git a/release/ui/buttons_data_lamp.py b/release/ui/buttons_data_lamp.py
index 808a205b1b8..a00bb23d5b5 100644
--- a/release/ui/buttons_data_lamp.py
+++ b/release/ui/buttons_data_lamp.py
@@ -2,8 +2,8 @@
import bpy
class DataButtonsPanel(bpy.types.Panel):
- __space_type__ = 'PROPERTIES'
- __region_type__ = 'WINDOW'
+ __space_type__ = "PROPERTIES"
+ __region_type__ = "WINDOW"
__context__ = "data"
def poll(self, context):
@@ -13,7 +13,9 @@ class DATA_PT_preview(DataButtonsPanel):
__label__ = "Preview"
def draw(self, context):
- self.layout.template_preview(context.lamp)
+ layout = self.layout
+
+ layout.template_preview(context.lamp)
class DATA_PT_context_lamp(DataButtonsPanel):
__show_header__ = False
@@ -67,7 +69,8 @@ class DATA_PT_lamp(DataButtonsPanel):
if lamp.type == 'AREA':
col.itemR(lamp, "distance")
col.itemR(lamp, "gamma")
-
+
+
col = split.column()
col.itemR(lamp, "negative")
col.itemR(lamp, "layer", text="This Layer Only")
@@ -296,12 +299,18 @@ class DATA_PT_falloff_curve(DataButtonsPanel):
def poll(self, context):
lamp = context.lamp
- return (lamp and lamp.type in ('POINT', 'SPOT') and lamp.falloff_type == 'CUSTOM_CURVE')
+ if lamp and lamp.type in ('POINT', 'SPOT'):
+ if lamp.falloff_type == 'CUSTOM_CURVE':
+ return True
+
+ return False
def draw(self, context):
+ layout = self.layout
+
lamp = context.lamp
- self.layout.template_curve_mapping(lamp.falloff_curve)
+ layout.template_curve_mapping(lamp.falloff_curve)
bpy.types.register(DATA_PT_context_lamp)
bpy.types.register(DATA_PT_preview)
diff --git a/release/ui/buttons_data_lattice.py b/release/ui/buttons_data_lattice.py
index 895c1a65bea..5d8a07c7d44 100644
--- a/release/ui/buttons_data_lattice.py
+++ b/release/ui/buttons_data_lattice.py
@@ -2,12 +2,12 @@
import bpy
class DataButtonsPanel(bpy.types.Panel):
- __space_type__ = 'PROPERTIES'
- __region_type__ = 'WINDOW'
+ __space_type__ = "PROPERTIES"
+ __region_type__ = "WINDOW"
__context__ = "data"
def poll(self, context):
- return (context.lattice)
+ return (context.lattice != None)
class DATA_PT_context_lattice(DataButtonsPanel):
__show_header__ = False
diff --git a/release/ui/buttons_data_mesh.py b/release/ui/buttons_data_mesh.py
index 33b3960b381..b681218a8fe 100644
--- a/release/ui/buttons_data_mesh.py
+++ b/release/ui/buttons_data_mesh.py
@@ -2,12 +2,12 @@
import bpy
class DataButtonsPanel(bpy.types.Panel):
- __space_type__ = 'PROPERTIES'
- __region_type__ = 'WINDOW'
+ __space_type__ = "PROPERTIES"
+ __region_type__ = "WINDOW"
__context__ = "data"
def poll(self, context):
- return (context.mesh)
+ return (context.mesh != None)
class DATA_PT_context_mesh(DataButtonsPanel):
__show_header__ = False
@@ -48,6 +48,36 @@ class DATA_PT_normals(DataButtonsPanel):
col.itemR(mesh, "vertex_normal_flip")
col.itemR(mesh, "double_sided")
+class DATA_PT_meshdraw(DataButtonsPanel):
+ __label__ = "Draw"
+
+ def draw(self, context):
+ layout = self.layout
+
+ mesh = context.mesh
+
+ layout.itemL(text="Edit Mode only, WIP")
+
+ split = layout.split()
+
+ col = split.column()
+ col.itemR(mesh, "draw_edges", text="Edges")
+ col.itemR(mesh, "draw_faces", text="Faces")
+ col.itemR(mesh, "draw_creases", text="Creases")
+ col.itemR(mesh, "draw_bevel_weights", text="Bevel Weights")
+ col.itemR(mesh, "draw_seams", text="Seams")
+ col.itemR(mesh, "draw_sharp", text="Sharp")
+
+ col = split.column()
+ col.itemR(mesh, "draw_normals", text="Face Normals")
+ col.itemR(mesh, "draw_vertex_normals", text="Vertex Normals")
+
+ col.itemS()
+
+ col.itemR(mesh, "draw_edge_lenght")
+ col.itemR(mesh, "draw_edge_angle")
+ col.itemR(mesh, "draw_face_area")
+
class DATA_PT_vertex_groups(DataButtonsPanel):
__label__ = "Vertex Groups"
@@ -63,19 +93,19 @@ class DATA_PT_vertex_groups(DataButtonsPanel):
row.template_list(ob, "vertex_groups", ob, "active_vertex_group_index")
col = row.column(align=True)
- col.itemO("object.vertex_group_add", icon='ICON_ZOOMIN', text="")
- col.itemO("object.vertex_group_remove", icon='ICON_ZOOMOUT', text="")
+ col.itemO("object.vertex_group_add", icon="ICON_ZOOMIN", text="")
+ col.itemO("object.vertex_group_remove", icon="ICON_ZOOMOUT", text="")
- col.itemO("object.vertex_group_copy", icon='ICON_BLANK1', text="")
+ col.itemO("object.vertex_group_copy", icon="ICON_BLANK1", text="")
if ob.data.users > 1:
- col.itemO("object.vertex_group_copy_to_linked", icon='ICON_BLANK1', text="")
+ col.itemO("object.vertex_group_copy_to_linked", icon="ICON_BLANK1", text="")
group = ob.active_vertex_group
if group:
row = layout.row()
row.itemR(group, "name")
- if ob.mode == 'EDIT':
+ if context.edit_object:
row = layout.row()
sub = row.row(align=True)
@@ -102,20 +132,20 @@ class DATA_PT_shape_keys(DataButtonsPanel):
kb = ob.active_shape_key
row = layout.row()
- row.template_list(key, "keys", ob, "active_shape_key_index", rows=2)
+ row.template_list(key, "keys", ob, "active_shape_key_index")
col = row.column()
subcol = col.column(align=True)
- subcol.itemO("object.shape_key_add", icon='ICON_ZOOMIN', text="")
- subcol.itemO("object.shape_key_remove", icon='ICON_ZOOMOUT', text="")
+ subcol.itemO("object.shape_key_add", icon="ICON_ZOOMIN", text="")
+ subcol.itemO("object.shape_key_remove", icon="ICON_ZOOMOUT", text="")
if kb:
col.itemS()
subcol = col.column(align=True)
- subcol.itemR(ob, "shape_key_lock", icon='ICON_UNPINNED', text="")
- subcol.itemR(kb, "mute", icon='ICON_MUTE_IPO_ON', text="")
+ subcol.itemR(ob, "shape_key_lock", icon="ICON_UNPINNED", text="")
+ subcol.itemR(kb, "mute", icon="ICON_MUTE_IPO_ON", text="")
if key.relative:
row = layout.row()
@@ -150,7 +180,7 @@ class DATA_PT_shape_keys(DataButtonsPanel):
layout.itemR(kb, "name")
- if ob.mode == 'EDIT':
+ if context.edit_object:
layout.enabled = False
class DATA_PT_uv_texture(DataButtonsPanel):
@@ -167,8 +197,8 @@ class DATA_PT_uv_texture(DataButtonsPanel):
col.template_list(me, "uv_textures", me, "active_uv_texture_index", rows=2)
col = row.column(align=True)
- col.itemO("mesh.uv_texture_add", icon='ICON_ZOOMIN', text="")
- col.itemO("mesh.uv_texture_remove", icon='ICON_ZOOMOUT', text="")
+ col.itemO("mesh.uv_texture_add", icon="ICON_ZOOMIN", text="")
+ col.itemO("mesh.uv_texture_remove", icon="ICON_ZOOMOUT", text="")
lay = me.active_uv_texture
if lay:
@@ -188,8 +218,8 @@ class DATA_PT_vertex_colors(DataButtonsPanel):
col.template_list(me, "vertex_colors", me, "active_vertex_color_index", rows=2)
col = row.column(align=True)
- col.itemO("mesh.vertex_color_add", icon='ICON_ZOOMIN', text="")
- col.itemO("mesh.vertex_color_remove", icon='ICON_ZOOMOUT', text="")
+ col.itemO("mesh.vertex_color_add", icon="ICON_ZOOMIN", text="")
+ col.itemO("mesh.vertex_color_remove", icon="ICON_ZOOMOUT", text="")
lay = me.active_vertex_color
if lay:
@@ -197,6 +227,7 @@ class DATA_PT_vertex_colors(DataButtonsPanel):
bpy.types.register(DATA_PT_context_mesh)
bpy.types.register(DATA_PT_normals)
+bpy.types.register(DATA_PT_meshdraw)
bpy.types.register(DATA_PT_vertex_groups)
bpy.types.register(DATA_PT_shape_keys)
bpy.types.register(DATA_PT_uv_texture)
diff --git a/release/ui/buttons_data_metaball.py b/release/ui/buttons_data_metaball.py
index 88c0066c67f..e31c3d7fcd0 100644
--- a/release/ui/buttons_data_metaball.py
+++ b/release/ui/buttons_data_metaball.py
@@ -1,8 +1,8 @@
import bpy
class DataButtonsPanel(bpy.types.Panel):
- __space_type__ = 'PROPERTIES'
- __region_type__ = 'WINDOW'
+ __space_type__ = "PROPERTIES"
+ __region_type__ = "WINDOW"
__context__ = "data"
def poll(self, context):
diff --git a/release/ui/buttons_data_modifier.py b/release/ui/buttons_data_modifier.py
index 2835f55f71a..436baa540d4 100644
--- a/release/ui/buttons_data_modifier.py
+++ b/release/ui/buttons_data_modifier.py
@@ -2,8 +2,8 @@
import bpy
class DataButtonsPanel(bpy.types.Panel):
- __space_type__ = 'PROPERTIES'
- __region_type__ = 'WINDOW'
+ __space_type__ = "PROPERTIES"
+ __region_type__ = "WINDOW"
__context__ = "modifier"
class DATA_PT_modifiers(DataButtonsPanel):
@@ -27,7 +27,6 @@ class DATA_PT_modifiers(DataButtonsPanel):
# the mt.type enum is (ab)used for a lookup on function names
# ...to avoid lengthy if statements
# so each type must have a function here.
-
def ARMATURE(self, layout, ob, md):
layout.itemR(md, "object")
@@ -171,7 +170,7 @@ class DATA_PT_modifiers(DataButtonsPanel):
if md.texture_coordinates == 'OBJECT':
layout.itemR(md, "texture_coordinate_object", text="Object")
elif md.texture_coordinates == 'UV' and ob.type == 'MESH':
- layout.item_pointerR(md, "uv_layer", ob.data, "uv_textures")
+ layout.item_pointerR(md, "uv_layer", ob.data, "uv_layers")
def EDGE_SPLIT(self, layout, ob, md):
split = layout.split()
@@ -188,40 +187,21 @@ class DATA_PT_modifiers(DataButtonsPanel):
def EXPLODE(self, layout, ob, md):
layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
layout.itemR(md, "protect")
-
- flow = layout.column_flow(2)
- flow.itemR(md, "split_edges")
- flow.itemR(md, "unborn")
- flow.itemR(md, "alive")
- flow.itemR(md, "dead")
-
- layout.itemO("object.explode_refresh", text="Refresh");
+ layout.itemR(md, "split_edges")
+ layout.itemR(md, "unborn")
+ layout.itemR(md, "alive")
+ layout.itemR(md, "dead")
+ # Missing: "Refresh" and "Clear Vertex Group" Operator
def FLUID_SIMULATION(self, layout, ob, md):
layout.itemL(text="See Fluid panel.")
def HOOK(self, layout, ob, md):
- col = layout.column()
- col.itemR(md, "object")
- if md.object and md.object.type == 'ARMATURE':
- layout.item_pointerR(md, "subtarget", md.object.data, "bones", text="Bone")
-
+ layout.itemR(md, "falloff")
+ layout.itemR(md, "force", slider=True)
+ layout.itemR(md, "object")
layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
-
- split = layout.split()
- split.itemR(md, "falloff")
- split.itemR(md, "force", slider=True)
-
- layout.itemS()
-
- row = layout.row()
- row.itemO("object.hook_reset", text="Reset")
- row.itemO("object.hook_recenter", text="Recenter")
-
- if ob.mode == 'EDIT':
- row = layout.row()
- row.itemO("object.hook_select", text="Select")
- row.itemO("object.hook_assign", text="Assign")
+ # Missing: "Reset" and "Recenter" Operator
def LATTICE(self, layout, ob, md):
layout.itemR(md, "object")
@@ -242,7 +222,7 @@ class DATA_PT_modifiers(DataButtonsPanel):
layout.itemS()
- layout.itemO("object.meshdeform_bind", text="Bind")
+ layout.itemO("object.modifier_mdef_bind", text="Bind")
row = layout.row()
row.itemR(md, "precision")
row.itemR(md, "dynamic")
@@ -269,11 +249,7 @@ class DATA_PT_modifiers(DataButtonsPanel):
def MULTIRES(self, layout, ob, md):
layout.itemR(md, "subdivision_type")
-
- row = layout.row()
- row.itemO("object.multires_subdivide", text="Subdivide")
- row.itemO("object.multires_higher_levels_delete", text="Delete Higher")
-
+ layout.itemO("object.multires_subdivide", text="Subdivide")
layout.itemR(md, "level")
def PARTICLE_INSTANCE(self, layout, ob, md):
@@ -370,26 +346,16 @@ class DATA_PT_modifiers(DataButtonsPanel):
def UV_PROJECT(self, layout, ob, md):
if ob.type == 'MESH':
- layout.item_pointerR(md, "uv_layer", ob.data, "uv_textures")
+ layout.item_pointerR(md, "uv_layer", ob.data, "uv_layers")
+ #layout.itemR(md, "projectors")
layout.itemR(md, "image")
layout.itemR(md, "override_image")
-
- split = layout.split()
-
- col = split.column()
- col.itemL(text="Aspect Ratio:")
-
- sub = col.column(align=True)
- sub.itemR(md, "horizontal_aspect_ratio", text="Horizontal")
- sub.itemR(md, "vertical_aspect_ratio", text="Vertical")
-
- col = split.column()
- col.itemL(text="Projectors:")
-
- sub = col.column(align=True)
- sub.itemR(md, "num_projectors", text="Number")
- for proj in md.projectors:
- sub.itemR(proj, "object", text="")
+ layout.itemL(text="Aspect Ratio:")
+ col = layout.column(align=True)
+ col.itemR(md, "horizontal_aspect_ratio", text="Horizontal")
+ col.itemR(md, "vertical_aspect_ratio", text="Vertical")
+
+ #"Projectors" don't work.
def WAVE(self, layout, ob, md):
split = layout.split()
@@ -402,41 +368,29 @@ class DATA_PT_modifiers(DataButtonsPanel):
col = split.column()
col.itemR(md, "normals")
- sub = col.column()
+ sub = col.row(align=True)
sub.active = md.normals
- sub.itemR(md, "x_normal", text="X")
- sub.itemR(md, "y_normal", text="Y")
- sub.itemR(md, "z_normal", text="Z")
-
- split = layout.split()
-
- col = split.column()
- col.itemL(text="Time:")
- sub = col.column(align=True)
- sub.itemR(md, "time_offset", text="Offset")
- sub.itemR(md, "lifetime", text="Life")
- col.itemR(md, "damping_time", text="Damping")
-
- col = split.column()
- col.itemL(text="Position:")
- sub = col.column(align=True)
- sub.itemR(md, "start_position_x", text="X")
- sub.itemR(md, "start_position_y", text="Y")
- col.itemR(md, "falloff_radius", text="Falloff")
+ sub.itemR(md, "x_normal", text="X", toggle=True)
+ sub.itemR(md, "y_normal", text="Y", toggle=True)
+ sub.itemR(md, "z_normal", text="Z", toggle=True)
- layout.itemS()
+ flow = layout.column_flow()
+ flow.itemR(md, "time_offset")
+ flow.itemR(md, "lifetime")
+ flow.itemR(md, "damping_time")
+ flow.itemR(md, "falloff_radius")
+ flow.itemR(md, "start_position_x")
+ flow.itemR(md, "start_position_y")
layout.itemR(md, "start_position_object")
layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
layout.itemR(md, "texture")
layout.itemR(md, "texture_coordinates")
if md.texture_coordinates == 'MAP_UV' and ob.type == 'MESH':
- layout.item_pointerR(md, "uv_layer", ob.data, "uv_textures")
+ layout.item_pointerR(md, "uv_layer", ob.data, "uv_layers")
elif md.texture_coordinates == 'OBJECT':
layout.itemR(md, "texture_coordinates_object")
- layout.itemS()
-
flow = layout.column_flow()
flow.itemR(md, "speed", slider=True)
flow.itemR(md, "height", slider=True)
diff --git a/release/ui/buttons_data_text.py b/release/ui/buttons_data_text.py
index d0e7ea09a92..754d6fcda39 100644
--- a/release/ui/buttons_data_text.py
+++ b/release/ui/buttons_data_text.py
@@ -2,8 +2,8 @@
import bpy
class DataButtonsPanel(bpy.types.Panel):
- __space_type__ = 'PROPERTIES'
- __region_type__ = 'WINDOW'
+ __space_type__ = "PROPERTIES"
+ __region_type__ = "WINDOW"
__context__ = "data"
def poll(self, context):
@@ -38,31 +38,29 @@ class DATA_PT_shape_text(DataButtonsPanel):
curve = context.curve
space = context.space_data
- layout.itemR(curve, "curve_2d")
+ if curve:
+ layout.itemR(curve, "curve_2d")
- split = layout.split()
-
- col = split.column()
- col.itemL(text="Caps:")
- row = col.row()
- row .itemR(curve, "front")
- row .itemR(curve, "back")
- # col = split.column()
- col.itemL(text="Textures:")
- col.itemR(curve, "uv_orco")
- col.itemR(curve, "auto_texspace")
+ split = layout.split()
+
+ col = split.column()
+ col.itemL(text="Caps:")
+ col.itemR(curve, "front")
+ col.itemR(curve, "back")
+ col.itemL(text="Textures:")
+ col.itemR(curve, "uv_orco")
+ col.itemR(curve, "auto_texspace")
- col = split.column()
- col.itemL(text="Resolution:")
- sub = col.column(align=True)
- sub.itemR(curve, "resolution_u", text="Preview U")
- sub.itemR(curve, "render_resolution_u", text="Render U")
-
- # resolution_v is not used for text
-
- sub = col.column(align=True)
- col.itemL(text="Display:")
- col.itemR(curve, "fast", text="Fast Editing")
+ col = split.column()
+ col.itemL(text="Resolution:")
+ sub = col.column(align=True)
+ sub.itemR(curve, "resolution_u", text="Preview U")
+ sub.itemR(curve, "render_resolution_u", text="Render U")
+ sub = col.column(align=True)
+ sub.itemR(curve, "resolution_v", text="Preview V")
+ sub.itemR(curve, "render_resolution_v", text="Render V")
+ col.itemL(text="Display:")
+ col.itemR(curve, "fast")
class DATA_PT_geometry_text(DataButtonsPanel):
__label__ = "Geometry"
@@ -78,15 +76,13 @@ class DATA_PT_geometry_text(DataButtonsPanel):
col.itemL(text="Modification:")
col.itemR(curve, "width")
col.itemR(curve, "extrude")
- col.itemL(text="Taper Object:")
- col.itemR(curve, "taper_object", text="")
+ col.itemR(curve, "taper_object")
col = split.column()
col.itemL(text="Bevel:")
col.itemR(curve, "bevel_depth", text="Depth")
col.itemR(curve, "bevel_resolution", text="Resolution")
- col.itemL(text="Bevel Object:")
- col.itemR(curve, "bevel_object", text="")
+ col.itemR(curve, "bevel_object")
class DATA_PT_font(DataButtonsPanel):
__label__ = "Font"
@@ -95,39 +91,27 @@ class DATA_PT_font(DataButtonsPanel):
layout = self.layout
text = context.curve
- char = context.curve.edit_format
layout.itemR(text, "font")
- row = layout.row()
- row.itemR(text, "text_size", text="Size")
- row.itemR(text, "shear")
-
split = layout.split()
col = split.column()
- col.itemL(text="Object Font:")
- col.itemR(text, "family", text="")
+ # col.itemR(text, "style")
+ # col.itemR(text, "bold")
+ # col.itemR(text, "italic")
+ # col.itemR(text, "underline")
+ # ToDo: These settings are in a sub struct (Edit Format).
+ col.itemR(text, "text_size")
+ col.itemR(text, "shear")
col = split.column()
- col.itemL(text="Text on Curve:")
- col.itemR(text, "text_on_curve", text="")
-
- split = layout.split()
-
- col = split.column()
- col.itemL(text="Character:")
- col.itemR(char, "bold")
- col.itemR(char, "italic")
- col.itemR(char, "underline")
-# col.itemR(char, "style")
-# col.itemR(char, "wrap")
-
- col = split.column(align=True)
+ col.itemR(text, "text_on_curve")
+ col.itemR(text, "family")
col.itemL(text="Underline:")
col.itemR(text, "ul_position", text="Position")
- col.itemR(text, "ul_height", text="Thickness")
-
+ col.itemR(text, "ul_height", text="Height")
+ # col.itemR(text, "edit_format")
class DATA_PT_paragraph(DataButtonsPanel):
__label__ = "Paragraph"
@@ -150,34 +134,23 @@ class DATA_PT_paragraph(DataButtonsPanel):
col = split.column(align=True)
col.itemL(text="Offset:")
- col.itemR(text, "offset_x", text="X")
- col.itemR(text, "offset_y", text="Y")
-
+ col.itemR(text, "x_offset", text="X")
+ col.itemR(text, "y_offset", text="Y")
+ #col.itemR(text, "wrap")
+"""
class DATA_PT_textboxes(DataButtonsPanel):
- __label__ = "Text Boxes"
+ __label__ = "Text Boxes"
- def draw(self, context):
- layout = self.layout
+ def draw(self, context):
+ layout = self.layout
- text = context.curve
-
- for box in text.textboxes:
- split = layout.box().split()
-
- col = split.column(align=True)
- col.itemL(text="Dimensions:")
- col.itemR(box, "width", text="Width")
- col.itemR(box, "height", text="Height")
-
- col = split.column(align=True)
- col.itemL(text="Offset:")
- col.itemR(box, "x", text="X")
- col.itemR(box, "y", text="Y")
+ text = context.curve
+"""
bpy.types.register(DATA_PT_context_text)
bpy.types.register(DATA_PT_shape_text)
bpy.types.register(DATA_PT_geometry_text)
bpy.types.register(DATA_PT_font)
bpy.types.register(DATA_PT_paragraph)
-bpy.types.register(DATA_PT_textboxes)
+#bpy.types.register(DATA_PT_textboxes)
diff --git a/release/ui/buttons_game.py b/release/ui/buttons_game.py
index 73ba566e23f..7334b453e91 100644
--- a/release/ui/buttons_game.py
+++ b/release/ui/buttons_game.py
@@ -2,8 +2,8 @@
import bpy
class PhysicsButtonsPanel(bpy.types.Panel):
- __space_type__ = 'PROPERTIES'
- __region_type__ = 'WINDOW'
+ __space_type__ = "PROPERTIES"
+ __region_type__ = "WINDOW"
__context__ = "physics"
def poll(self, context):
@@ -45,9 +45,10 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel):
col = split.column()
col.itemL(text="Attributes:")
- col.itemR(game, "mass")
- col.itemR(game, "radius")
- col.itemR(game, "form_factor")
+ sub = col.column()
+ sub.itemR(game, "mass")
+ sub.itemR(game, "radius")
+ sub.itemR(game, "form_factor")
col = split.column()
sub = col.column()
@@ -107,7 +108,8 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel):
col.itemR(soft, "dynamic_friction", slider=True)
col.itemR(soft, "margin", slider=True)
col.itemR(soft, "bending_const", text="Bending Constraints")
-
+
+
col = split.column()
col.itemR(soft, "shape_match")
sub = col.column()
@@ -132,26 +134,32 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel):
elif game.physics_type in ('SENSOR', 'INVISIBLE', 'NO_COLLISION', 'OCCLUDE'):
- layout.itemR(ob, "restrict_render", text="Invisible")
+ col = layout.column()
+ col.itemR(ob, "restrict_render", text="Invisible")
class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel):
__label__ = "Collision Bounds"
def poll(self, context):
- game = context.object.game
+ ob = context.active_object
+ game = ob.game
rd = context.scene.render_data
return (game.physics_type in ('DYNAMIC', 'RIGID_BODY', 'SENSOR', 'SOFT_BODY', 'STATIC')) and (rd.engine == 'BLENDER_GAME')
def draw_header(self, context):
- game = context.active_object.game
+ layout = self.layout
+
+ ob = context.active_object
+ game = ob.game
- self.layout.itemR(game, "use_collision_bounds", text="")
+ layout.itemR(game, "use_collision_bounds", text="")
def draw(self, context):
layout = self.layout
- game = context.active_object.game
-
+ ob = context.scene.objects[0]
+ game = ob.game
+
layout.active = game.use_collision_bounds
layout.itemR(game, "collision_bounds", text="Bounds")
@@ -163,8 +171,8 @@ bpy.types.register(PHYSICS_PT_game_physics)
bpy.types.register(PHYSICS_PT_game_collision_bounds)
class SceneButtonsPanel(bpy.types.Panel):
- __space_type__ = 'PROPERTIES'
- __region_type__ = 'WINDOW'
+ __space_type__ = "PROPERTIES"
+ __region_type__ = "WINDOW"
__context__ = "scene"
def poll(self, context):
@@ -176,6 +184,8 @@ class SCENE_PT_game(SceneButtonsPanel):
def draw(self, context):
layout = self.layout
+
+ rd = context.scene.render_data
row = layout.row()
row.itemO("view3d.game_start", text="Start")
@@ -312,8 +322,8 @@ bpy.types.register(SCENE_PT_game_shading)
bpy.types.register(SCENE_PT_game_performance)
class WorldButtonsPanel(bpy.types.Panel):
- __space_type__ = 'PROPERTIES'
- __region_type__ = 'WINDOW'
+ __space_type__ = "PROPERTIES"
+ __region_type__ = "WINDOW"
__context__ = "world"
def poll(self, context):
diff --git a/release/ui/buttons_material.py b/release/ui/buttons_material.py
index dc11731d7a9..b971a678926 100644
--- a/release/ui/buttons_material.py
+++ b/release/ui/buttons_material.py
@@ -2,22 +2,24 @@
import bpy
class MaterialButtonsPanel(bpy.types.Panel):
- __space_type__ = 'PROPERTIES'
- __region_type__ = 'WINDOW'
+ __space_type__ = "PROPERTIES"
+ __region_type__ = "WINDOW"
__context__ = "material"
# COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
def poll(self, context):
- mat = context.material
- engine = context.scene.render_data.engine
- return mat and (engine in self.COMPAT_ENGINES)
+ return (context.material) and (context.scene.render_data.engine in self.COMPAT_ENGINES)
class MATERIAL_PT_preview(MaterialButtonsPanel):
__label__ = "Preview"
COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
def draw(self, context):
- self.layout.template_preview(context.material)
+ layout = self.layout
+
+ mat = context.material
+
+ layout.template_preview(mat)
class MATERIAL_PT_context_material(MaterialButtonsPanel):
__show_header__ = False
@@ -27,8 +29,7 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel):
# An exception, dont call the parent poll func because
# this manages materials for all engine types
- engine = context.scene.render_data.engine
- return (context.object) and (engine in self.COMPAT_ENGINES)
+ return (context.object) and (context.scene.render_data.engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
@@ -44,10 +45,10 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel):
row.template_list(ob, "materials", ob, "active_material_index", rows=2)
col = row.column(align=True)
- col.itemO("object.material_slot_add", icon='ICON_ZOOMIN', text="")
- col.itemO("object.material_slot_remove", icon='ICON_ZOOMOUT', text="")
+ col.itemO("object.material_slot_add", icon="ICON_ZOOMIN", text="")
+ col.itemO("object.material_slot_remove", icon="ICON_ZOOMOUT", text="")
- if ob.mode == 'EDIT':
+ if context.edit_object:
row = layout.row(align=True)
row.itemO("object.material_slot_assign", text="Assign")
row.itemO("object.material_slot_select", text="Select")
@@ -72,36 +73,34 @@ class MATERIAL_PT_shading(MaterialButtonsPanel):
__label__ = "Shading"
COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
- def poll(self, context):
- mat = context.material
- engine = context.scene.render_data.engine
- return mat and (mat.type in ('SURFACE', 'WIRE', 'HALO')) and (engine in self.COMPAT_ENGINES)
-
def draw(self, context):
layout = self.layout
mat = context.material
+ ob = context.object
+ slot = context.material_slot
+ space = context.space_data
- if mat.type in ('SURFACE', 'WIRE'):
- split = layout.split()
+ if mat:
+
+ if mat.type in ('SURFACE', 'WIRE', 'VOLUME'):
+ split = layout.split()
- col = split.column()
- sub = col.column()
- sub.active = not mat.shadeless
- sub.itemR(mat, "emit")
- sub.itemR(mat, "ambient")
- sub = col.column()
- sub.itemR(mat, "translucency")
+ col = split.column()
+ col.active = not mat.shadeless
+ col.itemR(mat, "ambient")
+ col.itemR(mat, "emit")
+ col.itemR(mat, "translucency")
- col = split.column()
- col.itemR(mat, "shadeless")
- sub = col.column()
- sub.active = not mat.shadeless
- sub.itemR(mat, "tangent_shading")
- sub.itemR(mat, "cubic")
+ col = split.column()
+ col.itemR(mat, "shadeless")
+ sub = col.column()
+ sub.active = not mat.shadeless
+ sub.itemR(mat, "tangent_shading")
+ sub.itemR(mat, "cubic")
- elif mat.type == 'HALO':
- layout.itemR(mat, "alpha")
+ elif mat.type == 'HALO':
+ layout.itemR(mat, "alpha")
class MATERIAL_PT_strand(MaterialButtonsPanel):
__label__ = "Strand"
@@ -110,8 +109,7 @@ class MATERIAL_PT_strand(MaterialButtonsPanel):
def poll(self, context):
mat = context.material
- engine = context.scene.render_data.engine
- return mat and (mat.type in ('SURFACE', 'WIRE', 'HALO')) and (engine in self.COMPAT_ENGINES)
+ return mat and (mat.type in ('SURFACE', 'WIRE')) and (context.scene.render_data.engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
@@ -121,22 +119,20 @@ class MATERIAL_PT_strand(MaterialButtonsPanel):
split = layout.split()
- col = split.column(align=True)
+ col = split.column()
col.itemL(text="Size:")
- col.itemR(tan, "root_size", text="Root")
- col.itemR(tan, "tip_size", text="Tip")
+ col.itemR(tan, "start_size", text="Root")
+ col.itemR(tan, "end_size", text="Tip")
col.itemR(tan, "min_size", text="Minimum")
col.itemR(tan, "blender_units")
sub = col.column()
sub.active = (not mat.shadeless)
sub.itemR(tan, "tangent_shading")
- col.itemR(tan, "shape")
col = split.column()
- col.itemL(text="Shading:")
+ col.itemR(tan, "shape")
col.itemR(tan, "width_fade")
col.itemR(tan, "uv_layer")
- col.itemS()
sub = col.column()
sub.active = (not mat.shadeless)
sub.itemR(tan, "surface_diffuse")
@@ -151,7 +147,8 @@ class MATERIAL_PT_physics(MaterialButtonsPanel):
def draw(self, context):
layout = self.layout
- phys = context.material.physics
+ mat = context.material
+ phys = mat.physics
split = layout.split()
@@ -169,11 +166,6 @@ class MATERIAL_PT_options(MaterialButtonsPanel):
__label__ = "Options"
COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
- def poll(self, context):
- mat = context.material
- engine = context.scene.render_data.engine
- return mat and (mat.type in ('SURFACE', 'WIRE', 'HALO')) and (engine in self.COMPAT_ENGINES)
-
def draw(self, context):
layout = self.layout
@@ -208,11 +200,6 @@ class MATERIAL_PT_shadow(MaterialButtonsPanel):
__label__ = "Shadow"
__default_closed__ = True
COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
-
- def poll(self, context):
- mat = context.material
- engine = context.scene.render_data.engine
- return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
@@ -223,7 +210,7 @@ class MATERIAL_PT_shadow(MaterialButtonsPanel):
col = split.column()
col.itemR(mat, "shadows", text="Receive")
- col.itemR(mat, "receive_transparent_shadows", text="Receive Transparent")
+ col.itemR(mat, "transparent_shadows", text="Receive Transparent")
col.itemR(mat, "only_shadow", text="Shadows Only")
col.itemR(mat, "cast_shadows_only", text="Cast Only")
col.itemR(mat, "shadow_casting_alpha", text="Casting Alpha")
@@ -237,6 +224,7 @@ class MATERIAL_PT_shadow(MaterialButtonsPanel):
sub = col.column()
sub.active = (not mat.ray_shadow_bias)
sub.itemR(mat, "shadow_ray_bias", text="Ray Bias")
+
class MATERIAL_PT_diffuse(MaterialButtonsPanel):
__label__ = "Diffuse"
@@ -244,8 +232,7 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel):
def poll(self, context):
mat = context.material
- engine = context.scene.render_data.engine
- return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
+ return mat and (mat.type != 'HALO') and (context.scene.render_data.engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
@@ -258,7 +245,7 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel):
col.itemR(mat, "diffuse_color", text="")
sub = col.column()
sub.active = (not mat.shadeless)
- sub.itemR(mat, "diffuse_intensity", text="Intensity")
+ sub.itemR(mat, "diffuse_reflection", text="Intensity")
col = split.column()
col.active = (not mat.shadeless)
@@ -291,15 +278,15 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel):
split = row.split(percentage=0.3)
split.itemL(text="Blend:")
split.itemR(mat, "diffuse_ramp_blend", text="")
-
+
+
class MATERIAL_PT_specular(MaterialButtonsPanel):
__label__ = "Specular"
COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
def poll(self, context):
mat = context.material
- engine = context.scene.render_data.engine
- return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
+ return mat and (mat.type != 'HALO') and (context.scene.render_data.engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
@@ -312,7 +299,7 @@ class MATERIAL_PT_specular(MaterialButtonsPanel):
col = split.column()
col.itemR(mat, "specular_color", text="")
- col.itemR(mat, "specular_intensity", text="Intensity")
+ col.itemR(mat, "specular_reflection", text="Intensity")
col = split.column()
col.itemR(mat, "specular_shader", text="")
@@ -351,15 +338,13 @@ class MATERIAL_PT_sss(MaterialButtonsPanel):
def poll(self, context):
mat = context.material
- engine = context.scene.render_data.engine
- return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
+ return mat and (mat.type in ('SURFACE', 'WIRE')) and (context.scene.render_data.engine in self.COMPAT_ENGINES)
def draw_header(self, context):
+ layout = self.layout
sss = context.material.subsurface_scattering
- mat = context.material
-
- self.layout.active = (not mat.shadeless)
- self.layout.itemR(sss, "enabled", text="")
+
+ layout.itemR(sss, "enabled", text="")
def draw(self, context):
layout = self.layout
@@ -372,22 +357,21 @@ class MATERIAL_PT_sss(MaterialButtonsPanel):
split = layout.split()
split.active = (not mat.shadeless)
- col = split.column()
- col.itemR(sss, "ior")
- col.itemR(sss, "scale")
+ col = split.column(align=True)
col.itemR(sss, "color", text="")
- col.itemR(sss, "radius", text="RGB Radius")
+ col.itemL(text="Blend:")
+ col.itemR(sss, "color_factor", text="Color")
+ col.itemR(sss, "texture_factor", text="Texture")
+ col.itemL(text="Scattering Weight:")
+ col.itemR(sss, "front")
+ col.itemR(sss, "back")
col = split.column()
sub = col.column(align=True)
- sub.itemL(text="Blend:")
- sub.itemR(sss, "color_factor", text="Color")
- sub.itemR(sss, "texture_factor", text="Texture")
- sub.itemL(text="Scattering Weight:")
- sub.itemR(sss, "front")
- sub.itemR(sss, "back")
- col.itemS()
- col.itemR(sss, "error_tolerance", text="Error")
+ sub.itemR(sss, "ior")
+ sub.itemR(sss, "scale")
+ col.itemR(sss, "radius", text="RGB Radius")
+ col.itemR(sss, "error_tolerance")
class MATERIAL_PT_mirror(MaterialButtonsPanel):
__label__ = "Mirror"
@@ -396,13 +380,14 @@ class MATERIAL_PT_mirror(MaterialButtonsPanel):
def poll(self, context):
mat = context.material
- engine = context.scene.render_data.engine
- return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
+ return mat and (mat.type in ('SURFACE', 'WIRE')) and (context.scene.render_data.engine in self.COMPAT_ENGINES)
- def draw_header(self, context):
+ def draw_header(self, context):
+ layout = self.layout
+
raym = context.material.raytrace_mirror
- self.layout.itemR(raym, "enabled", text="")
+ layout.itemR(raym, "enabled", text="")
def draw(self, context):
layout = self.layout
@@ -415,35 +400,31 @@ class MATERIAL_PT_mirror(MaterialButtonsPanel):
split = layout.split()
col = split.column()
- col.itemR(raym, "reflect_factor")
+ col.itemR(raym, "reflect", text="Reflectivity")
col.itemR(mat, "mirror_color", text="")
-
- col = split.column()
- col.itemR(raym, "fresnel")
+ col.itemL(text="Fresnel:")
+ col.itemR(raym, "fresnel", text="Amount")
sub = col.column()
sub.active = raym.fresnel > 0
sub.itemR(raym, "fresnel_factor", text="Blend")
-
- split = layout.split()
-
- col = split.column()
col.itemS()
- col.itemR(raym, "distance", text="Max Dist")
- col.itemR(raym, "depth")
col.itemS()
sub = col.split(percentage=0.4)
sub.itemL(text="Fade To:")
sub.itemR(raym, "fade_to", text="")
col = split.column()
+ col.itemR(raym, "depth")
+ col.itemR(raym, "distance", text="Max Dist")
col.itemL(text="Gloss:")
- col.itemR(raym, "gloss_factor", text="Amount")
+ col.itemR(raym, "gloss", text="Amount")
sub = col.column()
- sub.active = raym.gloss_factor < 1.0
+ sub.active = raym.gloss < 1
sub.itemR(raym, "gloss_threshold", text="Threshold")
sub.itemR(raym, "gloss_samples", text="Samples")
sub.itemR(raym, "gloss_anisotropic", text="Anisotropic")
-
+
+
class MATERIAL_PT_transp(MaterialButtonsPanel):
__label__= "Transparency"
__default_closed__ = True
@@ -451,12 +432,13 @@ class MATERIAL_PT_transp(MaterialButtonsPanel):
def poll(self, context):
mat = context.material
- engine = context.scene.render_data.engine
- return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
+ return mat and (mat.type in ('SURFACE', 'WIRE')) and (context.scene.render_data.engine in self.COMPAT_ENGINES)
- def draw_header(self, context):
+ def draw_header(self, context):
+ layout = self.layout
+
mat = context.material
- self.layout.itemR(mat, "transparency", text="")
+ layout.itemR(mat, "transparency", text="")
def draw(self, context):
layout = self.layout
@@ -464,29 +446,32 @@ class MATERIAL_PT_transp(MaterialButtonsPanel):
mat = context.material
rayt = context.material.raytrace_transparency
- row = layout.row()
- row.active = mat.transparency and (not mat.shadeless)
+ row= layout.row()
row.itemR(mat, "transparency_method", expand=True)
+ row.active = mat.transparency and (not mat.shadeless)
split = layout.split()
col = split.column()
- col.itemR(mat, "alpha")
+ col.itemL(text="Transparency:")
+ row = col.row()
+ row.itemR(mat, "alpha")
+ row.active = mat.transparency
row = col.row()
- row.active = mat.transparency and (not mat.shadeless)
row.itemR(mat, "specular_alpha", text="Specular")
-
+ row.active = mat.transparency and (not mat.shadeless)
+
col = split.column()
- col.active = (not mat.shadeless)
- col.itemR(rayt, "fresnel")
+ col.active = mat.transparency and (not mat.shadeless)
+ col.itemL(text="Fresnel:")
+ col.itemR(rayt, "fresnel", text="Amount")
sub = col.column()
sub.active = rayt.fresnel > 0
sub.itemR(rayt, "fresnel_factor", text="Blend")
if mat.transparency_method == 'RAYTRACE':
- layout.itemS()
split = layout.split()
- split.active = mat.transparency
+ split.active = mat.transparency and (not mat.shadeless)
col = split.column()
col.itemR(rayt, "ior")
@@ -497,20 +482,19 @@ class MATERIAL_PT_transp(MaterialButtonsPanel):
col = split.column()
col.itemL(text="Gloss:")
- col.itemR(rayt, "gloss_factor", text="Amount")
+ col.itemR(rayt, "gloss", text="Amount")
sub = col.column()
- sub.active = rayt.gloss_factor < 1.0
+ sub.active = rayt.gloss < 1
sub.itemR(rayt, "gloss_threshold", text="Threshold")
sub.itemR(rayt, "gloss_samples", text="Samples")
-
+
class MATERIAL_PT_halo(MaterialButtonsPanel):
__label__= "Halo"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def poll(self, context):
mat = context.material
- engine = context.scene.render_data.engine
- return mat and (mat.type == 'HALO') and (engine in self.COMPAT_ENGINES)
+ return mat and (mat.type == 'HALO') and (context.scene.render_data.engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
@@ -526,8 +510,8 @@ class MATERIAL_PT_halo(MaterialButtonsPanel):
col.itemR(halo, "hardness")
col.itemR(halo, "add")
col.itemL(text="Options:")
- col.itemR(halo, "texture")
- col.itemR(halo, "vertex_normal")
+ col.itemR(halo, "use_texture", text="Texture")
+ col.itemR(halo, "use_vertex_normal", text="Vertex Normal")
col.itemR(halo, "xalpha")
col.itemR(halo, "shaded")
col.itemR(halo, "soft")
@@ -538,52 +522,24 @@ class MATERIAL_PT_halo(MaterialButtonsPanel):
sub.active = halo.ring
sub.itemR(halo, "rings")
sub.itemR(mat, "mirror_color", text="")
- col.itemS()
col.itemR(halo, "lines")
sub = col.column()
sub.active = halo.lines
sub.itemR(halo, "line_number", text="Lines")
sub.itemR(mat, "specular_color", text="")
- col.itemS()
col.itemR(halo, "star")
sub = col.column()
sub.active = halo.star
sub.itemR(halo, "star_tips")
-
-class MATERIAL_PT_flare(MaterialButtonsPanel):
- __label__= "Flare"
- COMPAT_ENGINES = set(['BLENDER_RENDER'])
-
- def poll(self, context):
- mat = context.material
- engine = context.scene.render_data.engine
- return mat and (mat.type == 'HALO') and (engine in self.COMPAT_ENGINES)
-
- def draw_header(self, context):
- layout = self.layout
-
- mat = context.material
- halo = mat.halo
- layout.itemR(halo, "flare_mode", text="")
-
- def draw(self, context):
- layout = self.layout
-
- mat = context.material
- halo = mat.halo
+ col.itemR(halo, "flare_mode")
+ sub = col.column()
+ sub.active = halo.flare_mode
+ sub.itemR(halo, "flare_size", text="Size")
+ sub.itemR(halo, "flare_subsize", text="Subsize")
+ sub.itemR(halo, "flare_boost", text="Boost")
+ sub.itemR(halo, "flare_seed", text="Seed")
+ sub.itemR(halo, "flares_sub", text="Sub")
- layout.active = halo.flare_mode
-
- split = layout.split()
-
- col = split.column()
- col.itemR(halo, "flare_size", text="Size")
- col.itemR(halo, "flare_boost", text="Boost")
- col.itemR(halo, "flare_seed", text="Seed")
- col = split.column()
- col.itemR(halo, "flares_sub", text="Subflares")
- col.itemR(halo, "flare_subsize", text="Subsize")
-
bpy.types.register(MATERIAL_PT_context_material)
bpy.types.register(MATERIAL_PT_preview)
bpy.types.register(MATERIAL_PT_diffuse)
@@ -593,121 +549,8 @@ bpy.types.register(MATERIAL_PT_transp)
bpy.types.register(MATERIAL_PT_mirror)
bpy.types.register(MATERIAL_PT_sss)
bpy.types.register(MATERIAL_PT_halo)
-bpy.types.register(MATERIAL_PT_flare)
bpy.types.register(MATERIAL_PT_physics)
bpy.types.register(MATERIAL_PT_strand)
bpy.types.register(MATERIAL_PT_options)
bpy.types.register(MATERIAL_PT_shadow)
-# Volumetrics
-class VolumeButtonsPanel(bpy.types.Panel):
- __space_type__ = 'PROPERTIES'
- __region_type__ = 'WINDOW'
- __context__ = "material"
-
- def poll(self, context):
- mat = context.material
- engine = context.scene.render_data.engine
- return mat and (mat.type == 'VOLUME') and (engine in self.COMPAT_ENGINES)
-
-class MATERIAL_PT_volume_shading(VolumeButtonsPanel):
- __label__ = "Shading"
- __default_closed__ = False
- COMPAT_ENGINES = set(['BLENDER_RENDER'])
-
- def draw(self, context):
- layout = self.layout
-
- mat = context.material
- vol = context.material.volume
-
- row = layout.row()
- row.itemR(vol, "density")
- row.itemR(vol, "scattering")
-
- split = layout.split()
-
- col = split.column()
- col.itemR(vol, "absorption")
- col.itemR(vol, "absorption_color", text="")
-
- col = split.column()
- col.itemR(vol, "emission")
- col.itemR(vol, "emission_color", text="")
-
-class MATERIAL_PT_volume_scattering(VolumeButtonsPanel):
- __label__ = "Scattering"
- __default_closed__ = False
- COMPAT_ENGINES = set(['BLENDER_RENDER'])
-
- def draw(self, context):
- layout = self.layout
-
- vol = context.material.volume
-
- split = layout.split()
-
- col = split.column()
- col.itemR(vol, "scattering_mode", text="")
- if vol.scattering_mode == 'SINGLE_SCATTERING':
- col.itemR(vol, "light_cache")
- sub = col.column()
- sub.active = vol.light_cache
- sub.itemR(vol, "cache_resolution")
- elif vol.scattering_mode in ('MULTIPLE_SCATTERING', 'SINGLE_PLUS_MULTIPLE_SCATTERING'):
- col.itemR(vol, "cache_resolution")
-
- col = col.column(align=True)
- col.itemR(vol, "ms_diffusion")
- col.itemR(vol, "ms_spread")
- col.itemR(vol, "ms_intensity")
-
- col = split.column()
- # col.itemL(text="Anisotropic Scattering:")
- col.itemR(vol, "phase_function", text="")
- if vol.phase_function in ('SCHLICK', 'HENYEY-GREENSTEIN'):
- col.itemR(vol, "asymmetry")
-
-class MATERIAL_PT_volume_transp(VolumeButtonsPanel):
- __label__= "Transparency"
- COMPAT_ENGINES = set(['BLENDER_RENDER'])
-
- def draw(self, context):
- layout = self.layout
-
- mat = context.material
- rayt = context.material.raytrace_transparency
-
- row= layout.row()
- row.itemR(mat, "transparency_method", expand=True)
- row.active = mat.transparency and (not mat.shadeless)
-
-class MATERIAL_PT_volume_integration(VolumeButtonsPanel):
- __label__ = "Integration"
- __default_closed__ = False
- COMPAT_ENGINES = set(['BLENDER_RENDER'])
-
- def draw(self, context):
- layout = self.layout
-
- mat = context.material
- vol = context.material.volume
-
- split = layout.split()
-
- col = split.column()
- col.itemL(text="Step Calculation:")
- col.itemR(vol, "step_calculation", text="")
- col = col.column(align=True)
- col.itemR(vol, "step_size")
- col.itemR(vol, "shading_step_size")
-
- col = split.column()
- col.itemL()
- col.itemR(vol, "depth_cutoff")
- col.itemR(vol, "density_scale")
-
-bpy.types.register(MATERIAL_PT_volume_shading)
-bpy.types.register(MATERIAL_PT_volume_scattering)
-bpy.types.register(MATERIAL_PT_volume_transp)
-bpy.types.register(MATERIAL_PT_volume_integration)
diff --git a/release/ui/buttons_object.py b/release/ui/buttons_object.py
index af2c7cfb58a..6b6d583e2ca 100644
--- a/release/ui/buttons_object.py
+++ b/release/ui/buttons_object.py
@@ -2,8 +2,8 @@
import bpy
class ObjectButtonsPanel(bpy.types.Panel):
- __space_type__ = 'PROPERTIES'
- __region_type__ = 'WINDOW'
+ __space_type__ = "PROPERTIES"
+ __region_type__ = "WINDOW"
__context__ = "object"
class OBJECT_PT_context_object(ObjectButtonsPanel):
@@ -15,7 +15,7 @@ class OBJECT_PT_context_object(ObjectButtonsPanel):
ob = context.object
row = layout.row()
- row.itemL(text="", icon='ICON_OBJECT_DATA')
+ row.itemL(text="", icon="ICON_OBJECT_DATA")
row.itemR(ob, "name", text="")
class OBJECT_PT_transform(ObjectButtonsPanel):
@@ -79,7 +79,7 @@ class OBJECT_PT_groups(ObjectButtonsPanel):
row = col.box().row()
row.itemR(group, "name", text="")
- row.itemO("object.group_remove", text="", icon='VICON_X')
+ row.itemO("object.group_remove", text="", icon="VICON_X")
split = col.box().split()
split.column().itemR(group, "layer", text="Dupli")
diff --git a/release/ui/buttons_object_constraint.py b/release/ui/buttons_object_constraint.py
index ff3231a9d61..c67d6e40cfb 100644
--- a/release/ui/buttons_object_constraint.py
+++ b/release/ui/buttons_object_constraint.py
@@ -2,8 +2,8 @@
import bpy
class ConstraintButtonsPanel(bpy.types.Panel):
- __space_type__ = 'PROPERTIES'
- __region_type__ = 'WINDOW'
+ __space_type__ = "PROPERTIES"
+ __region_type__ = "WINDOW"
__context__ = "constraint"
def draw_constraint(self, con):
@@ -39,7 +39,7 @@ class ConstraintButtonsPanel(bpy.types.Panel):
layout.itemR(con, "target") # XXX limiting settings for only 'curves' or some type of object
if con.target and subtargets:
- if con.target.type == 'ARMATURE':
+ if con.target.type == "ARMATURE":
layout.item_pointerR(con, "subtarget", con.target.data, "bones", text="Bone")
if con.type == 'COPY_LOCATION':
@@ -121,17 +121,9 @@ class ConstraintButtonsPanel(bpy.types.Panel):
def FOLLOW_PATH(self, layout, con):
self.target_template(layout, con)
- split = layout.split()
-
- col = split.column()
- col.itemR(con, "curve_follow")
-
- col = split.column()
- col.itemR(con, "fixed_position")
- if con.fixed_position:
- col.itemR(con, "offset_percentage", text="Offset")
- else:
- col.itemR(con, "offset")
+ row = layout.row()
+ row.itemR(con, "curve_follow")
+ row.itemR(con, "offset")
row = layout.row()
row.itemL(text="Forward:")
@@ -486,7 +478,7 @@ class ConstraintButtonsPanel(bpy.types.Panel):
layout.itemR(con, "distance")
layout.itemR(con, "shrinkwrap_type")
- if con.shrinkwrap_type == 'PROJECT':
+ if con.shrinkwrap_type == "PROJECT":
row = layout.row(align=True)
row.itemR(con, "axis_x")
row.itemR(con, "axis_y")
diff --git a/release/ui/buttons_physics_cloth.py b/release/ui/buttons_physics_cloth.py
index 5cdca3c2c74..f34077c758a 100644
--- a/release/ui/buttons_physics_cloth.py
+++ b/release/ui/buttons_physics_cloth.py
@@ -1,14 +1,9 @@
import bpy
-from buttons_particle import point_cache_ui
-
-def cloth_panel_enabled(md):
- return md.point_cache.baked==False
-
class PhysicButtonsPanel(bpy.types.Panel):
- __space_type__ = 'PROPERTIES'
- __region_type__ = 'WINDOW'
+ __space_type__ = "PROPERTIES"
+ __region_type__ = "WINDOW"
__context__ = "physics"
def poll(self, context):
@@ -43,8 +38,6 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel):
if md:
cloth = md.settings
-
- layout.active = cloth_panel_enabled(md)
split = layout.split()
@@ -89,35 +82,77 @@ class PHYSICS_PT_cloth_cache(PhysicButtonsPanel):
__default_closed__ = True
def poll(self, context):
- return (context.cloth)
+ return (context.cloth != None)
def draw(self, context):
- md = context.cloth
- point_cache_ui(self, md.point_cache, cloth_panel_enabled(md), 0, 0)
+ layout = self.layout
+
+ cache = context.cloth.point_cache
+ layout.set_context_pointer("PointCache", cache)
+
+ row = layout.row()
+ row.template_list(cache, "point_cache_list", cache, "active_point_cache_index")
+ col = row.column(align=True)
+ col.itemO("ptcache.add_new", icon="ICON_ZOOMIN", text="")
+ col.itemO("ptcache.remove", icon="ICON_ZOOMOUT", text="")
+
+ row = layout.row()
+ row.itemR(cache, "name")
+
+ row = layout.row()
+ row.itemR(cache, "start_frame")
+ row.itemR(cache, "end_frame")
+
+ row = layout.row()
+
+ if cache.baked == True:
+ row.itemO("ptcache.free_bake", text="Free Bake")
+ else:
+ row.item_booleanO("ptcache.bake", "bake", True, text="Bake")
+
+ subrow = row.row()
+ subrow.enabled = cache.frames_skipped or cache.outdated
+ subrow.itemO("ptcache.bake", "bake", False, text="Calculate to Current Frame")
+
+ row = layout.row()
+ #row.enabled = particle_panel_enabled(psys)
+ row.itemO("ptcache.bake_from_cache", text="Current Cache to Bake")
+ row.itemR(cache, "step");
+
+ row = layout.row()
+ #row.enabled = particle_panel_enabled(psys)
+ row.itemR(cache, "quick_cache")
+ row.itemR(cache, "disk_cache")
+
+ layout.itemL(text=cache.info)
+
+ layout.itemS()
+
+ row = layout.row()
+ row.itemO("ptcache.bake_all", "bake", True, text="Bake All Dynamics")
+ row.itemO("ptcache.free_bake_all", text="Free All Bakes")
+ layout.itemO("ptcache.bake_all", "bake", False, text="Update All Dynamics to current frame")
class PHYSICS_PT_cloth_collision(PhysicButtonsPanel):
__label__ = "Cloth Collision"
__default_closed__ = True
def poll(self, context):
- return (context.cloth)
+ return (context.cloth != None)
def draw_header(self, context):
+ layout = self.layout
cloth = context.cloth.collision_settings
-
- self.layout.active = cloth_panel_enabled(context.cloth)
- self.layout.itemR(cloth, "enable_collision", text="")
+
+ layout.itemR(cloth, "enable_collision", text="")
def draw(self, context):
layout = self.layout
-
cloth = context.cloth.collision_settings
- md = context.cloth
-
- layout.active = cloth.enable_collision and cloth_panel_enabled(md)
-
split = layout.split()
+ layout.active = cloth.enable_collision
+
col = split.column()
col.itemR(cloth, "collision_quality", slider=True, text="Quality")
col.itemR(cloth, "min_distance", slider=True, text="Distance")
@@ -125,10 +160,10 @@ class PHYSICS_PT_cloth_collision(PhysicButtonsPanel):
col = split.column()
col.itemR(cloth, "enable_self_collision", text="Self Collision")
- sub = col.column()
- sub.active = cloth.enable_self_collision
- sub.itemR(cloth, "self_collision_quality", slider=True, text="Quality")
- sub.itemR(cloth, "self_min_distance", slider=True, text="Distance")
+ col = col.column()
+ col.active = cloth.enable_self_collision
+ col.itemR(cloth, "self_collision_quality", slider=True, text="Quality")
+ col.itemR(cloth, "self_min_distance", slider=True, text="Distance")
class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel):
__label__ = "Cloth Stiffness Scaling"
@@ -138,19 +173,17 @@ class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel):
return (context.cloth != None)
def draw_header(self, context):
+ layout = self.layout
cloth = context.cloth.settings
- self.layout.active = cloth_panel_enabled(context.cloth)
- self.layout.itemR(cloth, "stiffness_scaling", text="")
+ layout.itemR(cloth, "stiffness_scaling", text="")
def draw(self, context):
layout = self.layout
-
- md = context.cloth
ob = context.object
cloth = context.cloth.settings
- layout.active = cloth.stiffness_scaling and cloth_panel_enabled(md)
+ layout.active = cloth.stiffness_scaling
split = layout.split()
diff --git a/release/ui/buttons_physics_field.py b/release/ui/buttons_physics_field.py
index 58033d2c431..fb29dd92833 100644
--- a/release/ui/buttons_physics_field.py
+++ b/release/ui/buttons_physics_field.py
@@ -2,13 +2,13 @@
import bpy
class PhysicButtonsPanel(bpy.types.Panel):
- __space_type__ = 'PROPERTIES'
- __region_type__ = 'WINDOW'
+ __space_type__ = "PROPERTIES"
+ __region_type__ = "WINDOW"
__context__ = "physics"
def poll(self, context):
rd = context.scene.render_data
- return (context.object) and (not rd.use_game_engine)
+ return (context.object != None) and (not rd.use_game_engine)
class PHYSICS_PT_field(PhysicButtonsPanel):
__label__ = "Force Fields"
@@ -146,15 +146,15 @@ class PHYSICS_PT_field(PhysicButtonsPanel):
sub.active = field.use_radial_max
sub.itemR(field, "radial_maximum", text="Distance")
- #if ob.type in 'CURVE':
- #if field.type == 'GUIDE':
+ #if ob.type in "CURVE":
+ #if field.type == "GUIDE":
#colsub = col.column(align=True)
- #if field.type != 'NONE':
+ #if field.type != "NONE":
#layout.itemR(field, "strength")
- #if field.type in ('HARMONIC', 'SPHERICAL', 'CHARGE', "LENNARDj"):
- #if ob.type in ('MESH', 'SURFACE', 'FONT', 'CURVE'):
+ #if field.type in ("HARMONIC", "SPHERICAL", "CHARGE", "LENNARDj"):
+ #if ob.type in ("MESH", "SURFACE", "FONT", "CURVE"):
#layout.itemR(field, "surface")
class PHYSICS_PT_collision(PhysicButtonsPanel):
diff --git a/release/ui/buttons_physics_fluid.py b/release/ui/buttons_physics_fluid.py
index 6f7a97ff793..304d419b388 100644
--- a/release/ui/buttons_physics_fluid.py
+++ b/release/ui/buttons_physics_fluid.py
@@ -2,8 +2,8 @@
import bpy
class PhysicButtonsPanel(bpy.types.Panel):
- __space_type__ = 'PROPERTIES'
- __region_type__ = 'WINDOW'
+ __space_type__ = "PROPERTIES"
+ __region_type__ = "WINDOW"
__context__ = "physics"
def poll(self, context):
@@ -46,7 +46,7 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel):
layout.itemR(fluid, "type")
if fluid.type == 'DOMAIN':
- layout.itemO("fluid.bake", text="Bake Fluid Simulation", icon='ICON_MOD_FLUIDSIM')
+ layout.itemO("fluid.bake", text="BAKE")
split = layout.split()
col = split.column()
@@ -94,7 +94,7 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel):
col.itemL(text="Slip Type:")
col.itemR(fluid, "slip_type", text="")
if fluid.slip_type == 'PARTIALSLIP':
- col.itemR(fluid, "partial_slip_factor", slider=True, text="Amount")
+ col.itemR(fluid, "partial_slip_amount", slider=True, text="Amount")
col.itemL(text="Impact:")
col.itemR(fluid, "impact_factor", text="Factor")
@@ -175,7 +175,11 @@ class PHYSICS_PT_domain_gravity(PhysicButtonsPanel):
def poll(self, context):
md = context.fluid
if md:
- return (md.settings.type == 'DOMAIN')
+ settings = md.settings
+ if settings:
+ return (settings.type == 'DOMAIN')
+
+ return False
def draw(self, context):
layout = self.layout
@@ -214,7 +218,11 @@ class PHYSICS_PT_domain_boundary(PhysicButtonsPanel):
def poll(self, context):
md = context.fluid
if md:
- return (md.settings.type == 'DOMAIN')
+ settings = md.settings
+ if settings:
+ return (settings.type == 'DOMAIN')
+
+ return False
def draw(self, context):
layout = self.layout
@@ -228,7 +236,7 @@ class PHYSICS_PT_domain_boundary(PhysicButtonsPanel):
sub = col.column(align=True)
sub.itemR(fluid, "slip_type", text="")
if fluid.slip_type == 'PARTIALSLIP':
- sub.itemR(fluid, "partial_slip_factor", slider=True, text="Amount")
+ sub.itemR(fluid, "partial_slip_amount", slider=True, text="Amount")
col = split.column()
col.itemL(text="Surface:")
@@ -243,8 +251,12 @@ class PHYSICS_PT_domain_particles(PhysicButtonsPanel):
def poll(self, context):
md = context.fluid
if md:
- return (md.settings.type == 'DOMAIN')
-
+ settings = md.settings
+ if settings:
+ return (settings.type == 'DOMAIN')
+
+ return False
+
def draw(self, context):
layout = self.layout
diff --git a/release/ui/buttons_physics_smoke.py b/release/ui/buttons_physics_smoke.py
index 6aee152e92a..7e2395216c0 100644
--- a/release/ui/buttons_physics_smoke.py
+++ b/release/ui/buttons_physics_smoke.py
@@ -1,11 +1,9 @@
import bpy
-from buttons_particle import point_cache_ui
-
class PhysicButtonsPanel(bpy.types.Panel):
- __space_type__ = 'PROPERTIES'
- __region_type__ = 'WINDOW'
+ __space_type__ = "PROPERTIES"
+ __region_type__ = "WINDOW"
__context__ = "physics"
def poll(self, context):
@@ -51,6 +49,13 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel):
col = split.column()
col.itemL(text="Resolution:")
col.itemR(domain, "maxres", text="Divisions")
+
+ col.itemL(text="Display:")
+ col.itemR(domain, "visibility", text="Resolution")
+ col.itemR(domain, "color", slider=True)
+ sub = col.column()
+ sub.active = domain.highres
+ sub.itemR(domain, "viewhighres")
col = split.column()
col.itemL(text="Behavior:")
@@ -59,7 +64,7 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel):
col.itemR(domain, "dissolve_smoke", text="Dissolve")
sub = col.column()
sub.active = domain.dissolve_smoke
- sub.itemR(domain, "dissolve_speed", text="Time")
+ sub.itemR(domain, "dissolve_speed", text="Speed")
sub.itemR(domain, "dissolve_smoke_log", text="Slow")
elif md.smoke_type == 'TYPE_FLOW':
@@ -83,7 +88,43 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel):
#elif md.smoke_type == 'TYPE_COLL':
# layout.itemS()
+
+class PHYSICS_PT_smoke_highres(PhysicButtonsPanel):
+ __label__ = "Smoke High Resolution"
+ __default_closed__ = True
+
+ def poll(self, context):
+ md = context.smoke
+ if md:
+ return (md.smoke_type == 'TYPE_DOMAIN')
+
+ return False
+ def draw_header(self, context):
+ layout = self.layout
+
+ high = context.smoke.domain_settings
+
+ layout.itemR(high, "highres", text="")
+
+ def draw(self, context):
+ layout = self.layout
+
+ high = context.smoke.domain_settings
+
+ layout.active = high.highres
+
+ split = layout.split()
+
+ col = split.column()
+ col.itemL(text="Resolution:")
+ col.itemR(high, "amplify", text="Divisions")
+
+ sub = split.column()
+ sub.itemL(text="Noise Method:")
+ sub.row().itemR(high, "noise_type", text="")
+ sub.itemR(high, "strength")
+
class PHYSICS_PT_smoke_groups(PhysicButtonsPanel):
__label__ = "Smoke Groups"
__default_closed__ = True
@@ -113,70 +154,6 @@ class PHYSICS_PT_smoke_groups(PhysicButtonsPanel):
col.itemL(text="Collision Group:")
col.itemR(group, "coll_group", text="")
-class PHYSICS_PT_smoke_cache(PhysicButtonsPanel):
- __label__ = "Smoke Cache"
- __default_closed__ = True
-
- def poll(self, context):
- md = context.smoke
- return md and (md.smoke_type == 'TYPE_DOMAIN')
-
- def draw(self, context):
- layout = self.layout
-
- md = context.smoke.domain_settings
- cache = md.point_cache_low
-
- point_cache_ui(self, cache, cache.baked==False, 0, 1)
-
-class PHYSICS_PT_smoke_highres(PhysicButtonsPanel):
- __label__ = "Smoke High Resolution"
- __default_closed__ = True
-
- def poll(self, context):
- md = context.smoke
- return md and (md.smoke_type == 'TYPE_DOMAIN')
-
- def draw_header(self, context):
- high = context.smoke.domain_settings
-
- self.layout.itemR(high, "highres", text="")
-
- def draw(self, context):
- layout = self.layout
-
- md = context.smoke.domain_settings
-
- split = layout.split()
-
- col = split.column()
- col.itemL(text="Resolution:")
- col.itemR(md, "amplify", text="Divisions")
-
- col = split.column()
- col.itemL(text="Noise Method:")
- col.row().itemR(md, "noise_type", text="")
- col.itemR(md, "strength")
- col.itemR(md, "viewhighres")
-
-class PHYSICS_PT_smoke_cache_highres(PhysicButtonsPanel):
- __label__ = "Smoke High Resolution Cache"
- __default_closed__ = True
-
- def poll(self, context):
- md = context.smoke
- return md and (md.smoke_type == 'TYPE_DOMAIN') and md.domain_settings.highres
-
- def draw(self, context):
- layout = self.layout
-
- md = context.smoke.domain_settings
- cache = md.point_cache_high
-
- point_cache_ui(self, cache, cache.baked==False, 0, 1)
-
bpy.types.register(PHYSICS_PT_smoke)
-bpy.types.register(PHYSICS_PT_smoke_cache)
bpy.types.register(PHYSICS_PT_smoke_highres)
bpy.types.register(PHYSICS_PT_smoke_groups)
-bpy.types.register(PHYSICS_PT_smoke_cache_highres)
diff --git a/release/ui/buttons_physics_softbody.py b/release/ui/buttons_physics_softbody.py
index 703977a056f..2613f9e8032 100644
--- a/release/ui/buttons_physics_softbody.py
+++ b/release/ui/buttons_physics_softbody.py
@@ -1,14 +1,9 @@
import bpy
-from buttons_particle import point_cache_ui
-
-def softbody_panel_enabled(md):
- return md.point_cache.baked==False
-
class PhysicButtonsPanel(bpy.types.Panel):
- __space_type__ = 'PROPERTIES'
- __region_type__ = 'WINDOW'
+ __space_type__ = "PROPERTIES"
+ __region_type__ = "WINDOW"
__context__ = "physics"
def poll(self, context):
@@ -46,7 +41,6 @@ class PHYSICS_PT_softbody(PhysicButtonsPanel):
# General
split = layout.split()
- split.enabled = softbody_panel_enabled(md)
col = split.column()
col.itemL(text="Object:")
@@ -66,132 +60,179 @@ class PHYSICS_PT_softbody_cache(PhysicButtonsPanel):
return (context.soft_body)
def draw(self, context):
- md = context.soft_body
- point_cache_ui(self, md.point_cache, softbody_panel_enabled(md), 0, 0)
+ layout = self.layout
+
+ cache = context.soft_body.point_cache
+ layout.set_context_pointer("PointCache", cache)
+
+ row = layout.row()
+ row.template_list(cache, "point_cache_list", cache, "active_point_cache_index")
+ col = row.column(align=True)
+ col.itemO("ptcache.add_new", icon="ICON_ZOOMIN", text="")
+ col.itemO("ptcache.remove", icon="ICON_ZOOMOUT", text="")
+
+ row = layout.row()
+ row.itemR(cache, "name")
+
+ row = layout.row()
+ row.itemR(cache, "start_frame")
+ row.itemR(cache, "end_frame")
+
+ row = layout.row()
+
+ if cache.baked == True:
+ row.itemO("ptcache.free_bake", text="Free Bake")
+ else:
+ row.item_booleanO("ptcache.bake", "bake", True, text="Bake")
+
+ sub = row.row()
+ sub.enabled = cache.frames_skipped or cache.outdated
+ sub.itemO("ptcache.bake", "bake", False, text="Calculate to Current Frame")
+ row = layout.row()
+ row.itemO("ptcache.bake_from_cache", text="Current Cache to Bake")
+ row.itemR(cache, "step");
+
+ row = layout.row()
+ row.itemR(cache, "quick_cache")
+ row.itemR(cache, "disk_cache")
+
+ layout.itemL(text=cache.info)
+
+ layout.itemS()
+
+ row = layout.row()
+ row.itemO("ptcache.bake_all", "bake", True, text="Bake All Dynamics")
+ row.itemO("ptcache.free_bake_all", text="Free All Bakes")
+ layout.itemO("ptcache.bake_all", "bake", False, text="Update All Dynamics to current frame")
+
class PHYSICS_PT_softbody_goal(PhysicButtonsPanel):
__label__ = "Soft Body Goal"
- __default_closed__ = True
def poll(self, context):
return (context.soft_body)
def draw_header(self, context):
+ layout = self.layout
+
softbody = context.soft_body.settings
- self.layout.active = softbody_panel_enabled(context.soft_body)
- self.layout.itemR(softbody, "use_goal", text="")
+ layout.itemR(softbody, "use_goal", text="")
def draw(self, context):
layout = self.layout
md = context.soft_body
- softbody = md.settings
ob = context.object
-
- layout.active = softbody.use_goal and softbody_panel_enabled(md)
split = layout.split()
+
+ if md:
+ softbody = md.settings
+ layout.active = softbody.use_goal
- # Goal
- split = layout.split()
+ # Goal
+ split = layout.split()
- col = split.column()
- col.itemL(text="Goal Strengths:")
- col.itemR(softbody, "goal_default", text="Default")
- sub = col.column(align=True)
- sub.itemR(softbody, "goal_min", text="Minimum")
- sub.itemR(softbody, "goal_max", text="Maximum")
+ col = split.column()
+ col.itemL(text="Goal Strengths:")
+ col.itemR(softbody, "goal_default", text="Default")
+ sub = col.column(align=True)
+ sub.itemR(softbody, "goal_min", text="Minimum")
+ sub.itemR(softbody, "goal_max", text="Maximum")
- col = split.column()
- col.itemL(text="Goal Settings:")
- col.itemR(softbody, "goal_spring", text="Stiffness")
- col.itemR(softbody, "goal_friction", text="Damping")
+ col = split.column()
+ col.itemL(text="Goal Settings:")
+ col.itemR(softbody, "goal_spring", text="Stiffness")
+ col.itemR(softbody, "goal_friction", text="Damping")
- layout.item_pointerR(softbody, "goal_vertex_group", ob, "vertex_groups", text="Vertex Group")
+ layout.item_pointerR(softbody, "goal_vertex_group", ob, "vertex_groups", text="Vertex Group")
class PHYSICS_PT_softbody_edge(PhysicButtonsPanel):
__label__ = "Soft Body Edges"
- __default_closed__ = True
def poll(self, context):
return (context.soft_body)
def draw_header(self, context):
+ layout = self.layout
+
softbody = context.soft_body.settings
- self.layout.active = softbody_panel_enabled(context.soft_body)
- self.layout.itemR(softbody, "use_edges", text="")
+ layout.itemR(softbody, "use_edges", text="")
def draw(self, context):
layout = self.layout
md = context.soft_body
- softbody = md.settings
ob = context.object
-
- layout.active = softbody.use_edges and softbody_panel_enabled(md)
- split = layout.split()
+ if md:
+ softbody = md.settings
+
+ layout.active = softbody.use_edges
- col = split.column()
- col.itemL(text="Springs:")
- col.itemR(softbody, "pull")
- col.itemR(softbody, "push")
- col.itemR(softbody, "damp")
- col.itemR(softbody, "plastic")
- col.itemR(softbody, "bending")
- col.itemR(softbody, "spring_length", text="Length")
-
- col = split.column()
- col.itemR(softbody, "stiff_quads")
- sub = col.column()
- sub.active = softbody.stiff_quads
- sub.itemR(softbody, "shear")
-
- col.itemR(softbody, "new_aero", text="Aero")
- sub = col.column()
- sub.enabled = softbody.new_aero
- sub.itemR(softbody, "aero", text="Factor")
-
- col.itemL(text="Collision:")
- col.itemR(softbody, "edge_collision", text="Edge")
- col.itemR(softbody, "face_collision", text="Face")
+ split = layout.split()
+
+ col = split.column()
+ col.itemL(text="Springs:")
+ col.itemR(softbody, "pull")
+ col.itemR(softbody, "push")
+ col.itemR(softbody, "damp")
+ col.itemR(softbody, "plastic")
+ col.itemR(softbody, "bending")
+ col.itemR(softbody, "spring_length", text="Length")
+
+ col = split.column()
+ col.itemR(softbody, "stiff_quads")
+ sub = col.column()
+ sub.active = softbody.stiff_quads
+ sub.itemR(softbody, "shear")
+
+ col.itemR(softbody, "new_aero", text="Aero")
+ sub = col.column()
+ sub.enabled = softbody.new_aero
+ sub.itemR(softbody, "aero", text="Factor")
+
+ col.itemL(text="Collision:")
+ col.itemR(softbody, "edge_collision", text="Edge")
+ col.itemR(softbody, "face_collision", text="Face")
class PHYSICS_PT_softbody_collision(PhysicButtonsPanel):
__label__ = "Soft Body Collision"
- __default_closed__ = True
def poll(self, context):
return (context.soft_body)
def draw_header(self, context):
+ layout = self.layout
+
softbody = context.soft_body.settings
- self.layout.active = softbody_panel_enabled(context.soft_body)
- self.layout.itemR(softbody, "self_collision", text="")
+ layout.itemR(softbody, "self_collision", text="")
def draw(self, context):
layout = self.layout
md = context.soft_body
- softbody = md.settings
ob = context.object
+
+ if md:
+ softbody = md.settings
- layout.active = softbody.self_collision and softbody_panel_enabled(md)
+ layout.active = softbody.self_collision
- layout.itemL(text="Collision Type:")
- layout.itemR(softbody, "collision_type", expand=True)
+ layout.itemL(text="Collision Type:")
+ layout.itemR(softbody, "collision_type", expand=True)
- col = layout.column(align=True)
- col.itemL(text="Ball:")
- col.itemR(softbody, "ball_size", text="Size")
- col.itemR(softbody, "ball_stiff", text="Stiffness")
- col.itemR(softbody, "ball_damp", text="Dampening")
+ col = layout.column(align=True)
+ col.itemL(text="Ball:")
+ col.itemR(softbody, "ball_size", text="Size")
+ col.itemR(softbody, "ball_stiff", text="Stiffness")
+ col.itemR(softbody, "ball_damp", text="Dampening")
class PHYSICS_PT_softbody_solver(PhysicButtonsPanel):
__label__ = "Soft Body Solver"
- __default_closed__ = True
def poll(self, context):
return (context.soft_body)
@@ -200,28 +241,28 @@ class PHYSICS_PT_softbody_solver(PhysicButtonsPanel):
layout = self.layout
md = context.soft_body
- softbody = md.settings
ob = context.object
+
+ if md:
+ softbody = md.settings
- layout.active = softbody_panel_enabled(md)
-
- # Solver
- split = layout.split()
+ # Solver
+ split = layout.split()
- col = split.column(align=True)
- col.itemL(text="Step Size:")
- col.itemR(softbody, "minstep")
- col.itemR(softbody, "maxstep")
- col.itemR(softbody, "auto_step", text="Auto-Step")
+ col = split.column(align=True)
+ col.itemL(text="Step Size:")
+ col.itemR(softbody, "minstep")
+ col.itemR(softbody, "maxstep")
+ col.itemR(softbody, "auto_step", text="Auto-Step")
- col = split.column()
- col.itemR(softbody, "error_limit")
- col.itemL(text="Helpers:")
- col.itemR(softbody, "choke")
- col.itemR(softbody, "fuzzy")
+ col = split.column()
+ col.itemR(softbody, "error_limit")
+ col.itemL(text="Helpers:")
+ col.itemR(softbody, "choke")
+ col.itemR(softbody, "fuzzy")
- layout.itemL(text="Diagnostics:")
- layout.itemR(softbody, "diagnose")
+ layout.itemL(text="Diagnostics:")
+ layout.itemR(softbody, "diagnose")
bpy.types.register(PHYSICS_PT_softbody)
bpy.types.register(PHYSICS_PT_softbody_cache)
diff --git a/release/ui/buttons_scene.py b/release/ui/buttons_scene.py
index 3c321f11f6e..e9ee97468e8 100644
--- a/release/ui/buttons_scene.py
+++ b/release/ui/buttons_scene.py
@@ -2,8 +2,8 @@
import bpy
class RenderButtonsPanel(bpy.types.Panel):
- __space_type__ = 'PROPERTIES'
- __region_type__ = 'WINDOW'
+ __space_type__ = "PROPERTIES"
+ __region_type__ = "WINDOW"
__context__ = "scene"
# COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
@@ -41,8 +41,8 @@ class SCENE_PT_layers(RenderButtonsPanel):
row.template_list(rd, "layers", rd, "active_layer_index", rows=2)
col = row.column(align=True)
- col.itemO("scene.render_layer_add", icon='ICON_ZOOMIN', text="")
- col.itemO("scene.render_layer_remove", icon='ICON_ZOOMOUT', text="")
+ col.itemO("scene.render_layer_add", icon="ICON_ZOOMIN", text="")
+ col.itemO("scene.render_layer_remove", icon="ICON_ZOOMOUT", text="")
rl = rd.layers[rd.active_layer_index]
@@ -103,19 +103,19 @@ class SCENE_PT_layers(RenderButtonsPanel):
col.itemR(rl, "pass_diffuse")
row = col.row()
row.itemR(rl, "pass_specular")
- row.itemR(rl, "pass_specular_exclude", text="", icon='ICON_X')
+ row.itemR(rl, "pass_specular_exclude", text="", icon="ICON_X")
row = col.row()
row.itemR(rl, "pass_shadow")
- row.itemR(rl, "pass_shadow_exclude", text="", icon='ICON_X')
+ row.itemR(rl, "pass_shadow_exclude", text="", icon="ICON_X")
row = col.row()
row.itemR(rl, "pass_ao")
- row.itemR(rl, "pass_ao_exclude", text="", icon='ICON_X')
+ row.itemR(rl, "pass_ao_exclude", text="", icon="ICON_X")
row = col.row()
row.itemR(rl, "pass_reflection")
- row.itemR(rl, "pass_reflection_exclude", text="", icon='ICON_X')
+ row.itemR(rl, "pass_reflection_exclude", text="", icon="ICON_X")
row = col.row()
row.itemR(rl, "pass_refraction")
- row.itemR(rl, "pass_refraction_exclude", text="", icon='ICON_X')
+ row.itemR(rl, "pass_refraction_exclude", text="", icon="ICON_X")
class SCENE_PT_shading(RenderButtonsPanel):
__label__ = "Shading"
@@ -189,27 +189,20 @@ class SCENE_PT_post_processing(RenderButtonsPanel):
col = split.column()
col.itemR(rd, "use_compositing")
col.itemR(rd, "use_sequencer")
-
- col = split.column()
- col.itemR(rd, "dither_intensity", text="Dither", slider=True)
-
- layout.itemS()
-
- split = layout.split()
-
+
col = split.column()
- col.itemR(rd, "fields", text="Fields")
- sub = col.column()
+ row = col.row()
+ row.itemR(rd, "fields", text="Fields")
+ sub = row.row()
sub.active = rd.fields
- sub.row().itemR(rd, "field_order", expand=True)
sub.itemR(rd, "fields_still", text="Still")
-
- col = split.column()
- col.itemR(rd, "edge")
- sub = col.column()
- sub.active = rd.edge
- sub.itemR(rd, "edge_threshold", text="Threshold", slider=True)
- sub.itemR(rd, "edge_color", text="")
+ sub = col.row()
+ sub.active = rd.fields
+ sub.itemR(rd, "field_order", expand=True)
+
+ split = layout.split()
+ split.itemL()
+ split.itemR(rd, "dither_intensity", text="Dither", slider=True)
class SCENE_PT_output(RenderButtonsPanel):
__label__ = "Output"
@@ -229,8 +222,8 @@ class SCENE_PT_output(RenderButtonsPanel):
col = split.column()
col.itemR(rd, "file_extensions")
- col.itemR(rd, "use_overwrite")
- col.itemR(rd, "use_placeholder")
+ col.itemR(rd, "placeholders")
+ col.itemR(rd, "no_overwrite")
if rd.file_format in ('AVIJPEG', 'JPEG'):
split = layout.split()
@@ -330,9 +323,11 @@ class SCENE_PT_antialiasing(RenderButtonsPanel):
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw_header(self, context):
+ layout = self.layout
+
rd = context.scene.render_data
- self.layout.itemR(rd, "antialiasing", text="")
+ layout.itemR(rd, "antialiasing", text="")
def draw(self, context):
layout = self.layout
@@ -375,9 +370,9 @@ class SCENE_PT_dimensions(RenderButtonsPanel):
sub.itemR(rd, "pixel_aspect_y", text="Y")
row = col.row()
- row.itemR(rd, "use_border", text="Border")
+ row.itemR(rd, "border", text="Border")
rowsub = row.row()
- rowsub.active = rd.use_border
+ rowsub.active = rd.border
rowsub.itemR(rd, "crop_to_border", text="Crop")
col = split.column(align=True)
@@ -396,9 +391,11 @@ class SCENE_PT_stamp(RenderButtonsPanel):
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw_header(self, context):
+ layout = self.layout
+
rd = context.scene.render_data
- self.layout.itemR(rd, "render_stamp", text="")
+ layout.itemR(rd, "render_stamp", text="")
def draw(self, context):
layout = self.layout
diff --git a/release/ui/buttons_texture.py b/release/ui/buttons_texture.py
index 90ce40b4832..29e43981fd2 100644
--- a/release/ui/buttons_texture.py
+++ b/release/ui/buttons_texture.py
@@ -2,8 +2,8 @@
import bpy
class TextureButtonsPanel(bpy.types.Panel):
- __space_type__ = 'PROPERTIES'
- __region_type__ = 'WINDOW'
+ __space_type__ = "PROPERTIES"
+ __region_type__ = "WINDOW"
__context__ = "texture"
def poll(self, context):
@@ -210,51 +210,35 @@ class TEXTURE_PT_influence(TextureSlotPanel):
sub.itemR(tex, factor, text=name, slider=True)
if ma:
- if ma.type in ['SURFACE', 'HALO', 'WIRE']:
- split = layout.split()
-
- col = split.column()
- col.itemL(text="Diffuse:")
- factor_but(col, tex.map_diffuse, "map_diffuse", "diffuse_factor", "Intensity")
- factor_but(col, tex.map_colordiff, "map_colordiff", "colordiff_factor", "Color")
- factor_but(col, tex.map_alpha, "map_alpha", "alpha_factor", "Alpha")
- factor_but(col, tex.map_translucency, "map_translucency", "translucency_factor", "Translucency")
-
- col.itemL(text="Specular:")
- factor_but(col, tex.map_specular, "map_specular", "specular_factor", "Intensity")
- factor_but(col, tex.map_colorspec, "map_colorspec", "colorspec_factor", "Color")
- factor_but(col, tex.map_hardness, "map_hardness", "hardness_factor", "Hardness")
-
- col = split.column()
- col.itemL(text="Shading:")
- factor_but(col, tex.map_ambient, "map_ambient", "ambient_factor", "Ambient")
- factor_but(col, tex.map_emit, "map_emit", "emit_factor", "Emit")
- factor_but(col, tex.map_mirror, "map_mirror", "mirror_factor", "Mirror")
- factor_but(col, tex.map_raymir, "map_raymir", "raymir_factor", "Ray Mirror")
-
- col.itemL(text="Geometry:")
- factor_but(col, tex.map_normal, "map_normal", "normal_factor", "Normal")
- factor_but(col, tex.map_warp, "map_warp", "warp_factor", "Warp")
- factor_but(col, tex.map_displacement, "map_displacement", "displacement_factor", "Displace")
-
- #sub = col.column()
- #sub.active = tex.map_translucency or tex.map_emit or tex.map_alpha or tex.map_raymir or tex.map_hardness or tex.map_ambient or tex.map_specularity or tex.map_reflection or tex.map_mirror
- #sub.itemR(tex, "default_value", text="Amount", slider=True)
- elif ma.type == 'VOLUME':
- split = layout.split()
-
- col = split.column()
- factor_but(col, tex.map_density, "map_density", "density_factor", "Density")
- factor_but(col, tex.map_emission, "map_emission", "emission_factor", "Emission")
- factor_but(col, tex.map_absorption, "map_absorption", "absorption_factor", "Absorption")
- factor_but(col, tex.map_scattering, "map_scattering", "scattering_factor", "Scattering")
-
- col = split.column()
- col.itemL(text=" ")
- factor_but(col, tex.map_alpha, "map_coloremission", "coloremission_factor", "Emission Color")
- factor_but(col, tex.map_colorabsorption, "map_colorabsorption", "colorabsorption_factor", "Absorption Color")
-
+ split = layout.split()
+
+ col = split.column()
+ col.itemL(text="Diffuse:")
+ factor_but(col, tex.map_diffuse, "map_diffuse", "diffuse_factor", "Intensity")
+ factor_but(col, tex.map_colordiff, "map_colordiff", "colordiff_factor", "Color")
+ factor_but(col, tex.map_alpha, "map_alpha", "alpha_factor", "Alpha")
+ factor_but(col, tex.map_translucency, "map_translucency", "translucency_factor", "Translucency")
+
+ col.itemL(text="Specular:")
+ factor_but(col, tex.map_specular, "map_specular", "specular_factor", "Intensity")
+ factor_but(col, tex.map_colorspec, "map_colorspec", "colorspec_factor", "Color")
+ factor_but(col, tex.map_hardness, "map_hardness", "hardness_factor", "Hardness")
+ col = split.column()
+ col.itemL(text="Shading:")
+ factor_but(col, tex.map_ambient, "map_ambient", "ambient_factor", "Ambient")
+ factor_but(col, tex.map_emit, "map_emit", "emit_factor", "Emit")
+ factor_but(col, tex.map_mirror, "map_mirror", "mirror_factor", "Mirror")
+ factor_but(col, tex.map_raymir, "map_raymir", "raymir_factor", "Ray Mirror")
+
+ col.itemL(text="Geometry:")
+ factor_but(col, tex.map_normal, "map_normal", "normal_factor", "Normal")
+ factor_but(col, tex.map_warp, "map_warp", "warp_factor", "Warp")
+ factor_but(col, tex.map_displacement, "map_displacement", "displacement_factor", "Displace")
+
+ #sub = col.column()
+ #sub.active = tex.map_translucency or tex.map_emit or tex.map_alpha or tex.map_raymir or tex.map_hardness or tex.map_ambient or tex.map_specularity or tex.map_reflection or tex.map_mirror
+ #sub.itemR(tex, "default_value", text="Amount", slider=True)
elif la:
row = layout.row()
factor_but(row, tex.map_color, "map_color", "color_factor", "Color")
@@ -609,133 +593,13 @@ class TEXTURE_PT_distortednoise(TextureTypePanel):
layout.itemR(tex, "noise_basis", text="Basis")
flow = layout.column_flow()
- flow.itemR(tex, "distortion", text="Distortion")
+ flow.itemR(tex, "distortion_amount", text="Distortion")
flow.itemR(tex, "noise_size", text="Size")
flow.itemR(tex, "nabla")
-
-class TEXTURE_PT_voxeldata(TextureButtonsPanel):
- __idname__= "TEXTURE_PT_voxeldata"
- __label__ = "Voxel Data"
-
- def poll(self, context):
- tex = context.texture
- return (tex and tex.type == 'VOXEL_DATA')
-
- def draw(self, context):
- layout = self.layout
-
- tex = context.texture
- vd = tex.voxeldata
-
- layout.itemR(vd, "file_format")
- if vd.file_format in ['BLENDER_VOXEL', 'RAW_8BIT']:
- layout.itemR(vd, "source_path")
- if vd.file_format == 'RAW_8BIT':
- layout.itemR(vd, "resolution")
- elif vd.file_format == 'SMOKE':
- layout.itemR(vd, "domain_object")
-
- layout.itemR(vd, "still")
- row = layout.row()
- row.active = vd.still
- row.itemR(vd, "still_frame_number")
-
- layout.itemR(vd, "interpolation")
- layout.itemR(vd, "intensity")
-
-class TEXTURE_PT_pointdensity(TextureButtonsPanel):
- __idname__= "TEXTURE_PT_pointdensity"
- __label__ = "Point Density"
-
- def poll(self, context):
- tex = context.texture
- return (tex and tex.type == 'POINT_DENSITY')
-
- def draw(self, context):
- layout = self.layout
-
- tex = context.texture
- pd = tex.pointdensity
-
- layout.itemR(pd, "point_source", expand=True)
-
- split = layout.split()
-
- col = split.column()
- if pd.point_source == 'PARTICLE_SYSTEM':
- col.itemL(text="Object:")
- col.itemR(pd, "object", text="")
-
- sub = col.column()
- sub.enabled = pd.object
- if pd.object:
- sub.itemL(text="System:")
- sub.item_pointerR(pd, "particle_system", pd.object, "particle_systems", text="")
- sub.itemL(text="Cache:")
- sub.itemR(pd, "particle_cache", text="")
- else:
- col.itemL(text="Object:")
- col.itemR(pd, "object", text="")
- col.itemL(text="Cache:")
- col.itemR(pd, "vertices_cache", text="")
-
- col.itemS()
-
- col.itemL(text="Color Source:")
- col.itemR(pd, "color_source", text="")
- if pd.color_source in ('PARTICLE_SPEED', 'PARTICLE_VELOCITY'):
- col.itemR(pd, "speed_scale")
- if pd.color_source in ('PARTICLE_SPEED', 'PARTICLE_AGE'):
- layout.template_color_ramp(pd.color_ramp, expand=True)
-
- col = split.column()
- col.itemL()
- col.itemR(pd, "radius")
- col.itemL(text="Falloff:")
- col.itemR(pd, "falloff", text="")
- if pd.falloff == 'SOFT':
- col.itemR(pd, "falloff_softness")
-
-class TEXTURE_PT_pointdensity_turbulence(TextureButtonsPanel):
- __label__ = "Turbulence"
-
- def poll(self, context):
- tex = context.texture
- return (tex and tex.type == 'POINT_DENSITY')
-
- def draw_header(self, context):
- layout = self.layout
-
- tex = context.texture
- pd = tex.pointdensity
-
- layout.itemR(pd, "turbulence", text="")
-
- def draw(self, context):
- layout = self.layout
-
- tex = context.texture
- pd = tex.pointdensity
- layout.active = pd.turbulence
-
- split = layout.split()
-
- col = split.column()
- col.itemL(text="Influence:")
- col.itemR(pd, "turbulence_influence", text="")
- col.itemL(text="Noise Basis:")
- col.itemR(pd, "noise_basis", text="")
-
- col = split.column()
- col.itemL()
- col.itemR(pd, "turbulence_size")
- col.itemR(pd, "turbulence_depth")
- col.itemR(pd, "turbulence_strength")
bpy.types.register(TEXTURE_PT_context_texture)
bpy.types.register(TEXTURE_PT_preview)
-
-bpy.types.register(TEXTURE_PT_clouds) # Texture Type Panels
+bpy.types.register(TEXTURE_PT_clouds)
bpy.types.register(TEXTURE_PT_wood)
bpy.types.register(TEXTURE_PT_marble)
bpy.types.register(TEXTURE_PT_magic)
@@ -749,10 +613,6 @@ bpy.types.register(TEXTURE_PT_envmap)
bpy.types.register(TEXTURE_PT_musgrave)
bpy.types.register(TEXTURE_PT_voronoi)
bpy.types.register(TEXTURE_PT_distortednoise)
-bpy.types.register(TEXTURE_PT_voxeldata)
-bpy.types.register(TEXTURE_PT_pointdensity)
-bpy.types.register(TEXTURE_PT_pointdensity_turbulence)
-
bpy.types.register(TEXTURE_PT_colors)
bpy.types.register(TEXTURE_PT_mapping)
bpy.types.register(TEXTURE_PT_influence)
diff --git a/release/ui/buttons_world.py b/release/ui/buttons_world.py
index b02673d126f..599f45d160b 100644
--- a/release/ui/buttons_world.py
+++ b/release/ui/buttons_world.py
@@ -2,21 +2,24 @@
import bpy
class WorldButtonsPanel(bpy.types.Panel):
- __space_type__ = 'PROPERTIES'
- __region_type__ = 'WINDOW'
+ __space_type__ = "PROPERTIES"
+ __region_type__ = "WINDOW"
__context__ = "world"
# COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
def poll(self, context):
rd = context.scene.render_data
- return (context.world) and (not rd.use_game_engine) and (rd.engine in self.COMPAT_ENGINES)
+ return (context.world != None) and (not rd.use_game_engine) and (rd.engine in self.COMPAT_ENGINES)
class WORLD_PT_preview(WorldButtonsPanel):
__label__ = "Preview"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
- self.layout.template_preview(context.world)
+ layout = self.layout
+ world = context.world
+
+ layout.template_preview(world)
class WORLD_PT_context_world(WorldButtonsPanel):
__show_header__ = False
@@ -49,30 +52,32 @@ class WORLD_PT_world(WorldButtonsPanel):
world = context.world
- row = layout.row()
- row.itemR(world, "paper_sky")
- row.itemR(world, "blend_sky")
- row.itemR(world, "real_sky")
+ if world:
+
+ row = layout.row()
+ row.itemR(world, "paper_sky")
+ row.itemR(world, "blend_sky")
+ row.itemR(world, "real_sky")
- row = layout.row()
- row.column().itemR(world, "horizon_color")
- col = row.column()
- col.itemR(world, "zenith_color")
- col.active = world.blend_sky
- row.column().itemR(world, "ambient_color")
+ row = layout.row()
+ row.column().itemR(world, "horizon_color")
+ col = row.column()
+ col.itemR(world, "zenith_color")
+ col.active = world.blend_sky
+ row.column().itemR(world, "ambient_color")
class WORLD_PT_mist(WorldButtonsPanel):
__label__ = "Mist"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw_header(self, context):
+ layout = self.layout
world = context.world
- self.layout.itemR(world.mist, "enabled", text="")
+ layout.itemR(world.mist, "enabled", text="")
def draw(self, context):
layout = self.layout
-
world = context.world
layout.active = world.mist.enabled
@@ -82,6 +87,7 @@ class WORLD_PT_mist(WorldButtonsPanel):
flow.itemR(world.mist, "start")
flow.itemR(world.mist, "depth")
flow.itemR(world.mist, "height")
+
layout.itemR(world.mist, "falloff")
@@ -90,13 +96,13 @@ class WORLD_PT_stars(WorldButtonsPanel):
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw_header(self, context):
+ layout = self.layout
world = context.world
- self.layout.itemR(world.stars, "enabled", text="")
+ layout.itemR(world.stars, "enabled", text="")
def draw(self, context):
layout = self.layout
-
world = context.world
layout.active = world.stars.enabled
@@ -112,13 +118,13 @@ class WORLD_PT_ambient_occlusion(WorldButtonsPanel):
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw_header(self, context):
+ layout = self.layout
world = context.world
- self.layout.itemR(world.ambient_occlusion, "enabled", text="")
+ layout.itemR(world.ambient_occlusion, "enabled", text="")
def draw(self, context):
layout = self.layout
-
ao = context.world.ambient_occlusion
layout.active = ao.enabled
@@ -180,3 +186,4 @@ bpy.types.register(WORLD_PT_world)
bpy.types.register(WORLD_PT_ambient_occlusion)
bpy.types.register(WORLD_PT_mist)
bpy.types.register(WORLD_PT_stars)
+
diff --git a/release/ui/space_buttons.py b/release/ui/space_buttons.py
index aa89c06ea08..3cf782e615f 100644
--- a/release/ui/space_buttons.py
+++ b/release/ui/space_buttons.py
@@ -2,7 +2,7 @@
import bpy
class Buttons_HT_header(bpy.types.Header):
- __space_type__ = 'PROPERTIES'
+ __space_type__ = "PROPERTIES"
def draw(self, context):
layout = self.layout
@@ -22,7 +22,7 @@ class Buttons_HT_header(bpy.types.Header):
row.itemR(scene, "current_frame")
class Buttons_MT_view(bpy.types.Menu):
- __space_type__ = 'PROPERTIES'
+ __space_type__ = "PROPERTIES"
__label__ = "View"
def draw(self, context):
diff --git a/release/ui/space_console.py b/release/ui/space_console.py
index 136082a285a..45cb2a856e1 100644
--- a/release/ui/space_console.py
+++ b/release/ui/space_console.py
@@ -5,7 +5,7 @@ import bpy_ops # XXX - should not need to do this
del bpy_ops
class CONSOLE_HT_header(bpy.types.Header):
- __space_type__ = 'CONSOLE'
+ __space_type__ = "CONSOLE"
def draw(self, context):
sc = context.space_data
@@ -39,7 +39,7 @@ class CONSOLE_HT_header(bpy.types.Header):
row.itemO("console.report_replay")
class CONSOLE_MT_console(bpy.types.Menu):
- __space_type__ = 'CONSOLE'
+ __space_type__ = "CONSOLE"
__label__ = "Console"
def draw(self, context):
@@ -52,7 +52,7 @@ class CONSOLE_MT_console(bpy.types.Menu):
layout.itemO("console.paste")
class CONSOLE_MT_report(bpy.types.Menu):
- __space_type__ = 'CONSOLE'
+ __space_type__ = "CONSOLE"
__label__ = "Report"
def draw(self, context):
@@ -108,9 +108,9 @@ def get_console(console_id):
class CONSOLE_OT_exec(bpy.types.Operator):
'''
- Execute the current console line as a python expression.
+ Operator documentatuon text, will be used for the operator tooltip and python docs.
'''
- __idname__ = "console.execute"
+ __idname__ = "console.exec"
__label__ = "Console Execute"
__register__ = False
@@ -385,7 +385,7 @@ def autocomp(bcon):
class CONSOLE_OT_autocomplete(bpy.types.Operator):
'''
- Evaluate the namespace up until the cursor and give a list of options or complete the name if there is only one.
+ Operator documentatuon text, will be used for the operator tooltip and python docs.
'''
__idname__ = "console.autocomplete"
__label__ = "Console Autocomplete"
diff --git a/release/ui/space_filebrowser.py b/release/ui/space_filebrowser.py
index f1ea5555787..51a8f3f78e8 100644
--- a/release/ui/space_filebrowser.py
+++ b/release/ui/space_filebrowser.py
@@ -1,15 +1,15 @@
import bpy
+
class FILEBROWSER_HT_header(bpy.types.Header):
- __space_type__ = 'FILE_BROWSER'
+ __space_type__ = "FILE_BROWSER"
def draw(self, context):
+ st = context.space_data
layout = self.layout
- st = context.space_data
params = st.params
-
layout.template_header(menus=False)
row = layout.row(align=True)
@@ -39,4 +39,5 @@ class FILEBROWSER_HT_header(bpy.types.Header):
row.active = params.do_filter
+
bpy.types.register(FILEBROWSER_HT_header)
diff --git a/release/ui/space_image.py b/release/ui/space_image.py
index 3f82727da47..090067120b1 100644
--- a/release/ui/space_image.py
+++ b/release/ui/space_image.py
@@ -2,19 +2,18 @@
import bpy
class IMAGE_MT_view(bpy.types.Menu):
- __space_type__ = 'IMAGE_EDITOR'
+ __space_type__ = "IMAGE_EDITOR"
__label__ = "View"
def draw(self, context):
layout = self.layout
-
sima = context.space_data
uv = sima.uv_editor
settings = context.tool_settings
show_uvedit = sima.show_uvedit
- layout.itemO("image.properties", icon='ICON_MENU_PANEL')
+ layout.itemO("image.properties", icon="ICON_MENU_PANEL")
layout.itemS()
@@ -44,7 +43,7 @@ class IMAGE_MT_view(bpy.types.Menu):
layout.itemO("screen.screen_full_area")
class IMAGE_MT_select(bpy.types.Menu):
- __space_type__ = 'IMAGE_EDITOR'
+ __space_type__ = "IMAGE_EDITOR"
__label__ = "Select"
def draw(self, context):
@@ -65,12 +64,11 @@ class IMAGE_MT_select(bpy.types.Menu):
layout.itemO("uv.select_linked")
class IMAGE_MT_image(bpy.types.Menu):
- __space_type__ = 'IMAGE_EDITOR'
+ __space_type__ = "IMAGE_EDITOR"
__label__ = "Image"
def draw(self, context):
layout = self.layout
-
sima = context.space_data
ima = sima.image
@@ -87,7 +85,7 @@ class IMAGE_MT_image(bpy.types.Menu):
layout.itemO("image.save")
layout.itemO("image.save_as")
- if ima.source == 'SEQUENCE':
+ if ima.source == "SEQUENCE":
layout.itemO("image.save_sequence")
if not show_render:
@@ -101,7 +99,7 @@ class IMAGE_MT_image(bpy.types.Menu):
# only for dirty && specific image types, perhaps
# this could be done in operator poll too
if ima.dirty:
- if ima.source in ('FILE', 'GENERATED') and ima.type != 'MULTILAYER':
+ if ima.source in ("FILE", "GENERATED") and ima.type != "MULTILAYER":
layout.item_booleanO("image.pack", "as_png", True, text="Pack As PNG")
layout.itemS()
@@ -109,7 +107,7 @@ class IMAGE_MT_image(bpy.types.Menu):
layout.itemR(sima, "image_painting")
class IMAGE_MT_uvs_showhide(bpy.types.Menu):
- __space_type__ = 'IMAGE_EDITOR'
+ __space_type__ = "IMAGE_EDITOR"
__label__ = "Show/Hide Faces"
def draw(self, context):
@@ -120,7 +118,7 @@ class IMAGE_MT_uvs_showhide(bpy.types.Menu):
layout.item_booleanO("uv.hide", "unselected", True)
class IMAGE_MT_uvs_transform(bpy.types.Menu):
- __space_type__ = 'IMAGE_EDITOR'
+ __space_type__ = "IMAGE_EDITOR"
__label__ = "Transform"
def draw(self, context):
@@ -131,7 +129,7 @@ class IMAGE_MT_uvs_transform(bpy.types.Menu):
layout.item_enumO("tfm.transform", "mode", 'RESIZE')
class IMAGE_MT_uvs_mirror(bpy.types.Menu):
- __space_type__ = 'IMAGE_EDITOR'
+ __space_type__ = "IMAGE_EDITOR"
__label__ = "Mirror"
def draw(self, context):
@@ -141,7 +139,7 @@ class IMAGE_MT_uvs_mirror(bpy.types.Menu):
layout.item_enumO("uv.mirror", "axis", 'MIRROR_Y') # "Y Axis", M,
class IMAGE_MT_uvs_weldalign(bpy.types.Menu):
- __space_type__ = 'IMAGE_EDITOR'
+ __space_type__ = "IMAGE_EDITOR"
__label__ = "Weld/Align"
def draw(self, context):
@@ -150,13 +148,13 @@ class IMAGE_MT_uvs_weldalign(bpy.types.Menu):
layout.itemO("uv.weld") # W, 1
layout.items_enumO("uv.align", "axis") # W, 2/3/4
+
class IMAGE_MT_uvs(bpy.types.Menu):
- __space_type__ = 'IMAGE_EDITOR'
+ __space_type__ = "IMAGE_EDITOR"
__label__ = "UVs"
def draw(self, context):
layout = self.layout
-
sima = context.space_data
uv = sima.uv_editor
settings = context.tool_settings
@@ -194,14 +192,13 @@ class IMAGE_MT_uvs(bpy.types.Menu):
layout.itemM("IMAGE_MT_uvs_showhide")
class IMAGE_HT_header(bpy.types.Header):
- __space_type__ = 'IMAGE_EDITOR'
+ __space_type__ = "IMAGE_EDITOR"
def draw(self, context):
- layout = self.layout
-
sima = context.space_data
ima = sima.image
iuser = sima.image_user
+ layout = self.layout
settings = context.tool_settings
show_render = sima.show_render
@@ -250,7 +247,7 @@ class IMAGE_HT_header(bpy.types.Header):
"""
mesh = context.edit_object.data
- row.item_pointerR(mesh, "active_uv_layer", mesh, "uv_textures")
+ row.item_pointerR(mesh, "active_uv_layer", mesh, "uv_layers")
"""
if ima:
@@ -265,17 +262,17 @@ class IMAGE_HT_header(bpy.types.Header):
row.itemR(sima, "draw_channels", text="", expand=True)
row = layout.row(align=True)
- if ima.type == 'COMPOSITE':
- row.itemO("image.record_composite", icon='ICON_REC')
- if ima.type == 'COMPOSITE' and ima.source in ('MOVIE', 'SEQUENCE'):
- row.itemO("image.play_composite", icon='ICON_PLAY')
+ if ima.type == "COMPOSITE":
+ row.itemO("image.record_composite", icon="ICON_REC")
+ if ima.type == "COMPOSITE" and ima.source in ("MOVIE", "SEQUENCE"):
+ row.itemO("image.play_composite", icon="ICON_PLAY")
if show_uvedit or sima.image_painting:
layout.itemR(sima, "update_automatically", text="")
class IMAGE_PT_game_properties(bpy.types.Panel):
- __space_type__ = 'IMAGE_EDITOR'
- __region_type__ = 'UI'
+ __space_type__ = "IMAGE_EDITOR"
+ __region_type__ = "UI"
__label__ = "Game Properties"
def poll(self, context):
@@ -284,48 +281,52 @@ class IMAGE_PT_game_properties(bpy.types.Panel):
return (sima and sima.image) and (rd.engine == 'BLENDER_GAME')
def draw(self, context):
- layout = self.layout
-
sima = context.space_data
+ layout = self.layout
+
ima = sima.image
- split = layout.split()
+ if ima:
+ split = layout.split()
- col = split.column()
- col.itemR(ima, "clamp_x")
- col.itemR(ima, "clamp_y")
- col.itemR(ima, "mapping", expand=True)
- col.itemR(ima, "tiles")
+ col = split.column()
- col = split.column()
+ subcol = col.column(align=True)
+ subcol.itemR(ima, "clamp_x")
+ subcol.itemR(ima, "clamp_y")
+
+ col.itemR(ima, "mapping", expand=True)
+ col.itemR(ima, "tiles")
+
+ col = split.column()
- sub = col.column(align=True)
- sub.itemR(ima, "animated")
+ subcol = col.column(align=True)
+ subcol.itemR(ima, "animated")
- subsub = sub.column()
- subsub.active = ima.animated
- subsub.itemR(ima, "animation_start", text="Start")
- subsub.itemR(ima, "animation_end", text="End")
- subsub.itemR(ima, "animation_speed", text="Speed")
+ subcol = subcol.column()
+ subcol.itemR(ima, "animation_start", text="Start")
+ subcol.itemR(ima, "animation_end", text="End")
+ subcol.itemR(ima, "animation_speed", text="Speed")
+ subcol.active = ima.animated
- sub = col.row(align=True)
- sub.active = ima.tiles or ima.animated
- sub.itemR(ima, "tiles_x", text="X")
- sub.itemR(ima, "tiles_y", text="Y")
+ subrow = col.row(align=True)
+ subrow.itemR(ima, "tiles_x", text="X")
+ subrow.itemR(ima, "tiles_y", text="Y")
+ subrow.active = ima.tiles or ima.animated
class IMAGE_PT_view_properties(bpy.types.Panel):
- __space_type__ = 'IMAGE_EDITOR'
- __region_type__ = 'UI'
- __label__ = "Display"
+ __space_type__ = "IMAGE_EDITOR"
+ __region_type__ = "UI"
+ __label__ = "View Properties"
def poll(self, context):
sima = context.space_data
return (sima and (sima.image or sima.show_uvedit))
def draw(self, context):
- layout = self.layout
-
sima = context.space_data
+ layout = self.layout
+
ima = sima.image
show_uvedit = sima.show_uvedit
uvedit = sima.uv_editor
@@ -334,33 +335,26 @@ class IMAGE_PT_view_properties(bpy.types.Panel):
col = split.column()
if ima:
- col.itemR(ima, "display_aspect", text="Aspect Ratio")
+ col.itemR(ima, "display_aspect")
col = split.column()
- col.itemL(text="Coordinates:")
col.itemR(sima, "draw_repeated", text="Repeat")
if show_uvedit:
col.itemR(uvedit, "normalized_coordinates", text="Normalized")
elif show_uvedit:
- col.itemL(text="Coordinates:")
col.itemR(uvedit, "normalized_coordinates", text="Normalized")
if show_uvedit:
col = layout.column()
row = col.row()
row.itemR(uvedit, "edge_draw_type", expand=True)
-
- split = layout.split()
+ row = col.row()
+ row.itemR(uvedit, "draw_smooth_edges", text="Smooth")
+ row.itemR(uvedit, "draw_modified_edges", text="Modified")
- col = split.column()
- col.itemR(uvedit, "draw_stretch", text="Stretch")
- sub = col.column()
- sub.active = uvedit.draw_stretch
- sub.row().itemR(uvedit, "draw_stretch_type", expand=True)
-
- col = split.column()
- col.itemR(uvedit, "draw_smooth_edges", text="Smooth")
- col.itemR(uvedit, "draw_modified_edges", text="Modified")
+ row = col.row()
+ row.itemR(uvedit, "draw_stretch", text="Stretch")
+ row.itemR(uvedit, "draw_stretch_type", text="")
#col.itemR(uvedit, "draw_edges")
#col.itemR(uvedit, "draw_faces")
@@ -375,3 +369,4 @@ bpy.types.register(IMAGE_MT_uvs)
bpy.types.register(IMAGE_HT_header)
bpy.types.register(IMAGE_PT_game_properties)
bpy.types.register(IMAGE_PT_view_properties)
+
diff --git a/release/ui/space_info.py b/release/ui/space_info.py
index e6cc4af2a06..bfe051b8df2 100644
--- a/release/ui/space_info.py
+++ b/release/ui/space_info.py
@@ -2,14 +2,13 @@
import bpy
class INFO_HT_header(bpy.types.Header):
- __space_type__ = 'INFO'
+ __space_type__ = "INFO"
def draw(self, context):
layout = self.layout
st = context.space_data
- scene = context.scene
- rd = scene.render_data
+ rd = context.scene.render_data
row = layout.row(align=True)
row.template_header()
@@ -34,11 +33,9 @@ class INFO_HT_header(bpy.types.Header):
layout.template_operator_search()
layout.template_running_jobs()
-
- layout.itemL(text=scene.statistics())
class INFO_MT_file(bpy.types.Menu):
- __space_type__ = 'INFO'
+ __space_type__ = "INFO"
__label__ = "File"
def draw(self, context):
@@ -74,7 +71,7 @@ class INFO_MT_file(bpy.types.Menu):
layout.itemO("wm.exit_blender", text="Quit")
class INFO_MT_file_import(bpy.types.Menu):
- __space_type__ = 'INFO'
+ __space_type__ = "INFO"
__label__ = "Import"
def draw(self, context):
@@ -83,7 +80,7 @@ class INFO_MT_file_import(bpy.types.Menu):
layout.itemO("import.obj", text="OBJ")
class INFO_MT_file_export(bpy.types.Menu):
- __space_type__ = 'INFO'
+ __space_type__ = "INFO"
__label__ = "Export"
def draw(self, context):
@@ -96,7 +93,7 @@ class INFO_MT_file_export(bpy.types.Menu):
layout.itemO("export.x3d", text="X3D")
class INFO_MT_file_external_data(bpy.types.Menu):
- __space_type__ = 'INFO'
+ __space_type__ = "INFO"
__label__ = "External Data"
def draw(self, context):
@@ -113,7 +110,7 @@ class INFO_MT_file_external_data(bpy.types.Menu):
layout.itemO("file.find_missing_files")
class INFO_MT_add(bpy.types.Menu):
- __space_type__ = 'INFO'
+ __space_type__ = "INFO"
__label__ = "Add"
def draw(self, context):
@@ -121,25 +118,25 @@ class INFO_MT_add(bpy.types.Menu):
layout.operator_context = "EXEC_SCREEN"
- layout.item_menu_enumO("object.mesh_add", "type", text="Mesh", icon='ICON_OUTLINER_OB_MESH')
- layout.item_menu_enumO("object.curve_add", "type", text="Curve", icon='ICON_OUTLINER_OB_CURVE')
- layout.item_menu_enumO("object.surface_add", "type", text="Surface", icon='ICON_OUTLINER_OB_SURFACE')
- layout.item_menu_enumO("object.metaball_add", "type", 'META', icon='ICON_OUTLINER_OB_META')
- layout.itemO("object.text_add", text="Text", icon='ICON_OUTLINER_OB_FONT')
+ layout.item_menu_enumO( "OBJECT_OT_mesh_add", "type", text="Mesh", icon='ICON_OUTLINER_OB_MESH')
+ layout.item_menu_enumO( "OBJECT_OT_curve_add", "type", text="Curve", icon='ICON_OUTLINER_OB_CURVE')
+ layout.item_menu_enumO( "OBJECT_OT_surface_add", "type", text="Surface", icon='ICON_OUTLINER_OB_SURFACE')
+ layout.item_menu_enumO( "OBJECT_OT_metaball_add", "type", 'META', icon='ICON_OUTLINER_OB_META')
+ layout.itemO("OBJECT_OT_text_add", text="Text", icon='ICON_OUTLINER_OB_FONT')
layout.itemS()
- layout.itemO("object.armature_add", text="Armature", icon='ICON_OUTLINER_OB_ARMATURE')
- layout.item_enumO("object.add", "type", 'LATTICE', icon='ICON_OUTLINER_OB_LATTICE')
- layout.item_enumO("object.add", "type", 'EMPTY', icon='ICON_OUTLINER_OB_EMPTY')
+ layout.itemO("OBJECT_OT_armature_add", text="Armature", icon='ICON_OUTLINER_OB_ARMATURE')
+ layout.item_enumO("OBJECT_OT_object_add", "type", 'LATTICE', icon='ICON_OUTLINER_OB_LATTICE')
+ layout.item_enumO("OBJECT_OT_object_add", "type", 'EMPTY', icon='ICON_OUTLINER_OB_EMPTY')
layout.itemS()
- layout.item_enumO("object.add", "type", 'CAMERA', icon='ICON_OUTLINER_OB_CAMERA')
- layout.item_enumO("object.add", "type", 'LAMP', icon='ICON_OUTLINER_OB_LAMP')
+ layout.item_enumO("OBJECT_OT_object_add", "type", 'CAMERA', icon='ICON_OUTLINER_OB_CAMERA')
+ layout.item_enumO("OBJECT_OT_object_add", "type", 'LAMP', icon='ICON_OUTLINER_OB_LAMP')
class INFO_MT_game(bpy.types.Menu):
- __space_type__ = 'INFO'
+ __space_type__ = "INFO"
__label__ = "Game"
def draw(self, context):
@@ -157,7 +154,7 @@ class INFO_MT_game(bpy.types.Menu):
layout.itemR(gs, "deprecation_warnings")
class INFO_MT_render(bpy.types.Menu):
- __space_type__ = 'INFO'
+ __space_type__ = "INFO"
__label__ = "Render"
def draw(self, context):
@@ -173,7 +170,7 @@ class INFO_MT_render(bpy.types.Menu):
layout.itemO("screen.render_view_show")
class INFO_MT_help(bpy.types.Menu):
- __space_type__ = 'INFO'
+ __space_type__ = "INFO"
__label__ = "Help"
def draw(self, context):
diff --git a/release/ui/space_logic.py b/release/ui/space_logic.py
index 5748d15a53a..728e5e6307b 100644
--- a/release/ui/space_logic.py
+++ b/release/ui/space_logic.py
@@ -1,8 +1,8 @@
import bpy
class LOGIC_PT_properties(bpy.types.Panel):
- __space_type__ = 'LOGIC_EDITOR'
- __region_type__ = 'UI'
+ __space_type__ = "LOGIC_EDITOR"
+ __region_type__ = "UI"
__label__ = "Properties"
def poll(self, context):
@@ -11,19 +11,15 @@ class LOGIC_PT_properties(bpy.types.Panel):
def draw(self, context):
layout = self.layout
-
ob = context.active_object
game = ob.game
- layout.itemO("object.game_property_new", text="Add Game Property")
-
- for i, prop in enumerate(game.properties):
-
- row = layout.row(align=True)
- row.itemR(prop, "name", text="")
- row.itemR(prop, "type", text="")
- row.itemR(prop, "value", text="", toggle=True) # we dont care about the type. rna will display correctly
- row.itemR(prop, "debug", text="", toggle=True, icon='ICON_INFO')
- row.item_intO("object.game_property_remove", "index", i, text="", icon='ICON_X')
-
+ for prop in game.properties:
+ flow = layout.row()
+ flow.itemR(prop, "name", text="")
+ flow.itemR(prop, "type", text="")
+ flow.itemR(prop, "value", text="") # we dont care about the type. rna will display correctly
+ flow.itemR(prop, "debug")
+
bpy.types.register(LOGIC_PT_properties)
+
diff --git a/release/ui/space_node.py b/release/ui/space_node.py
index 6ac1ac84f35..2e28cfc2eed 100644
--- a/release/ui/space_node.py
+++ b/release/ui/space_node.py
@@ -2,11 +2,10 @@
import bpy
class NODE_HT_header(bpy.types.Header):
- __space_type__ = 'NODE_EDITOR'
+ __space_type__ = "NODE_EDITOR"
def draw(self, context):
layout = self.layout
-
snode = context.space_data
row = layout.row(align=True)
@@ -28,7 +27,7 @@ class NODE_HT_header(bpy.types.Header):
if ob:
layout.template_ID(ob, "active_material", new="material.new")
if id:
- layout.itemR(id, "use_nodes")
+ layout.itemR(id, "use_nodes", toggle=True)
elif snode.tree_type == 'TEXTURE':
row.itemR(snode, "texture_type", text="", expand=True)
@@ -38,17 +37,17 @@ class NODE_HT_header(bpy.types.Header):
if id_from:
layout.template_ID(id_from, "active_texture", new="texture.new")
if id:
- layout.itemR(id, "use_nodes")
+ layout.itemR(id, "use_nodes", toggle=True)
elif snode.tree_type == 'COMPOSITING':
id = snode.id
- layout.itemR(id, "use_nodes")
- layout.itemR(id.render_data, "free_unused_nodes", text="Free Unused")
- layout.itemR(snode, "backdrop")
+ layout.itemR(id, "use_nodes", toggle=True)
+ layout.itemR(id.render_data, "free_unused_nodes", text="Free Unused", toggle=True)
+ layout.itemR(snode, "backdrop", toggle=True)
class NODE_MT_view(bpy.types.Menu):
- __space_type__ = 'NODE_EDITOR'
+ __space_type__ = "NODE_EDITOR"
__label__ = "View"
def draw(self, context):
@@ -66,7 +65,7 @@ class NODE_MT_view(bpy.types.Menu):
layout.itemO("screen.screen_full_area")
class NODE_MT_select(bpy.types.Menu):
- __space_type__ = 'NODE_EDITOR'
+ __space_type__ = "NODE_EDITOR"
__label__ = "Select"
def draw(self, context):
@@ -81,7 +80,7 @@ class NODE_MT_select(bpy.types.Menu):
# layout.itemO("node.select_linked_to")
class NODE_MT_node(bpy.types.Menu):
- __space_type__ = 'NODE_EDITOR'
+ __space_type__ = "NODE_EDITOR"
__label__ = "Node"
def draw(self, context):
@@ -114,7 +113,9 @@ class NODE_MT_node(bpy.types.Menu):
# layout.itemS()
# layout.itemO("node.show_cyclic_dependencies")
+
bpy.types.register(NODE_HT_header)
bpy.types.register(NODE_MT_view)
bpy.types.register(NODE_MT_select)
bpy.types.register(NODE_MT_node)
+
diff --git a/release/ui/space_outliner.py b/release/ui/space_outliner.py
index 522b620e29d..f55f4633a7b 100644
--- a/release/ui/space_outliner.py
+++ b/release/ui/space_outliner.py
@@ -2,7 +2,7 @@
import bpy
class OUTLINER_HT_header(bpy.types.Header):
- __space_type__ = 'OUTLINER'
+ __space_type__ = "OUTLINER"
def draw(self, context):
so = context.space_data
@@ -36,7 +36,7 @@ class OUTLINER_HT_header(bpy.types.Header):
class OUTLINER_MT_view(bpy.types.Menu):
- __space_type__ = 'OUTLINER'
+ __space_type__ = "OUTLINER"
__label__ = "View"
def draw(self, context):
diff --git a/release/ui/space_sequencer.py b/release/ui/space_sequencer.py
index daae4a83ec4..1edcf32d3b5 100644
--- a/release/ui/space_sequencer.py
+++ b/release/ui/space_sequencer.py
@@ -7,7 +7,7 @@ def act_strip(context):
# Header
class SEQUENCER_HT_header(bpy.types.Header):
- __space_type__ = 'SEQUENCE_EDITOR'
+ __space_type__ = "SEQUENCE_EDITOR"
def draw(self, context):
layout = self.layout
@@ -38,7 +38,7 @@ class SEQUENCER_HT_header(bpy.types.Header):
layout.itemR(st, "display_channel", text="Channel")
class SEQUENCER_MT_view(bpy.types.Menu):
- __space_type__ = 'SEQUENCE_EDITOR'
+ __space_type__ = "SEQUENCE_EDITOR"
__label__ = "View"
def draw(self, context):
@@ -106,7 +106,7 @@ class SEQUENCER_MT_view(bpy.types.Menu):
"""
class SEQUENCER_MT_select(bpy.types.Menu):
- __space_type__ = 'SEQUENCE_EDITOR'
+ __space_type__ = "SEQUENCE_EDITOR"
__label__ = "Select"
def draw(self, context):
@@ -127,7 +127,7 @@ class SEQUENCER_MT_select(bpy.types.Menu):
layout.itemO("sequencer.select_inverse")
class SEQUENCER_MT_marker(bpy.types.Menu):
- __space_type__ = 'SEQUENCE_EDITOR'
+ __space_type__ = "SEQUENCE_EDITOR"
__label__ = "Marker (TODO)"
def draw(self, context):
@@ -146,7 +146,7 @@ class SEQUENCER_MT_marker(bpy.types.Menu):
#layout.itemO("sequencer.sound_strip_add", text="Transform Markers") # toggle, will be rna - (sseq->flag & SEQ_MARKER_TRANS)
class SEQUENCER_MT_add(bpy.types.Menu):
- __space_type__ = 'SEQUENCE_EDITOR'
+ __space_type__ = "SEQUENCE_EDITOR"
__label__ = "Add"
def draw(self, context):
@@ -163,7 +163,7 @@ class SEQUENCER_MT_add(bpy.types.Menu):
layout.itemM("SEQUENCER_MT_add_effect")
class SEQUENCER_MT_add_effect(bpy.types.Menu):
- __space_type__ = 'SEQUENCE_EDITOR'
+ __space_type__ = "SEQUENCE_EDITOR"
__label__ = "Effect Strip..."
def draw(self, context):
@@ -187,7 +187,7 @@ class SEQUENCER_MT_add_effect(bpy.types.Menu):
layout.item_enumO("sequencer.effect_strip_add", 'type', 'SPEED')
class SEQUENCER_MT_strip(bpy.types.Menu):
- __space_type__ = 'SEQUENCE_EDITOR'
+ __space_type__ = "SEQUENCE_EDITOR"
__label__ = "Strip"
def draw(self, context):
@@ -254,15 +254,15 @@ class SEQUENCER_MT_strip(bpy.types.Menu):
# Panels
class SequencerButtonsPanel(bpy.types.Panel):
- __space_type__ = 'SEQUENCE_EDITOR'
- __region_type__ = 'UI'
+ __space_type__ = "SEQUENCE_EDITOR"
+ __region_type__ = "UI"
def poll(self, context):
return context.space_data.display_mode == 'SEQUENCER' and act_strip(context) != None
class SequencerButtonsPanel_Output(bpy.types.Panel):
- __space_type__ = 'SEQUENCE_EDITOR'
- __region_type__ = 'UI'
+ __space_type__ = "SEQUENCE_EDITOR"
+ __region_type__ = "UI"
def poll(self, context):
return context.space_data.display_mode != 'SEQUENCER'
@@ -303,7 +303,6 @@ class SEQUENCER_PT_edit(SequencerButtonsPanel):
row.itemR(strip, "frame_locked", text="Frame Lock")
col = layout.column()
- col.enabled = not strip.lock
col.itemR(strip, "channel")
col.itemR(strip, "start_frame")
col.itemR(strip, "length")
@@ -416,28 +415,23 @@ class SEQUENCER_PT_input(SequencerButtonsPanel):
if not strip:
return False
- return strip.type in ('MOVIE', 'IMAGE')
+ return strip.type in ('MOVIE', 'IMAGE', 'SOUND')
def draw(self, context):
layout = self.layout
strip = act_strip(context)
- split = layout.split(percentage=0.2)
- col = split.column()
- col.itemL(text="Path:")
- col = split.column()
- col.itemR(strip, "directory", text="")
+ layout.itemR(strip, "directory", text="")
# Current element for the filename
-
+ split = layout.split(percentage=0.3)
+ col = split.column()
+ col.itemL(text="File Name:")
+ col = split.column()
elem = strip.getStripElem(context.scene.current_frame)
if elem:
- split = layout.split(percentage=0.2)
- col = split.column()
- col.itemL(text="File:")
- col = split.column()
col.itemR(elem, "filename", text="") # strip.elements[0] could be a fallback
layout.itemR(strip, "use_translation", text="Image Offset:")
@@ -461,37 +455,6 @@ class SEQUENCER_PT_input(SequencerButtonsPanel):
col.itemR(strip, "animation_start_offset", text="Start")
col.itemR(strip, "animation_end_offset", text="End")
-class SEQUENCER_PT_sound(SequencerButtonsPanel):
- __label__ = "Sound"
-
- def poll(self, context):
- if context.space_data.display_mode != 'SEQUENCER':
- return False
-
- strip = act_strip(context)
- if not strip:
- return False
-
- return strip.type in ('SOUND', )
-
- def draw(self, context):
- layout = self.layout
-
- strip = act_strip(context)
-
- layout.template_ID(strip, "sound", new="sound.open")
-
- layout.itemS()
- layout.itemR(strip.sound, "filename", text="")
-
- row = layout.row()
- if strip.sound.packed_file:
- row.itemO("sound.unpack", icon='ICON_PACKAGE', text="Unpack")
- else:
- row.itemO("sound.pack", icon='ICON_UGLYPACKAGE', text="Pack")
-
- row.itemR(strip.sound, "caching")
-
class SEQUENCER_PT_filter(SequencerButtonsPanel):
__label__ = "Filter"
@@ -595,7 +558,6 @@ bpy.types.register(SEQUENCER_MT_strip)
bpy.types.register(SEQUENCER_PT_edit) # sequencer panels
bpy.types.register(SEQUENCER_PT_effect)
bpy.types.register(SEQUENCER_PT_input)
-bpy.types.register(SEQUENCER_PT_sound)
bpy.types.register(SEQUENCER_PT_filter)
bpy.types.register(SEQUENCER_PT_proxy)
diff --git a/release/ui/space_text.py b/release/ui/space_text.py
index 117033c50a1..61e8d3489a5 100644
--- a/release/ui/space_text.py
+++ b/release/ui/space_text.py
@@ -2,13 +2,12 @@
import bpy
class TEXT_HT_header(bpy.types.Header):
- __space_type__ = 'TEXT_EDITOR'
+ __space_type__ = "TEXT_EDITOR"
def draw(self, context):
- layout = self.layout
-
st = context.space_data
text = st.text
+ layout = self.layout
row = layout.row(align=True)
row.template_header()
@@ -46,14 +45,13 @@ class TEXT_HT_header(bpy.types.Header):
row.itemL(text="Text: Internal")
class TEXT_PT_properties(bpy.types.Panel):
- __space_type__ = 'TEXT_EDITOR'
- __region_type__ = 'UI'
+ __space_type__ = "TEXT_EDITOR"
+ __region_type__ = "UI"
__label__ = "Properties"
def draw(self, context):
- layout = self.layout
-
st = context.space_data
+ layout = self.layout
flow = layout.column_flow()
flow.itemR(st, "line_numbers")
@@ -66,14 +64,13 @@ class TEXT_PT_properties(bpy.types.Panel):
flow.itemR(st, "tab_width")
class TEXT_PT_find(bpy.types.Panel):
- __space_type__ = 'TEXT_EDITOR'
- __region_type__ = 'UI'
+ __space_type__ = "TEXT_EDITOR"
+ __region_type__ = "UI"
__label__ = "Find"
def draw(self, context):
- layout = self.layout
-
st = context.space_data
+ layout = self.layout
# find
col = layout.column(align=True)
@@ -98,12 +95,11 @@ class TEXT_PT_find(bpy.types.Panel):
row.itemR(st, "find_all", text="All")
class TEXT_MT_text(bpy.types.Menu):
- __space_type__ = 'TEXT_EDITOR'
+ __space_type__ = "TEXT_EDITOR"
__label__ = "Text"
def draw(self, context):
layout = self.layout
-
st = context.space_data
text = st.text
@@ -131,7 +127,7 @@ class TEXT_MT_text(bpy.types.Menu):
layout.itemS()
- layout.itemO("text.properties", icon='ICON_MENU_PANEL')
+ layout.itemO("text.properties", icon="ICON_MENU_PANEL")
#ifndef DISABLE_PYTHON
# XXX layout.column()
@@ -140,7 +136,7 @@ class TEXT_MT_text(bpy.types.Menu):
#endif
class TEXT_MT_edit_view(bpy.types.Menu):
- __space_type__ = 'TEXT_EDITOR'
+ __space_type__ = "TEXT_EDITOR"
__label__ = "View"
def draw(self, context):
@@ -150,7 +146,7 @@ class TEXT_MT_edit_view(bpy.types.Menu):
layout.item_enumO("text.move", "type", 'FILE_BOTTOM', text="Bottom of File")
class TEXT_MT_edit_select(bpy.types.Menu):
- __space_type__ = 'TEXT_EDITOR'
+ __space_type__ = "TEXT_EDITOR"
__label__ = "Select"
def draw(self, context):
@@ -160,7 +156,7 @@ class TEXT_MT_edit_select(bpy.types.Menu):
layout.itemO("text.select_line")
class TEXT_MT_edit_markers(bpy.types.Menu):
- __space_type__ = 'TEXT_EDITOR'
+ __space_type__ = "TEXT_EDITOR"
__label__ = "Markers"
def draw(self, context):
@@ -171,7 +167,7 @@ class TEXT_MT_edit_markers(bpy.types.Menu):
layout.itemO("text.previous_marker")
class TEXT_MT_format(bpy.types.Menu):
- __space_type__ = 'TEXT_EDITOR'
+ __space_type__ = "TEXT_EDITOR"
__label__ = "Format"
def draw(self, context):
@@ -190,7 +186,7 @@ class TEXT_MT_format(bpy.types.Menu):
layout.item_menu_enumO("text.convert_whitespace", "type")
class TEXT_MT_edit_to3d(bpy.types.Menu):
- __space_type__ = 'TEXT_EDITOR'
+ __space_type__ = "TEXT_EDITOR"
__label__ = "Text To 3D Object"
def draw(self, context):
@@ -200,11 +196,12 @@ class TEXT_MT_edit_to3d(bpy.types.Menu):
layout.item_booleanO("text.to_3d_object", "split_lines", True, text="One Object Per Line");
class TEXT_MT_edit(bpy.types.Menu):
- __space_type__ = 'TEXT_EDITOR'
+ __space_type__ = "TEXT_EDITOR"
__label__ = "Edit"
def poll(self, context):
- return (context.space_data.text)
+ st = context.space_data
+ return st.text != None
def draw(self, context):
layout = self.layout
@@ -243,3 +240,4 @@ bpy.types.register(TEXT_MT_edit_view)
bpy.types.register(TEXT_MT_edit_select)
bpy.types.register(TEXT_MT_edit_markers)
bpy.types.register(TEXT_MT_edit_to3d)
+
diff --git a/release/ui/space_time.py b/release/ui/space_time.py
index bb82eea3272..d1c9f9806f3 100644
--- a/release/ui/space_time.py
+++ b/release/ui/space_time.py
@@ -2,7 +2,7 @@
import bpy
class TIME_HT_header(bpy.types.Header):
- __space_type__ = 'TIMELINE'
+ __space_type__ = "TIMELINE"
def draw(self, context):
layout = self.layout
@@ -22,7 +22,7 @@ class TIME_HT_header(bpy.types.Header):
sub.itemM("TIME_MT_frame")
sub.itemM("TIME_MT_playback")
- layout.itemR(scene, "use_preview_range", text="PR")
+ layout.itemR(scene, "use_preview_range", text="PR", toggle=True)
row = layout.row(align=True)
if not scene.use_preview_range:
@@ -33,8 +33,6 @@ class TIME_HT_header(bpy.types.Header):
row.itemR(scene, "preview_range_end_frame", text="End")
layout.itemR(scene, "current_frame", text="")
-
- layout.itemS()
row = layout.row(align=True)
row.item_booleanO("screen.frame_jump", "end", False, text="", icon='ICON_REW')
@@ -49,23 +47,28 @@ class TIME_HT_header(bpy.types.Header):
row.item_booleanO("screen.keyframe_jump", "next", True, text="", icon='ICON_NEXT_KEYFRAME')
row.item_booleanO("screen.frame_jump", "end", True, text="", icon='ICON_FF')
+ layout.itemR(rd, "sync_audio", text="", toggle=True, icon='ICON_SPEAKER')
+
+ layout.itemS()
+
row = layout.row(align=True)
row.itemR(tools, "enable_auto_key", text="", toggle=True, icon='ICON_REC')
+ sub = row.row()
+ sub.active = tools.enable_auto_key
+ sub.itemR(tools, "autokey_mode", text="")
if screen.animation_playing and tools.enable_auto_key:
subsub = row.row()
subsub.itemR(tools, "record_with_nla", toggle=True)
-
- layout.itemR(rd, "sync_audio", text="", toggle=True, icon='ICON_SPEAKER')
layout.itemS()
row = layout.row(align=True)
- row.item_pointerR(scene, "active_keying_set", scene, "keying_sets", text="")
- row.itemO("anim.insert_keyframe", text="", icon='ICON_KEY_HLT')
- row.itemO("anim.delete_keyframe", text="", icon='ICON_KEY_DEHLT')
+ row.itemR(scene, "active_keying_set", text="")
+ row.itemO("anim.insert_keyframe", text="", icon="ICON_KEY_HLT")
+ row.itemO("anim.delete_keyframe", text="", icon="ICON_KEY_DEHLT")
class TIME_MT_view(bpy.types.Menu):
- __space_type__ = 'TIMELINE'
+ __space_type__ = "TIMELINE"
__label__ = "View"
def draw(self, context):
@@ -80,12 +83,11 @@ class TIME_MT_view(bpy.types.Menu):
layout.itemR(st, "only_selected")
class TIME_MT_frame(bpy.types.Menu):
- __space_type__ = 'TIMELINE'
+ __space_type__ = "TIMELINE"
__label__ = "Frame"
def draw(self, context):
layout = self.layout
- tools = context.tool_settings
layout.itemO("marker.add", text="Add Marker")
layout.itemO("marker.duplicate", text="Duplicate Marker")
@@ -97,22 +99,15 @@ class TIME_MT_frame(bpy.types.Menu):
layout.itemO("time.start_frame_set")
layout.itemO("time.end_frame_set")
-
- layout.itemS()
-
- sub = layout.row()
- sub.active = tools.enable_auto_key
- sub.itemM("TIME_MT_autokey")
class TIME_MT_playback(bpy.types.Menu):
- __space_type__ = 'TIMELINE'
+ __space_type__ = "TIMELINE"
__label__ = "Playback"
def draw(self, context):
layout = self.layout
st = context.space_data
- rd = context.scene.render_data
layout.itemR(st, "play_top_left")
layout.itemR(st, "play_all_3d")
@@ -120,32 +115,10 @@ class TIME_MT_playback(bpy.types.Menu):
layout.itemR(st, "play_buttons")
layout.itemR(st, "play_image")
layout.itemR(st, "play_sequencer")
-
layout.itemS()
-
layout.itemR(st, "continue_physics")
-
- layout.itemS()
-
- layout.itemR(rd, "sync_audio", icon='ICON_SPEAKER')
-
-
-
-class TIME_MT_autokey(bpy.types.Menu):
- __space_type__ = 'TIMELINE'
- __label__ = "Auto-Keyframing Mode"
-
- def draw(self, context):
- layout = self.layout
- tools = context.tool_settings
-
- layout.active = tools.enable_auto_key
-
- layout.item_enumR(tools, "autokey_mode", 'ADD_REPLACE_KEYS')
- layout.item_enumR(tools, "autokey_mode", 'REPLACE_KEYS')
bpy.types.register(TIME_HT_header)
bpy.types.register(TIME_MT_view)
bpy.types.register(TIME_MT_frame)
-bpy.types.register(TIME_MT_autokey)
bpy.types.register(TIME_MT_playback)
diff --git a/release/ui/space_userpref.py b/release/ui/space_userpref.py
index 1e7a9b581d4..95054efcb25 100644
--- a/release/ui/space_userpref.py
+++ b/release/ui/space_userpref.py
@@ -2,26 +2,21 @@
import bpy
class USERPREF_HT_header(bpy.types.Header):
- __space_type__ = 'USER_PREFERENCES'
+ __space_type__ = "USER_PREFERENCES"
def draw(self, context):
layout = self.layout
layout.template_header(menus=False)
-
- userpref = context.user_preferences
-
- layout.operator_context = "EXEC_AREA"
- layout.itemO("wm.save_homefile", text="Save As Default")
class USERPREF_MT_view(bpy.types.Menu):
- __space_type__ = 'USER_PREFERENCES'
+ __space_type__ = "USER_PREFERENCES"
__label__ = "View"
def draw(self, context):
layout = self.layout
class USERPREF_PT_tabs(bpy.types.Panel):
- __space_type__ = 'USER_PREFERENCES'
+ __space_type__ = "USER_PREFERENCES"
__show_header__ = False
def draw(self, context):
@@ -32,7 +27,7 @@ class USERPREF_PT_tabs(bpy.types.Panel):
layout.itemR(userpref, "active_section", expand=True)
class USERPREF_PT_view(bpy.types.Panel):
- __space_type__ = 'USER_PREFERENCES'
+ __space_type__ = "USER_PREFERENCES"
__label__ = "View"
__show_header__ = False
@@ -64,11 +59,11 @@ class USERPREF_PT_view(bpy.types.Panel):
sub1.itemS()
sub1.itemS()
sub1.itemS()
- sub1.itemR(view, "show_mini_axis", text="Display Mini Axis")
+ sub1.itemR(view, "show_mini_axis")
sub2 = sub1.column()
sub2.enabled = view.show_mini_axis
- sub2.itemR(view, "mini_axis_size", text="Size")
- sub2.itemR(view, "mini_axis_brightness", text="Brightness")
+ sub2.itemR(view, "mini_axis_size")
+ sub2.itemR(view, "mini_axis_brightness")
col = split.column()
sub = col.split(percentage=0.85)
@@ -135,7 +130,7 @@ class USERPREF_PT_view(bpy.types.Panel):
sub1.itemR(view, "open_right_mouse_delay", text="Hold RMB")
class USERPREF_PT_edit(bpy.types.Panel):
- __space_type__ = 'USER_PREFERENCES'
+ __space_type__ = "USER_PREFERENCES"
__label__ = "Edit"
__show_header__ = False
@@ -230,10 +225,9 @@ class USERPREF_PT_edit(bpy.types.Panel):
sub1.itemR(edit, "duplicate_texture", text="Texture")
sub1.itemR(edit, "duplicate_ipo", text="F-Curve")
sub1.itemR(edit, "duplicate_action", text="Action")
- sub1.itemR(edit, "duplicate_particle", text="Particle")
class USERPREF_PT_system(bpy.types.Panel):
- __space_type__ = 'USER_PREFERENCES'
+ __space_type__ = "USER_PREFERENCES"
__label__ = "System"
__show_header__ = False
@@ -314,7 +308,7 @@ class USERPREF_PT_system(bpy.types.Panel):
sub1.itemR(system, "texture_collection_rate", text="Collection Rate")
class USERPREF_PT_filepaths(bpy.types.Panel):
- __space_type__ = 'USER_PREFERENCES'
+ __space_type__ = "USER_PREFERENCES"
__label__ = "File Paths"
__show_header__ = False
@@ -365,9 +359,6 @@ class USERPREF_PT_filepaths(bpy.types.Panel):
sub2.itemL(text="Save & Load:")
sub2.itemR(paths, "use_relative_paths")
sub2.itemR(paths, "compress_file")
- sub2.itemR(paths, "load_ui")
- sub2.itemS()
- sub2.itemS()
sub2.itemL(text="Auto Save:")
sub2.itemR(paths, "save_version")
sub2.itemR(paths, "recent_files")
@@ -375,10 +366,10 @@ class USERPREF_PT_filepaths(bpy.types.Panel):
sub2.itemR(paths, "auto_save_temporary_files")
sub3 = sub2.column()
sub3.enabled = paths.auto_save_temporary_files
- sub3.itemR(paths, "auto_save_time", text="Timer (mins)")
+ sub3.itemR(paths, "auto_save_time")
class USERPREF_PT_language(bpy.types.Panel):
- __space_type__ = 'USER_PREFERENCES'
+ __space_type__ = "USER_PREFERENCES"
__label__ = "Language"
__show_header__ = False
@@ -396,16 +387,24 @@ class USERPREF_PT_language(bpy.types.Panel):
col = split.column()
col.itemR(lan, "language")
- col.itemL(text="Translate:")
- col.itemR(lan, "translate_tooltips", text="Tooltips")
- col.itemR(lan, "translate_buttons", text="Labels")
- col.itemR(lan, "translate_toolbox", text="Toolbox")
- col.itemS()
- col.itemS()
+ col.itemR(lan, "translate_tooltips")
+ col.itemR(lan, "translate_buttons")
+ col.itemR(lan, "translate_toolbox")
col.itemR(lan, "use_textured_fonts")
- col = split.column()
-
+class USERPREF_PT_bottombar(bpy.types.Panel):
+ __space_type__ = "USER_PREFERENCES"
+ __label__ = " "
+ __show_header__ = False
+
+ def draw(self, context):
+ layout = self.layout
+ userpref = context.user_preferences
+
+ split = layout.split(percentage=0.8)
+ split.itemL(text="")
+ layout.operator_context = "EXEC_AREA"
+ split.itemO("wm.save_homefile", text="Save As Default")
bpy.types.register(USERPREF_HT_header)
bpy.types.register(USERPREF_MT_view)
@@ -415,4 +414,5 @@ bpy.types.register(USERPREF_PT_edit)
bpy.types.register(USERPREF_PT_system)
bpy.types.register(USERPREF_PT_filepaths)
bpy.types.register(USERPREF_PT_language)
+bpy.types.register(USERPREF_PT_bottombar)
diff --git a/release/ui/space_view3d.py b/release/ui/space_view3d.py
index bc133cbff48..44b1c82ff46 100644
--- a/release/ui/space_view3d.py
+++ b/release/ui/space_view3d.py
@@ -4,7 +4,7 @@ import bpy
# ********** Header **********
class VIEW3D_HT_header(bpy.types.Header):
- __space_type__ = 'VIEW_3D'
+ __space_type__ = "VIEW_3D"
def draw(self, context):
layout = self.layout
@@ -12,7 +12,6 @@ class VIEW3D_HT_header(bpy.types.Header):
view = context.space_data
mode_string = context.mode
edit_object = context.edit_object
- object = context.active_object
row = layout.row(align=True)
row.template_header()
@@ -24,63 +23,32 @@ class VIEW3D_HT_header(bpy.types.Header):
sub.itemM("VIEW3D_MT_view")
# Select Menu
- if mode_string not in ('EDIT_TEXT', 'SCULPT', 'PAINT_WEIGHT', 'PAINT_VERTEX', 'PAINT_TEXTURE'):
+ if mode_string not in ('EDIT_TEXT', 'SCULPT', 'PAINT_WEIGHT', 'PAINT_VERTEX', 'PAINT_TEXTURE', 'PARTICLE'):
+ # XXX: Particle Mode has Select Menu.
sub.itemM("VIEW3D_MT_select_%s" % mode_string)
- if edit_object:
+ if mode_string == 'OBJECT':
+ sub.itemM("VIEW3D_MT_object")
+ elif mode_string == 'SCULPT':
+ sub.itemM("VIEW3D_MT_sculpt")
+ elif edit_object:
sub.itemM("VIEW3D_MT_edit_%s" % edit_object.type)
- elif object:
- ob_mode_string = object.mode
-
- if mode_string not in ['PAINT_WEIGHT', 'PAINT_TEXTURE']:
- sub.itemM("VIEW3D_MT_%s" % mode_string)
layout.template_header_3D()
# ********** Menu **********
-# ********** Utilities **********
-
-class VIEW3D_MT_showhide(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
- __label__ = "Show/Hide"
- _operator_name = ""
-
- def draw(self, context):
- layout = self.layout
-
- layout.itemO("%s.reveal" % self._operator_name, text="Show Hidden")
- layout.itemO("%s.hide" % self._operator_name, text="Hide Selected")
- layout.item_booleanO("%s.hide" % self._operator_name, "unselected", True, text="Hide Unselected")
-
-class VIEW3D_MT_snap(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
- __label__ = "Snap"
-
- def draw(self, context):
- layout = self.layout
-
- layout.itemO("view3d.snap_selected_to_grid", text="Selection to Grid")
- layout.itemO("view3d.snap_selected_to_cursor", text="Selection to Cursor")
- layout.itemO("view3d.snap_selected_to_center", text="Selection to Center")
-
- layout.itemS()
-
- layout.itemO("view3d.snap_cursor_to_selected", text="Cursor to Selected")
- layout.itemO("view3d.snap_cursor_to_grid", text="Cursor to Grid")
- layout.itemO("view3d.snap_cursor_to_active", text="Cursor to Active")
-
# ********** View menus **********
class VIEW3D_MT_view(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
+ __space_type__ = "VIEW_3D"
__label__ = "View"
def draw(self, context):
layout = self.layout
- layout.itemO("view3d.properties", icon='ICON_MENU_PANEL')
- layout.itemO("view3d.toolbar", icon='ICON_MENU_PANEL')
+ layout.itemO("view3d.properties", icon="ICON_MENU_PANEL")
+ layout.itemO("view3d.toolbar", icon="ICON_MENU_PANEL")
layout.itemS()
@@ -89,23 +57,32 @@ class VIEW3D_MT_view(bpy.types.Menu):
layout.item_enumO("view3d.viewnumpad", "type", 'FRONT')
layout.item_enumO("view3d.viewnumpad", "type", 'RIGHT')
- layout.itemM("VIEW3D_MT_view_cameras", text="Cameras")
+ # layout.itemM("VIEW3D_MT_view_cameras", text="Cameras")
layout.itemS()
-
+
layout.itemO("view3d.view_persportho")
layout.itemS()
+ # layout.itemO("view3d.view_show_all_layers")
+
+ # layout.itemS()
+
+ # layout.itemO("view3d.view_local_view")
+ # layout.itemO("view3d.view_global_view")
+
+ # layout.itemS()
+
layout.itemM("VIEW3D_MT_view_navigation")
- layout.itemM("VIEW3D_MT_view_align")
+ # layout.itemM("VIEW3D_MT_view_align", text="Align View")
layout.itemS()
layout.operator_context = "INVOKE_REGION_WIN"
-
- layout.itemO("view3d.clip_border", text="Clipping Border...")
- layout.itemO("view3d.zoom_border", text="Zoom Border...")
+
+ layout.itemO("view3d.clip_border")
+ layout.itemO("view3d.zoom_border")
layout.itemS()
@@ -116,14 +93,17 @@ class VIEW3D_MT_view(bpy.types.Menu):
layout.itemO("screen.region_foursplit", text="Toggle Quad View")
layout.itemO("screen.screen_full_area", text="Toggle Full Screen")
-
+
class VIEW3D_MT_view_navigation(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
+ __space_type__ = "VIEW_3D"
__label__ = "Navigation"
def draw(self, context):
layout = self.layout
+ # layout.itemO("view3d.view_fly_mode")
+ # layout.itemS()
+
layout.items_enumO("view3d.view_orbit", "type")
layout.itemS()
@@ -135,26 +115,10 @@ class VIEW3D_MT_view_navigation(bpy.types.Menu):
layout.item_floatO("view3d.zoom", "delta", 1.0, text="Zoom In")
layout.item_floatO("view3d.zoom", "delta", -1.0, text="Zoom Out")
-class VIEW3D_MT_view_align(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
- __label__ = "Align View"
-
- def draw(self, context):
- layout = self.layout
-
- layout.itemO("view3d.view_center")
-
-class VIEW3D_MT_view_cameras(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
- __label__ = "Cameras"
-
- def draw(self, context):
- layout = self.layout
-
# ********** Select menus, suffix from context.mode **********
class VIEW3D_MT_select_OBJECT(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
+ __space_type__ = "VIEW_3D"
__label__ = "Select"
def draw(self, context):
@@ -167,26 +131,24 @@ class VIEW3D_MT_select_OBJECT(bpy.types.Menu):
layout.itemO("object.select_all_toggle", text="Select/Deselect All")
layout.itemO("object.select_inverse", text="Inverse")
layout.itemO("object.select_random", text="Random")
- layout.itemO("object.select_mirror", text="Mirror")
layout.itemO("object.select_by_layer", text="Select All by Layer")
- layout.item_enumO("object.select_by_type", "type", "", text="Select All by Type...")
- layout.itemO("object.select_grouped", text="Select Grouped...")
+ layout.item_enumO("object.select_by_type", "type", "", text="Select All by Type")
+ layout.itemO("object.select_grouped", text="Select Grouped")
class VIEW3D_MT_select_POSE(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
+ __space_type__ = "VIEW_3D"
__label__ = "Select"
def draw(self, context):
layout = self.layout
- layout.itemO("view3d.select_border", text="Border Select...")
+ layout.itemO("view3d.select_border")
layout.itemS()
layout.itemO("pose.select_all_toggle", text="Select/Deselect All")
layout.itemO("pose.select_inverse", text="Inverse")
layout.itemO("pose.select_constraint_target", text="Constraint Target")
- layout.itemO("pose.select_linked", text="Linked")
layout.itemS()
@@ -195,16 +157,10 @@ class VIEW3D_MT_select_POSE(bpy.types.Menu):
layout.itemS()
- props = layout.itemO("pose.select_hierarchy", properties=True, text="Extend Parent")
- props.extend = True
- props.direction = 'PARENT'
-
- props = layout.itemO("pose.select_hierarchy", properties=True, text="Extend Child")
- props.extend = True
- props.direction = 'CHILD'
+ layout.view3d_select_posemenu()
class VIEW3D_MT_select_PARTICLE(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
+ __space_type__ = "VIEW_3D"
__label__ = "Select"
def draw(self, context):
@@ -219,17 +175,20 @@ class VIEW3D_MT_select_PARTICLE(bpy.types.Menu):
layout.itemS()
+ #layout.itemO("particle.select_last")
+ #layout.itemO("particle.select_first")
+
layout.itemO("particle.select_more")
layout.itemO("particle.select_less")
class VIEW3D_MT_select_EDIT_MESH(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
+ __space_type__ = "VIEW_3D"
__label__ = "Select"
def draw(self, context):
layout = self.layout
- layout.itemO("view3d.select_border", text="Border Select...")
+ layout.itemO("view3d.select_border")
layout.itemS()
@@ -267,14 +226,14 @@ class VIEW3D_MT_select_EDIT_MESH(bpy.types.Menu):
layout.itemO("mesh.region_to_loop")
class VIEW3D_MT_select_EDIT_CURVE(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
+ __space_type__ = "VIEW_3D"
__label__ = "Select"
def draw(self, context):
layout = self.layout
- layout.itemO("view3d.select_border", text="Border Select...")
- layout.itemO("view3d.select_circle", text="Circle Select...")
+ layout.itemO("view3d.select_border")
+ layout.itemO("view3d.select_circle")
layout.itemS()
@@ -296,14 +255,14 @@ class VIEW3D_MT_select_EDIT_CURVE(bpy.types.Menu):
layout.itemO("curve.select_less")
class VIEW3D_MT_select_EDIT_SURFACE(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
+ __space_type__ = "VIEW_3D"
__label__ = "Select"
def draw(self, context):
layout = self.layout
- layout.itemO("view3d.select_border", text="Border Select...")
- layout.itemO("view3d.select_circle", text="Circle Select...")
+ layout.itemO("view3d.select_border")
+ layout.itemO("view3d.select_circle")
layout.itemS()
@@ -322,7 +281,7 @@ class VIEW3D_MT_select_EDIT_SURFACE(bpy.types.Menu):
layout.itemO("curve.select_less")
class VIEW3D_MT_select_EDIT_METABALL(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
+ __space_type__ = "VIEW_3D"
__label__ = "Select"
def draw(self, context):
@@ -332,15 +291,15 @@ class VIEW3D_MT_select_EDIT_METABALL(bpy.types.Menu):
layout.itemS()
- layout.itemO("mball.select_deselect_all_metaelems")
- layout.itemO("mball.select_inverse_metaelems")
+ layout.itemL(text="Select/Deselect All")
+ layout.itemL(text="Inverse")
layout.itemS()
- layout.itemO("mball.select_random_metaelems")
+ layout.itemL(text="Random")
class VIEW3D_MT_select_EDIT_LATTICE(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
+ __space_type__ = "VIEW_3D"
__label__ = "Select"
def draw(self, context):
@@ -353,13 +312,13 @@ class VIEW3D_MT_select_EDIT_LATTICE(bpy.types.Menu):
layout.itemO("lattice.select_all_toggle", text="Select/Deselect All")
class VIEW3D_MT_select_EDIT_ARMATURE(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
+ __space_type__ = "VIEW_3D"
__label__ = "Select"
def draw(self, context):
layout = self.layout
- layout.itemO("view3d.select_border", text="Border Select...")
+ layout.itemO("view3d.select_border")
layout.itemS()
@@ -368,21 +327,15 @@ class VIEW3D_MT_select_EDIT_ARMATURE(bpy.types.Menu):
layout.itemS()
- layout.item_enumO("armature.select_hierarchy", "direction", 'PARENT', text="Parent")
- layout.item_enumO("armature.select_hierarchy", "direction", 'CHILD', text="Child")
+ layout.item_enumO("armature.select_hierarchy", "direction", 'PARENT')
+ layout.item_enumO("armature.select_hierarchy", "direction", 'CHILD')
layout.itemS()
- props = layout.itemO("armature.select_hierarchy", properties=True, text="Extend Parent")
- props.extend = True
- props.direction = 'PARENT'
-
- props = layout.itemO("armature.select_hierarchy", properties=True, text="Extend Child")
- props.extend = True
- props.direction = 'CHILD'
+ layout.view3d_select_armaturemenu()
class VIEW3D_MT_select_FACE(bpy.types.Menu):# XXX no matching enum
- __space_type__ = 'VIEW_3D'
+ __space_type__ = "VIEW_3D"
__label__ = "Select"
def draw(self, context):
@@ -392,35 +345,35 @@ class VIEW3D_MT_select_FACE(bpy.types.Menu):# XXX no matching enum
# ********** Object menu **********
-class VIEW3D_MT_OBJECT(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
+class VIEW3D_MT_object(bpy.types.Menu):
+ __space_type__ = "VIEW_3D"
__context__ = "objectmode"
__label__ = "Object"
def draw(self, context):
layout = self.layout
- layout.itemM("VIEW3D_MT_OBJECT_clear")
- layout.itemM("VIEW3D_MT_snap")
+ layout.itemM("VIEW3D_MT_object_clear")
+ layout.itemM("VIEW3D_MT_object_snap")
layout.itemS()
- layout.itemO("anim.insert_keyframe_menu", text="Insert Keyframe...")
- layout.itemO("anim.delete_keyframe_v3d", text="Delete Keyframe...")
+ layout.itemO("anim.insert_keyframe_menu")
+ layout.itemO("anim.delete_keyframe_v3d")
layout.itemS()
layout.itemO("object.duplicate")
layout.item_booleanO("object.duplicate", "linked", True, text="Duplicate Linked")
- layout.itemO("object.delete", text="Delete...")
- layout.itemO("object.proxy_make", text="Make Proxy...")
+ layout.itemO("object.delete")
+ layout.itemO("object.proxy_make")
layout.itemS()
- layout.itemM("VIEW3D_MT_OBJECT_parent")
- layout.itemM("VIEW3D_MT_OBJECT_track")
- layout.itemM("VIEW3D_MT_OBJECT_group")
- layout.itemM("VIEW3D_MT_OBJECT_constraints")
+ layout.itemM("VIEW3D_MT_object_parent")
+ layout.itemM("VIEW3D_MT_object_track")
+ layout.itemM("VIEW3D_MT_object_group")
+ layout.itemM("VIEW3D_MT_object_constraints")
layout.itemS()
@@ -428,42 +381,59 @@ class VIEW3D_MT_OBJECT(bpy.types.Menu):
layout.itemS()
- layout.itemM("VIEW3D_MT_OBJECT_showhide")
+ layout.itemM("VIEW3D_MT_object_show")
-class VIEW3D_MT_OBJECT_clear(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
+class VIEW3D_MT_object_clear(bpy.types.Menu):
+ __space_type__ = "VIEW_3D"
__label__ = "Clear"
def draw(self, context):
layout = self.layout
- layout.itemO("object.location_clear", text="Location")
- layout.itemO("object.rotation_clear", text="Rotation")
- layout.itemO("object.scale_clear", text="Scale")
- layout.itemO("object.origin_clear", text="Origin")
+ layout.itemO("object.location_clear")
+ layout.itemO("object.rotation_clear")
+ layout.itemO("object.scale_clear")
+ layout.itemO("object.origin_clear")
+
+class VIEW3D_MT_object_snap(bpy.types.Menu):
+ __space_type__ = "VIEW_3D"
+ __label__ = "Snap"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.itemO("view3d.snap_selected_to_grid")
+ layout.itemO("view3d.snap_selected_to_cursor")
+ layout.itemO("view3d.snap_selected_to_center")
+
+ layout.itemS()
+
+ layout.itemO("view3d.snap_cursor_to_selected")
+ layout.itemO("view3d.snap_cursor_to_grid")
+ layout.itemO("view3d.snap_cursor_to_active")
-class VIEW3D_MT_OBJECT_parent(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
+class VIEW3D_MT_object_parent(bpy.types.Menu):
+ __space_type__ = "VIEW_3D"
__label__ = "Parent"
def draw(self, context):
layout = self.layout
- layout.itemO("object.parent_set", text="Set")
- layout.itemO("object.parent_clear", text="Clear")
+ layout.itemO("object.parent_set")
+ layout.itemO("object.parent_clear")
-class VIEW3D_MT_OBJECT_track(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
+class VIEW3D_MT_object_track(bpy.types.Menu):
+ __space_type__ = "VIEW_3D"
__label__ = "Track"
def draw(self, context):
layout = self.layout
- layout.itemO("object.track_set", text="Set")
- layout.itemO("object.track_clear", text="Clear")
+ layout.itemO("object.track_set")
+ layout.itemO("object.track_clear")
-class VIEW3D_MT_OBJECT_group(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
+class VIEW3D_MT_object_group(bpy.types.Menu):
+ __space_type__ = "VIEW_3D"
__label__ = "Group"
def draw(self, context):
@@ -477,8 +447,8 @@ class VIEW3D_MT_OBJECT_group(bpy.types.Menu):
layout.itemO("group.objects_add_active")
layout.itemO("group.objects_remove_active")
-class VIEW3D_MT_OBJECT_constraints(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
+class VIEW3D_MT_object_constraints(bpy.types.Menu):
+ __space_type__ = "VIEW_3D"
__label__ = "Constraints"
def draw(self, context):
@@ -487,36 +457,21 @@ class VIEW3D_MT_OBJECT_constraints(bpy.types.Menu):
layout.itemO("object.constraint_add_with_targets")
layout.itemO("object.constraints_clear")
-class VIEW3D_MT_OBJECT_showhide(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
+class VIEW3D_MT_object_show(bpy.types.Menu):
+ __space_type__ = "VIEW_3D"
__label__ = "Show/Hide"
def draw(self, context):
layout = self.layout
- layout.itemO("object.restrictview_clear", text="Show Hidden")
- layout.itemO("object.restrictview_set", text="Hide Selected")
+ layout.itemO("object.restrictview_clear")
+ layout.itemO("object.restrictview_set")
layout.item_booleanO("object.restrictview_set", "unselected", True, text="Hide Unselected")
-# ********** Vertex paint menu **********
-
-class VIEW3D_MT_PAINT_VERTEX(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
- __label__ = "Paint"
-
- def draw(self, context):
- layout = self.layout
-
- sculpt = context.tool_settings.sculpt
-
- layout.itemO("paint.vertex_color_set")
- props = layout.itemO("paint.vertex_color_set", text="Set Selected Vertex Colors", properties=True)
- props.selected = True
-
# ********** Sculpt menu **********
-class VIEW3D_MT_SCULPT(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
+class VIEW3D_MT_sculpt(bpy.types.Menu):
+ __space_type__ = "VIEW_3D"
__label__ = "Sculpt"
def draw(self, context):
@@ -549,181 +504,28 @@ class VIEW3D_MT_SCULPT(bpy.types.Menu):
layout.itemR(brush, "persistent")
layout.itemO("sculpt.set_persistent_base")
-# ********** Particle menu **********
-
-class VIEW3D_MT_PARTICLE(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
- __label__ = "Particle"
-
- def draw(self, context):
- layout = self.layout
-
- particle_edit = context.tool_settings.particle_edit
-
- layout.itemO("particle.mirror")
-
- layout.itemS()
-
- layout.itemO("particle.remove_doubles")
- layout.itemO("particle.delete")
-
- if particle_edit.selection_mode == 'POINT':
- layout.itemO("particle.subdivide")
-
- layout.itemO("particle.rekey")
-
- layout.itemS()
-
- layout.itemM("VIEW3D_MT_PARTICLE_showhide")
-
-class VIEW3D_MT_PARTICLE_showhide(VIEW3D_MT_showhide):
- _operator_name = "particle"
-
-# ********** Pose Menu **********
-
-class VIEW3D_MT_POSE(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
- __label__ = "Pose"
-
- def draw(self, context):
- layout = self.layout
-
- arm = context.active_object.data
-
- if arm.drawtype in ('BBONE', 'ENVELOPE'):
- layout.item_enumO("tfm.transform", "mode", 'BONESIZE', text="Scale Envelope Distance")
-
- layout.itemM("VIEW3D_MT_POSE_transform")
-
- layout.itemS()
-
- layout.itemO("anim.insert_keyframe_menu", text="Insert Keyframe...")
- layout.itemO("anim.delete_keyframe_v3d", text="Delete Keyframe...")
-
- layout.itemS()
-
- layout.itemO("pose.apply")
-
- layout.itemS()
-
- layout.itemO("pose.copy")
- layout.itemO("pose.paste")
- layout.item_booleanO("pose.paste", "flipped", True, text="Paste X-Flipped Pose")
-
- layout.itemS()
-
- layout.itemM("VIEW3D_MT_POSE_pose")
- layout.itemM("VIEW3D_MT_POSE_motion")
- layout.itemM("VIEW3D_MT_POSE_group")
-
- layout.itemS()
-
- layout.itemM("VIEW3D_MT_POSE_ik")
- layout.itemM("VIEW3D_MT_POSE_constraints")
-
- layout.itemS()
-
- layout.operator_context = "EXEC_AREA"
- layout.item_enumO("pose.autoside_names", "axis", 'XAXIS', text="AutoName Left/Right")
- layout.item_enumO("pose.autoside_names", "axis", 'YAXIS', text="AutoName Front/Back")
- layout.item_enumO("pose.autoside_names", "axis", 'ZAXIS', text="AutoName Top/Bottom")
-
- layout.itemO("pose.flip_names")
-
- layout.itemS()
-
- layout.operator_context = "INVOKE_AREA"
- layout.itemO("pose.armature_layers", text="Change Armature Layers...")
- layout.itemO("pose.bone_layers", text="Change Bone Layers...")
-
- layout.itemS()
-
- layout.itemM("VIEW3D_MT_POSE_showhide")
- layout.item_menu_enumO("pose.flags_set", 'mode', text="Bone Settings")
-
-class VIEW3D_MT_POSE_transform(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
- __label__ = "Clear Transform"
-
- def draw(self, context):
- layout = self.layout
-
- layout.itemL(text="User Transform")
-
- layout.itemO("pose.loc_clear", text="Location")
- layout.itemO("pose.rot_clear", text="Rotation")
- layout.itemO("pose.scale_clear", text="Scale")
-
- layout.itemL(text="Origin")
-
-class VIEW3D_MT_POSE_pose(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
- __label__ = "Pose Library"
-
- def draw(self, context):
- layout = self.layout
-
- layout.itemO("poselib.browse_interactive", text="Browse Poses...")
-
- layout.itemS()
-
- layout.itemO("poselib.pose_add", text="Add Pose...")
- layout.itemO("poselib.pose_rename", text="Rename Pose...")
- layout.itemO("poselib.pose_remove", text="Remove Pose...")
+# ********** Edit Menus, suffix from ob.type **********
-class VIEW3D_MT_POSE_motion(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
- __label__ = "Motion Paths"
+class VIEW3D_MT_edit_snap(bpy.types.Menu):
+ __space_type__ = "VIEW_3D"
+ __label__ = "Snap"
def draw(self, context):
layout = self.layout
- layout.itemO("pose.paths_calculate", text="Calculate")
- layout.itemO("pose.paths_clear", text="Clear")
-
-class VIEW3D_MT_POSE_group(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
- __label__ = "Bone Groups"
-
- def draw(self, context):
- layout = self.layout
- layout.itemO("pose.group_add")
- layout.itemO("pose.group_remove")
+ layout.itemO("view3d.snap_selected_to_grid")
+ layout.itemO("view3d.snap_selected_to_cursor")
+ layout.itemO("view3d.snap_selected_to_center")
layout.itemS()
- layout.itemO("pose.group_assign")
- layout.itemO("pose.group_unassign")
-
-
-class VIEW3D_MT_POSE_ik(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
- __label__ = "Inverse Kinematics"
-
- def draw(self, context):
- layout = self.layout
-
- layout.itemO("pose.ik_add")
- layout.itemO("pose.ik_clear")
-
-class VIEW3D_MT_POSE_constraints(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
- __label__ = "Constraints"
-
- def draw(self, context):
- layout = self.layout
-
- layout.itemO("pose.constraint_add_with_targets", text="Add (With Targets)...")
- layout.itemO("pose.constraints_clear")
-
-class VIEW3D_MT_POSE_showhide(VIEW3D_MT_showhide):
- _operator_name = "pose"
-
-# ********** Edit Menus, suffix from ob.type **********
+ layout.itemO("view3d.snap_cursor_to_selected")
+ layout.itemO("view3d.snap_cursor_to_grid")
+ layout.itemO("view3d.snap_cursor_to_active")
# Edit MESH
class VIEW3D_MT_edit_MESH(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
+ __space_type__ = "VIEW_3D"
__label__ = "Mesh"
def draw(self, context):
@@ -736,17 +538,17 @@ class VIEW3D_MT_edit_MESH(bpy.types.Menu):
layout.itemS()
- layout.itemM("VIEW3D_MT_snap")
+ layout.itemM("VIEW3D_MT_edit_snap")
layout.itemS()
- layout.itemO("uv.mapping_menu", text="UV Unwrap...")
+ layout.itemO("uv.mapping_menu")
layout.itemS()
layout.itemO("mesh.extrude")
layout.itemO("mesh.duplicate")
- layout.itemO("mesh.delete", text="Delete...")
+ layout.itemO("mesh.delete")
layout.itemS()
@@ -766,7 +568,7 @@ class VIEW3D_MT_edit_MESH(bpy.types.Menu):
layout.itemM("VIEW3D_MT_edit_MESH_showhide")
class VIEW3D_MT_edit_MESH_vertices(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
+ __space_type__ = "VIEW_3D"
__label__ = "Vertices"
def draw(self, context):
@@ -781,9 +583,9 @@ class VIEW3D_MT_edit_MESH_vertices(bpy.types.Menu):
layout.itemO("mesh.vertices_smooth")
layout.itemO("mesh.remove_doubles")
-
+
class VIEW3D_MT_edit_MESH_edges(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
+ __space_type__ = "VIEW_3D"
__label__ = "Edges"
def draw(self, context):
@@ -791,6 +593,7 @@ class VIEW3D_MT_edit_MESH_edges(bpy.types.Menu):
layout.itemO("mesh.edge_face_add")
layout.itemO("mesh.subdivide")
+ layout.item_floatO("mesh.subdivide", "smoothness", 1.0, text="Subdivide Smooth")
layout.itemS()
@@ -806,9 +609,9 @@ class VIEW3D_MT_edit_MESH_edges(bpy.types.Menu):
layout.item_enumO("mesh.edge_rotate", "direction", 'CW', text="Rotate Edge CW")
layout.item_enumO("mesh.edge_rotate", "direction", 'CCW', text="Rotate Edge CCW")
-
+
class VIEW3D_MT_edit_MESH_faces(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
+ __space_type__ = "VIEW_3D"
__label__ = "Faces"
def draw(self, context):
@@ -830,7 +633,7 @@ class VIEW3D_MT_edit_MESH_faces(bpy.types.Menu):
layout.itemO("mesh.faces_shade_flat")
class VIEW3D_MT_edit_MESH_normals(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
+ __space_type__ = "VIEW_3D"
__label__ = "Normals"
def draw(self, context):
@@ -843,8 +646,16 @@ class VIEW3D_MT_edit_MESH_normals(bpy.types.Menu):
layout.itemO("mesh.flip_normals")
-class VIEW3D_MT_edit_MESH_showhide(VIEW3D_MT_showhide):
- _operator_name = "mesh"
+class VIEW3D_MT_edit_MESH_showhide(bpy.types.Menu):
+ __space_type__ = "VIEW_3D"
+ __label__ = "Show/Hide"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.itemO("mesh.reveal")
+ layout.itemO("mesh.hide")
+ layout.item_booleanO("mesh.hide", "unselected", True, text="Hide Unselected")
# Edit CURVE
@@ -853,8 +664,8 @@ def draw_CURVE(self, context):
layout = self.layout
settings = context.tool_settings
-
- layout.itemM("VIEW3D_MT_snap")
+
+ layout.itemM("VIEW3D_MT_edit_snap")
layout.itemS()
@@ -863,7 +674,7 @@ def draw_CURVE(self, context):
layout.itemO("curve.separate")
layout.itemO("curve.make_segment")
layout.itemO("curve.cyclic_toggle")
- layout.itemO("curve.delete", text="Delete...")
+ layout.itemO("curve.delete")
layout.itemS()
@@ -880,13 +691,13 @@ def draw_CURVE(self, context):
layout.itemM("VIEW3D_MT_edit_CURVE_showhide")
class VIEW3D_MT_edit_CURVE(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
+ __space_type__ = "VIEW_3D"
__label__ = "Curve"
draw = draw_CURVE
class VIEW3D_MT_edit_CURVE_ctrlpoints(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
+ __space_type__ = "VIEW_3D"
__label__ = "Control Points"
def draw(self, context):
@@ -904,7 +715,7 @@ class VIEW3D_MT_edit_CURVE_ctrlpoints(bpy.types.Menu):
layout.item_menu_enumO("curve.handle_type_set", "type")
class VIEW3D_MT_edit_CURVE_segments(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
+ __space_type__ = "VIEW_3D"
__label__ = "Segments"
def draw(self, context):
@@ -913,19 +724,27 @@ class VIEW3D_MT_edit_CURVE_segments(bpy.types.Menu):
layout.itemO("curve.subdivide")
layout.itemO("curve.switch_direction")
-class VIEW3D_MT_edit_CURVE_showhide(VIEW3D_MT_showhide):
- _operator_name = "curve"
+class VIEW3D_MT_edit_CURVE_showhide(bpy.types.Menu):
+ __space_type__ = "VIEW_3D"
+ __label__ = "Show/Hide"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.itemO("curve.reveal")
+ layout.itemO("curve.hide")
+ layout.item_booleanO("curve.hide", "unselected", True, text="Hide Unselected")
# Edit SURFACE
class VIEW3D_MT_edit_SURFACE(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
+ __space_type__ = "VIEW_3D"
__label__ = "Surface"
draw = draw_CURVE
# Edit TEXT
class VIEW3D_MT_edit_TEXT(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
+ __space_type__ = "VIEW_3D"
__label__ = "Text"
def draw(self, context):
@@ -938,7 +757,7 @@ class VIEW3D_MT_edit_TEXT(bpy.types.Menu):
layout.itemM("VIEW3D_MT_edit_TEXT_chars")
class VIEW3D_MT_edit_TEXT_chars(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
+ __space_type__ = "VIEW_3D"
__label__ = "Special Characters"
def draw(self, context):
@@ -973,7 +792,7 @@ class VIEW3D_MT_edit_TEXT_chars(bpy.types.Menu):
# Edit META
class VIEW3D_MT_edit_META(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
+ __space_type__ = "VIEW_3D"
__label__ = "Metaball"
def draw(self, context):
@@ -986,11 +805,11 @@ class VIEW3D_MT_edit_META(bpy.types.Menu):
layout.itemS()
- layout.itemM("VIEW3D_MT_snap")
+ layout.itemM("VIEW3D_MT_edit_snap")
layout.itemS()
- layout.itemO("mball.delete_metaelems", text="Delete...")
+ layout.itemO("mball.delete_metaelems")
layout.itemO("mball.duplicate_metaelems")
layout.itemS()
@@ -1003,19 +822,19 @@ class VIEW3D_MT_edit_META(bpy.types.Menu):
layout.itemM("VIEW3D_MT_edit_META_showhide")
class VIEW3D_MT_edit_META_showhide(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
+ __space_type__ = "VIEW_3D"
__label__ = "Show/Hide"
def draw(self, context):
layout = self.layout
- layout.itemO("mball.reveal_metaelems", text="Show Hidden")
- layout.itemO("mball.hide_metaelems", text="Hide Selected")
+ layout.itemO("mball.reveal_metaelems")
+ layout.itemO("mball.hide_metaelems")
layout.item_booleanO("mball.hide_metaelems", "unselected", True, text="Hide Unselected")
# Edit LATTICE
class VIEW3D_MT_edit_LATTICE(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
+ __space_type__ = "VIEW_3D"
__label__ = "Lattice"
def draw(self, context):
@@ -1023,7 +842,7 @@ class VIEW3D_MT_edit_LATTICE(bpy.types.Menu):
settings = context.tool_settings
- layout.itemM("VIEW3D_MT_snap")
+ layout.itemM("VIEW3D_MT_edit_snap")
layout.itemS()
@@ -1036,7 +855,7 @@ class VIEW3D_MT_edit_LATTICE(bpy.types.Menu):
# Edit ARMATURE
class VIEW3D_MT_edit_ARMATURE(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
+ __space_type__ = "VIEW_3D"
__label__ = "Armature"
def draw(self, context):
@@ -1045,7 +864,7 @@ class VIEW3D_MT_edit_ARMATURE(bpy.types.Menu):
edit_object = context.edit_object
arm = edit_object.data
- layout.itemM("VIEW3D_MT_snap")
+ layout.itemM("VIEW3D_MT_edit_snap")
layout.itemM("VIEW3D_MT_edit_ARMATURE_roll")
if arm.drawtype == 'ENVELOPE':
@@ -1068,19 +887,18 @@ class VIEW3D_MT_edit_ARMATURE(bpy.types.Menu):
layout.itemS()
- layout.itemO("armature.subdivide_multi", text="Subdivide")
+ layout.itemO("armature.subdivide_simple")
+ layout.itemO("armature.subdivide_multi")
layout.itemS()
-
- layout.operator_context = "EXEC_AREA"
- layout.item_enumO("armature.autoside_names", "type", 'XAXIS', text="AutoName Left/Right")
- layout.item_enumO("armature.autoside_names", "type", 'YAXIS', text="AutoName Front/Back")
- layout.item_enumO("armature.autoside_names", "type", 'ZAXIS', text="AutoName Top/Bottom")
+
+ layout.item_enumO("armature.autoside_names", "axis", 'XAXIS', text="AutoName Left/Right")
+ layout.item_enumO("armature.autoside_names", "axis", 'YAXIS', text="AutoName Front/Back")
+ layout.item_enumO("armature.autoside_names", "axis", 'ZAXIS', text="AutoName Top/Bottom")
layout.itemO("armature.flip_names")
layout.itemS()
-
- layout.operator_context = "INVOKE_DEFAULT"
+
layout.itemO("armature.armature_layers")
layout.itemO("armature.bone_layers")
@@ -1089,21 +907,21 @@ class VIEW3D_MT_edit_ARMATURE(bpy.types.Menu):
layout.itemM("VIEW3D_MT_edit_ARMATURE_parent")
layout.itemS()
-
+
layout.item_menu_enumO("armature.flags_set", "mode", text="Bone Settings")
class VIEW3D_MT_edit_ARMATURE_parent(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
+ __space_type__ = "VIEW_3D"
__label__ = "Parent"
def draw(self, context):
layout = self.layout
- layout.itemO("armature.parent_set", text="Make")
- layout.itemO("armature.parent_clear", text="Clear")
+ layout.itemO("armature.parent_set")
+ layout.itemO("armature.parent_clear")
class VIEW3D_MT_edit_ARMATURE_roll(bpy.types.Menu):
- __space_type__ = 'VIEW_3D'
+ __space_type__ = "VIEW_3D"
__label__ = "Bone Roll"
def draw(self, context):
@@ -1119,8 +937,8 @@ class VIEW3D_MT_edit_ARMATURE_roll(bpy.types.Menu):
# ********** Panel **********
class VIEW3D_PT_3dview_properties(bpy.types.Panel):
- __space_type__ = 'VIEW_3D'
- __region_type__ = 'UI'
+ __space_type__ = "VIEW_3D"
+ __region_type__ = "UI"
__label__ = "View"
def poll(self, context):
@@ -1151,8 +969,8 @@ class VIEW3D_PT_3dview_properties(bpy.types.Panel):
layout.column().itemR(scene, "cursor_location", text="3D Cursor:")
class VIEW3D_PT_3dview_display(bpy.types.Panel):
- __space_type__ = 'VIEW_3D'
- __region_type__ = 'UI'
+ __space_type__ = "VIEW_3D"
+ __region_type__ = "UI"
__label__ = "Display"
def poll(self, context):
@@ -1181,67 +999,10 @@ class VIEW3D_PT_3dview_display(bpy.types.Panel):
col.itemR(view, "lock_rotation")
col.itemR(view, "box_preview")
col.itemR(view, "box_clip")
-
-class VIEW3D_PT_3dview_meshdisplay(bpy.types.Panel):
- __space_type__ = 'VIEW_3D'
- __region_type__ = 'UI'
- __label__ = "Mesh Display"
-
- def poll(self, context):
- editmesh = context.mode == 'EDIT_MESH'
- return (editmesh)
-
- def draw(self, context):
- layout = self.layout
-
- mesh = context.active_object.data
-
- col = layout.column()
- col.itemL(text="Overlays:")
- col.itemR(mesh, "draw_edges", text="Edges")
- col.itemR(mesh, "draw_faces", text="Faces")
- col.itemR(mesh, "draw_creases", text="Creases")
- col.itemR(mesh, "draw_bevel_weights", text="Bevel Weights")
- col.itemR(mesh, "draw_seams", text="Seams")
- col.itemR(mesh, "draw_sharp", text="Sharp")
-
- col.itemS()
- col.itemL(text="Normals:")
- col.itemR(mesh, "draw_normals", text="Face")
- col.itemR(mesh, "draw_vertex_normals", text="Vertex")
- col.itemR(context.scene.tool_settings, "normal_size", text="Normal Size")
-
- col.itemS()
- col.itemL(text="Numerics:")
- col.itemR(mesh, "draw_edge_lenght")
- col.itemR(mesh, "draw_edge_angle")
- col.itemR(mesh, "draw_face_area")
-
-
-class VIEW3D_PT_3dview_curvedisplay(bpy.types.Panel):
- __space_type__ = 'VIEW_3D'
- __region_type__ = 'UI'
- __label__ = "Curve Display"
-
- def poll(self, context):
- editmesh = context.mode == 'EDIT_CURVE'
- return (editmesh)
-
- def draw(self, context):
- layout = self.layout
-
- curve = context.active_object.data
-
- col = layout.column()
- col.itemL(text="Overlays:")
- col.itemR(curve, "draw_handles", text="Handles")
- col.itemR(curve, "draw_normals", text="Normals")
- col.itemR(context.scene.tool_settings, "normal_size", text="Normal Size")
-
class VIEW3D_PT_background_image(bpy.types.Panel):
- __space_type__ = 'VIEW_3D'
- __region_type__ = 'UI'
+ __space_type__ = "VIEW_3D"
+ __region_type__ = "UI"
__label__ = "Background Image"
__default_closed__ = True
@@ -1273,15 +1034,13 @@ class VIEW3D_PT_background_image(bpy.types.Panel):
col.itemL(text="Offset:")
col = layout.column(align=True)
- col.itemR(bg, "offset_x", text="X")
- col.itemR(bg, "offset_y", text="Y")
+ col.itemR(bg, "x_offset", text="X")
+ col.itemR(bg, "y_offset", text="Y")
bpy.types.register(VIEW3D_HT_header) # Header
bpy.types.register(VIEW3D_MT_view) #View Menus
bpy.types.register(VIEW3D_MT_view_navigation)
-bpy.types.register(VIEW3D_MT_view_align)
-bpy.types.register(VIEW3D_MT_view_cameras)
bpy.types.register(VIEW3D_MT_select_OBJECT) # Select Menus
bpy.types.register(VIEW3D_MT_select_POSE)
@@ -1294,31 +1053,18 @@ bpy.types.register(VIEW3D_MT_select_EDIT_LATTICE)
bpy.types.register(VIEW3D_MT_select_EDIT_ARMATURE)
bpy.types.register(VIEW3D_MT_select_FACE) # XXX todo
-bpy.types.register(VIEW3D_MT_OBJECT) # Object Menu
-bpy.types.register(VIEW3D_MT_OBJECT_clear)
-bpy.types.register(VIEW3D_MT_OBJECT_parent)
-bpy.types.register(VIEW3D_MT_OBJECT_track)
-bpy.types.register(VIEW3D_MT_OBJECT_group)
-bpy.types.register(VIEW3D_MT_OBJECT_constraints)
-bpy.types.register(VIEW3D_MT_OBJECT_showhide)
-
-bpy.types.register(VIEW3D_MT_SCULPT) # Sculpt Menu
-
-bpy.types.register(VIEW3D_MT_PAINT_VERTEX)
-
-bpy.types.register(VIEW3D_MT_PARTICLE) # Particle Menu
-bpy.types.register(VIEW3D_MT_PARTICLE_showhide)
+bpy.types.register(VIEW3D_MT_object) # Object Menu
+bpy.types.register(VIEW3D_MT_object_clear)
+bpy.types.register(VIEW3D_MT_object_snap)
+bpy.types.register(VIEW3D_MT_object_parent)
+bpy.types.register(VIEW3D_MT_object_track)
+bpy.types.register(VIEW3D_MT_object_group)
+bpy.types.register(VIEW3D_MT_object_constraints)
+bpy.types.register(VIEW3D_MT_object_show)
-bpy.types.register(VIEW3D_MT_POSE) # POSE Menu
-bpy.types.register(VIEW3D_MT_POSE_transform)
-bpy.types.register(VIEW3D_MT_POSE_pose)
-bpy.types.register(VIEW3D_MT_POSE_motion)
-bpy.types.register(VIEW3D_MT_POSE_group)
-bpy.types.register(VIEW3D_MT_POSE_ik)
-bpy.types.register(VIEW3D_MT_POSE_constraints)
-bpy.types.register(VIEW3D_MT_POSE_showhide)
+bpy.types.register(VIEW3D_MT_sculpt) # Sculpt Menu
-bpy.types.register(VIEW3D_MT_snap) # Edit Menus
+bpy.types.register(VIEW3D_MT_edit_snap) # Edit Menus
bpy.types.register(VIEW3D_MT_edit_MESH)
bpy.types.register(VIEW3D_MT_edit_MESH_vertices)
@@ -1348,6 +1094,4 @@ bpy.types.register(VIEW3D_MT_edit_ARMATURE_roll)
bpy.types.register(VIEW3D_PT_3dview_properties) # Panels
bpy.types.register(VIEW3D_PT_3dview_display)
-bpy.types.register(VIEW3D_PT_3dview_meshdisplay)
-bpy.types.register(VIEW3D_PT_3dview_curvedisplay)
bpy.types.register(VIEW3D_PT_background_image)
diff --git a/release/ui/space_view3d_toolbar.py b/release/ui/space_view3d_toolbar.py
index 73f97dec750..1b4c1e25c34 100644
--- a/release/ui/space_view3d_toolbar.py
+++ b/release/ui/space_view3d_toolbar.py
@@ -2,8 +2,8 @@
import bpy
class View3DPanel(bpy.types.Panel):
- __space_type__ = 'VIEW_3D'
- __region_type__ = 'TOOLS'
+ __space_type__ = "VIEW_3D"
+ __region_type__ = "TOOLS"
# ********** default tools for objectmode ****************
@@ -107,7 +107,6 @@ class VIEW3D_PT_tools_curveedit(View3DPanel):
col.itemO("curve.delete")
col.itemO("curve.cyclic_toggle")
col.itemO("curve.switch_direction")
- col.itemO("curve.spline_type_set")
layout.itemL(text="Modeling:")
@@ -263,8 +262,8 @@ class VIEW3D_PT_tools_posemode(View3DPanel):
# ********** default tools for paint modes ****************
class PaintPanel(bpy.types.Panel):
- __space_type__ = 'VIEW_3D'
- __region_type__ = 'TOOLS'
+ __space_type__ = "VIEW_3D"
+ __region_type__ = "TOOLS"
def paint_settings(self, context):
ts = context.tool_settings
@@ -334,15 +333,18 @@ class VIEW3D_PT_tools_brush(PaintPanel):
row = col.row(align=True)
row.itemR(brush, "size", slider=True)
- row.itemR(brush, "size_pressure", toggle=True, text="")
+ row.itemR(brush, "size_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
if brush.sculpt_tool != 'GRAB':
row = col.row(align=True)
row.itemR(brush, "strength", slider=True)
- row.itemR(brush, "strength_pressure", text="")
+ row.itemR(brush, "strength_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
col = layout.column()
+ if brush.sculpt_tool != 'LAYER':
+ col.itemR(brush, "anchored")
+
if brush.sculpt_tool in ('DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'):
col.itemR(brush, "flip_direction")
@@ -350,6 +352,8 @@ class VIEW3D_PT_tools_brush(PaintPanel):
col.itemR(brush, "persistent")
col.itemO("sculpt.set_persistent_base")
+ col.itemR(brush, "rake")
+
col.itemR(brush, "sculpt_tool")
# Texture Paint Mode #
@@ -358,21 +362,38 @@ class VIEW3D_PT_tools_brush(PaintPanel):
col = layout.column(align=True)
col.item_enumR(settings, "tool", 'DRAW')
col.item_enumR(settings, "tool", 'SOFTEN')
- col.item_enumR(settings, "tool", 'CLONE')
- col.item_enumR(settings, "tool", 'SMEAR')
+ if settings.use_projection:
+ col.item_enumR(settings, "tool", 'CLONE')
+ else:
+ col.item_enumR(settings, "tool", 'SMEAR')
col = layout.column()
col.itemR(brush, "color", text="")
-
+
row = col.row(align=True)
row.itemR(brush, "size", slider=True)
- row.itemR(brush, "size_pressure", toggle=True, text="")
+ row.itemR(brush, "size_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
row = col.row(align=True)
row.itemR(brush, "strength", slider=True)
- row.itemR(brush, "strength_pressure", toggle=True, text="")
+ row.itemR(brush, "strength_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
+
+ row = col.row(align=True)
+ row.itemR(brush, "falloff", slider=True)
+ row.itemR(brush, "falloff_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
- col.itemR(brush, "blend")
+ row = col.row(align=True)
+ row.itemR(brush, "space", text="")
+ rowsub = row.row(align=True)
+ rowsub.active = brush.space
+ rowsub.itemR(brush, "spacing", text="Spacing", slider=True)
+ rowsub.itemR(brush, "spacing_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
+
+ col = layout.column()
+ col.itemR(brush, "airbrush")
+ sub = col.column()
+ sub.active = brush.airbrush
+ sub.itemR(brush, "rate")
# Weight Paint Mode #
@@ -382,11 +403,11 @@ class VIEW3D_PT_tools_brush(PaintPanel):
col = layout.column()
row = col.row(align=True)
row.itemR(brush, "size", slider=True)
- row.itemR(brush, "size_pressure", toggle=True, text="")
+ row.itemR(brush, "size_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
row = col.row(align=True)
row.itemR(brush, "strength", slider=True)
- row.itemR(brush, "strength_pressure", toggle=True, text="")
+ row.itemR(brush, "strength_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
# Vertex Paint Mode #
@@ -396,11 +417,11 @@ class VIEW3D_PT_tools_brush(PaintPanel):
row = col.row(align=True)
row.itemR(brush, "size", slider=True)
- row.itemR(brush, "size_pressure", toggle=True, text="")
+ row.itemR(brush, "size_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
row = col.row(align=True)
row.itemR(brush, "strength", slider=True)
- row.itemR(brush, "strength_pressure", toggle=True, text="")
+ row.itemR(brush, "strength_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
class VIEW3D_PT_tools_brush_stroke(PaintPanel):
__label__ = "Stroke"
@@ -408,41 +429,24 @@ class VIEW3D_PT_tools_brush_stroke(PaintPanel):
def poll(self, context):
settings = self.paint_settings(context)
- return (settings and settings.brush and (context.sculpt_object or
- context.vertex_paint_object or
- context.weight_paint_object or
- context.texture_paint_object))
+ return (settings and settings.brush and context.sculpt_object)
def draw(self, context):
- layout = self.layout
-
settings = self.paint_settings(context)
brush = settings.brush
- texture_paint = context.texture_paint_object
-
- if context.sculpt_object:
- if brush.sculpt_tool != 'LAYER':
- layout.itemR(brush, "anchored")
- layout.itemR(brush, "rake")
+ layout = self.layout
- layout.itemR(brush, "airbrush")
+ layout.itemR(brush, "smooth_stroke")
col = layout.column()
- col.active = brush.airbrush
- col.itemR(brush, "rate", slider=True)
-
- if not texture_paint:
- layout.itemR(brush, "smooth_stroke")
- col = layout.column()
- col.active = brush.smooth_stroke
- col.itemR(brush, "smooth_stroke_radius", text="Radius", slider=True)
- col.itemR(brush, "smooth_stroke_factor", text="Factor", slider=True)
+ col.active = brush.smooth_stroke
+ col.itemR(brush, "smooth_stroke_radius", text="Radius", slider=True)
+ col.itemR(brush, "smooth_stroke_factor", text="Factor", slider=True)
layout.itemR(brush, "space")
- row = layout.row(align=True)
- row.active = brush.space
- row.itemR(brush, "spacing", text="Distance", slider=True)
- if texture_paint:
- row.itemR(brush, "spacing_pressure", toggle=True, text="")
+ col = layout.column()
+ col.active = brush.space
+ col.itemR(brush, "spacing", text="Distance", slider=True)
+
class VIEW3D_PT_tools_brush_curve(PaintPanel):
__label__ = "Curve"
@@ -453,10 +457,9 @@ class VIEW3D_PT_tools_brush_curve(PaintPanel):
return (settings and settings.brush and settings.brush.curve)
def draw(self, context):
- layout = self.layout
-
settings = self.paint_settings(context)
brush = settings.brush
+ layout = self.layout
layout.template_curve_mapping(brush.curve)
layout.item_menu_enumO("brush.curve_preset", property="shape")
@@ -469,7 +472,6 @@ class VIEW3D_PT_sculpt_options(PaintPanel):
def draw(self, context):
layout = self.layout
-
sculpt = context.tool_settings.sculpt
col = layout.column()
@@ -498,7 +500,6 @@ class VIEW3D_PT_tools_weightpaint(View3DPanel):
def draw(self, context):
layout = self.layout
-
wpaint = context.tool_settings.weight_paint
col = layout.column()
@@ -526,7 +527,6 @@ class VIEW3D_PT_tools_vertexpaint(View3DPanel):
def draw(self, context):
layout = self.layout
-
vpaint = context.tool_settings.vertex_paint
col = layout.column()
@@ -545,17 +545,9 @@ class VIEW3D_PT_tools_vertexpaint(View3DPanel):
# ********** default tools for texturepaint ****************
-class VIEW3D_PT_tools_projectpaint(View3DPanel):
- __context__ = "projectpaint"
- __label__ = "Project Paint"
-
- def poll(self, context):
- return context.tool_settings.image_paint.tool != 'SMEAR'
-
- def draw_header(self, context):
- layout = self.layout
- ipaint = context.tool_settings.image_paint
- layout.itemR(ipaint, "use_projection", text="")
+class VIEW3D_PT_tools_texturepaint(View3DPanel):
+ __context__ = "texturepaint"
+ __label__ = "Options"
def draw(self, context):
layout = self.layout
@@ -565,6 +557,7 @@ class VIEW3D_PT_tools_projectpaint(View3DPanel):
use_projection= ipaint.use_projection
col = layout.column()
+ col.itemR(ipaint, "use_projection")
sub = col.column()
sub.active = use_projection
sub.itemR(ipaint, "use_occlude")
@@ -579,7 +572,8 @@ class VIEW3D_PT_tools_projectpaint(View3DPanel):
col = split.column()
col.active = (ipaint.use_normal_falloff and use_projection)
col.itemR(ipaint, "normal_angle", text="")
-
+
+
split = layout.split(percentage=0.7)
col = split.column(align=False)
@@ -589,7 +583,8 @@ class VIEW3D_PT_tools_projectpaint(View3DPanel):
col = split.column(align=False)
col.active = (use_projection and ipaint.use_stencil_layer)
col.itemR(ipaint, "invert_stencil", text="Inv")
-
+
+
col = layout.column()
sub = col.column()
sub.active = (settings.tool == 'CLONE')
@@ -606,60 +601,23 @@ class VIEW3D_PT_tools_particlemode(View3DPanel):
def draw(self, context):
layout = self.layout
-
pe = context.tool_settings.particle_edit
- ob = pe.object
- row = layout.row()
- row.itemL(text="Edit:")
- row.itemR(pe, "type", text="")
-
- if pe.type == 'PARTICLES':
- if ob.particle_systems:
- if len(ob.particle_systems) > 1:
- layout.template_list(ob, "particle_systems", ob, "active_particle_system_index", type='ICONS')
-
- ptcache = ob.particle_systems[ob.active_particle_system_index].point_cache
- else:
- for md in ob.modifiers:
- if md.type==pe.type:
- ptcache = md.point_cache
-
- if ptcache and len(ptcache.point_cache_list) > 1:
- layout.template_list(ptcache, "point_cache_list", ptcache, "active_point_cache_index", type='ICONS')
-
-
- if not pe.editable:
- layout.itemL(text="Point cache must be baked")
- layout.itemL(text="to enable editing!")
-
col = layout.column(align=True)
- if pe.hair:
- col.active = pe.editable
- col.itemR(pe, "emitter_deflect", text="Deflect emitter")
- sub = col.row()
- sub.active = pe.emitter_deflect
- sub.itemR(pe, "emitter_distance", text="Distance")
+ col.itemR(pe, "emitter_deflect", text="Deflect")
+ sub = col.row()
+ sub.active = pe.emitter_deflect
+ sub.itemR(pe, "emitter_distance", text="Distance")
col = layout.column(align=True)
- col.active = pe.editable
col.itemL(text="Keep:")
col.itemR(pe, "keep_lengths", text="Lenghts")
col.itemR(pe, "keep_root", text="Root")
- if not pe.hair:
- col.itemL(text="Correct:")
- col.itemR(pe, "auto_velocity", text="Velocity")
col = layout.column(align=True)
- col.active = pe.editable
- col.itemL(text="Draw:")
- col.itemR(pe, "draw_step", text="Path Steps")
- if pe.type == 'PARTICLES':
- col.itemR(pe, "draw_particles", text="Particles")
- col.itemR(pe, "fade_time")
- sub = col.row()
- sub.active = pe.fade_time
- sub.itemR(pe, "fade_frames", slider=True)
+ col.itemL(text="Display:")
+ col.itemR(pe, "show_time", text="Time")
+ col.itemR(pe, "show_children", text="Children")
bpy.types.register(VIEW3D_PT_tools_objectmode)
bpy.types.register(VIEW3D_PT_tools_meshedit)
@@ -676,5 +634,5 @@ bpy.types.register(VIEW3D_PT_tools_brush_curve)
bpy.types.register(VIEW3D_PT_sculpt_options)
bpy.types.register(VIEW3D_PT_tools_vertexpaint)
bpy.types.register(VIEW3D_PT_tools_weightpaint)
-bpy.types.register(VIEW3D_PT_tools_projectpaint)
+bpy.types.register(VIEW3D_PT_tools_texturepaint)
bpy.types.register(VIEW3D_PT_tools_particlemode)
diff --git a/release/windows/inno/blender.iss b/release/windows/inno/blender.iss
deleted file mode 100644
index 5faf5b47406..00000000000
--- a/release/windows/inno/blender.iss
+++ /dev/null
@@ -1,92 +0,0 @@
-; Script generated by the Inno Setup Script Wizard.
-; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
-
-
-[Setup]
-#define VERSION "2.49b"
-
-; NOTE: The value of AppId uniquely identifies this application.
-; Do not use the same AppId value in installers for other applications.
-; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
-AppId={{C45CB76D-AD5F-49CC-86DE-72B168A6A888}
-AppName=Blender
-AppVerName=Blender {#VERSION}
-AppPublisher=Blender Foundation
-AppPublisherURL=http://www.blender.org
-AppSupportURL=http://www.blender.org
-AppUpdatesURL=http://www.blender.org
-DefaultDirName={pf}\Blender
-DefaultGroupName=Blender Foundation
-AllowNoIcons=true
-LicenseFile=.\copyright.txt
-OutputBaseFilename=blender-{#VERSION}
-Compression=lzma
-SolidCompression=true
-ChangesAssociations=true
-WizardImageFile=.\installer.bmp
-WizardSmallImageFile=.\header.bmp
-SetupIconFile=.\installer.ico
-MinVersion=,5.01.2600sp1
-PrivilegesRequired=none
-AllowRootDirectory=true
-ShowLanguageDialog=auto
-
-[Dirs]
-Name: {userdocs}\Blender; Flags: uninsneveruninstall; Tasks: ; Languages:
-
-[Languages]
-Name: english; MessagesFile: compiler:Default.isl
-
-[Tasks]
-Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked
-Name: quicklaunchicon; Description: {cm:CreateQuickLaunchIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked
-
-[Files]
-Source: ..\..\..\..\build\bin\release\blender.exe; DestDir: {app}; Flags: ignoreversion
-Source: ..\..\..\..\build\bin\release\blender.html; DestDir: {app}; Flags: ignoreversion
-Source: ..\..\..\..\build\bin\release\BlenderQuickStart.pdf; DestDir: {app}; Flags: ignoreversion
-Source: ..\..\..\..\build\bin\release\copyright.txt; DestDir: {app}; Flags: ignoreversion
-Source: ..\..\..\..\build\bin\release\GPL-license.txt; DestDir: {app}; Flags: ignoreversion
-Source: ..\..\..\..\build\bin\release\Python-license.txt; DestDir: {app}; Flags: ignoreversion
-Source: ..\..\..\..\build\bin\release\release_249.txt; DestDir: {app}; Flags: ignoreversion
-Source: ..\..\..\..\build\bin\release\*.dll; DestDir: {app}; Flags: ignoreversion
-Source: ..\..\..\..\build\bin\release\plugins\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs
-Source: ..\..\..\..\build\bin\release\.blender\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs
-; NOTE: Don't use "Flags: ignoreversion" on any shared system files
-
-[Icons]
-Name: {group}\Blender; Filename: {app}\blender.exe
-Name: {group}\ReleaseNotes; Filename: {app}\release_249.txt
-Name: {group}\Blender.org; Filename: {app}\blender.html
-Name: {group}\Copyright; Filename: {app}\copyright.txt
-Name: {group}\GPL; Filename: {app}\GPL-license.txt
-Name: {group}\Uninstall; Filename: {uninstallexe}; Tasks: ; Languages:
-Name: {commondesktop}\Blender; Filename: {app}\blender.exe; Tasks: desktopicon
-Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\Blender; Filename: {app}\blender.exe; Tasks: quicklaunchicon
-
-[Registry]
-Root: HKCR; Subkey: .blend; ValueType: string; ValueName: ; ValueData: BlenderFile; Flags: uninsdeletevalue
-Root: HKCR; Subkey: BlenderFile; ValueType: string; ValueName: ; ValueData: Blender File; Flags: uninsdeletekey
-Root: HKCR; Subkey: BlenderFile\DefaultIcon; ValueType: string; ValueName: ; ValueData: {app}\blender.exe,0
-Root: HKCR; Subkey: BlenderFile\shell\open\command; ValueType: string; ValueName: ; ValueData: """{app}\blender.exe"" ""%1"""
-
-[Run]
-Filename: {app}\blender.exe; Description: {cm:LaunchProgram,Blender}; Flags: nowait postinstall skipifsilent
-
-
-[_ISToolDownload]
-
-[UninstallDelete]
-Name: {app}\blender.exe; Type: files
-Name: {app}\*.dll; Type: files
-Name: {app}\blender.html; Type: files; Tasks: ; Languages:
-Name: {app}\BlenderQuickStart.pdf; Type: files
-Name: {app}\copyright.txt; Type: files
-Name: {app}\GPL-license.txt; Type: files
-Name: {app}\Python-license.txt; Type: files
-Name: {app}\release_249.txt; Type: files
-Name: {app}\.blender\*; Type: filesandordirs
-Name: {app}\plugins\*; Type: filesandordirs
-Name: {app}\.blender; Type: dirifempty
-Name: {app}\plugins; Type: dirifempty
-Name: {app}; Type: dirifempty
diff --git a/release/windows/inno/copyright.txt b/release/windows/inno/copyright.txt
deleted file mode 100644
index 4e67c2561d3..00000000000
--- a/release/windows/inno/copyright.txt
+++ /dev/null
@@ -1,56 +0,0 @@
-BLENDER CREATOR LICENSE AGREEMENT
-
-IMPORTANT: PLEASE READ CAREFULLY BEFORE USING THE BLENDER CREATOR SOFTWARE.
-
-This License Agreement for the Blender Creator software ("License Agreement") is an agreement between NaN Technologies B.V., Meerenakkerplein 11, 5652 BJ Eindhoven, the Netherlands ("NaN") and you (either an individual or a legal entity) ("You") with respect to the software product which this License Agreement accompanies (the "Software").
-
-By installing, copying or otherwise using the Software, You agree to be bound by the terms of this License Agreement. If You do not agree to the terms of this License Agreement do not install or use the Software.
-
-
-1. Grant of License
-
-Subject to the provisions of this License Agreement, NaN grants You a limited, non-exclusive, personal, non-sublicenseable, non-transferable, revocable license to use the Software at any computer You own or use.
-
-2. License Restrictions
-
-Except as expressly provided under this License Agreement, or without prior written consent from NaN, or without permission by law, You may not: (a) remove or alter any proprietary, copyright or trademark notices in or on the Software; (b) modify, decompile, disassemble or reverse-engineer the Software; (c) sublicense, rent, lease, lend, assign or otherwise transfer rights to the Software.
-
-3. Permitted copying and electronic distribution of Software
-
-You are hereby granted permission to copy and distribute the Software without written agreement from NaN, only for non-commercial purposes. Distributing the Software within a restricted non-public environment, such as using a local network in a company or a local network of a university, is considered a 'non-commercial purpose'. This entire License Agreement must appear in and/or accompany all copies of the Software.
-Distributing the Software 'bundled' in with ANY product is considered to be a 'commercial purpose'.
-
-4. Intellectual Property Rights and Ownership
-
-Title and ownership to all rights, including intellectual property rights, in and to the Software shall at all times solely and exclusively remain with NaN. The Software is protected by national and international (copyright) laws and treaties. All rights not expressly granted herein are reserved to NaN.
-
-5. Disclaimer of Warranties
-
-NaN provides you with the Software "as is" and with all faults. NaN explicitly disclaims all warranties and guarantees and does not make any representations with respect to the Software, whether express, implied, or statutory, including, but not limited to any (if any) warranties of or related to: fitness for a particular purpose, title, non-infringement, lack of viruses, accuracy or completeness of responses, results, lack of negligence or lack of workmanlike effort, and correspondence to description. The entire risk arising out of use or performance of the Software remains with You.
-
-6. Limitation of Liability
-
-In no event shall NaN or its employees, agents or suppliers be liable for any direct, indirect, consequential, incidental, special, punitive, or other damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, claims of third parties, damages as a result of injury to any person, or any other loss) arising out of or in connection with the license granted under this License Agreement or the use of or inability to use the Software, even if NaN has been advised of the possibility of such damages.
-
-7. User warning and indemnification
-
-WARNING: use of the Software and use of any works that are (partially) created with the Software (the "Works") may cause physical or psychological reactions from You or from third parties, which may result in damages, injuries, losses and/or other negative consequences. You acknowledge that NaN can not be held liable for any such damages, injuries, losses and/or other negative consequences. You acknowledge that it is your obligation to investigate, prevent and/or minimize such reactions prior to having third parties use the Works.
-
-You shall indemnify and hold harmless NaN from and against all actions, claims, demands, proceedings, losses, damages, costs, charges and expenses, including but not limited to legal fees and expenses, arising out of or in connection with (i) the use of the Software by You and (ii) the use of any Works created with the Software by You or any third parties.
-
-8. Term and Termination
-
-This License Agreement and the license granted hereunder is effective until terminated. This License Agreement shall terminate automatically and forthwith if You fail to comply with the terms of this License Agreement. Upon termination, You shall cease the use of the Software, remove the Software from (the memory of) your computer and destroy all copies of the Software.
-
-9. Entire Agreement
-
-This License Agreement is the entire agreement between NaN and You in respect of the subject matter of the License Agreement. This License Agreement supersedes all prior written or oral agreements, proposals or understandings, and any other communications between NaN and You relating to the subject matter of this License Agreement.
-
-10. Enforceability
-
-If any provision of this License Agreement is held to be unenforceable by a court of competent jurisdiction for any reason, such provision shall be adapted or amended only to the extent necessary to make it enforceable, and the remainder of the License Agreement shall remain in effect.
-
-11. Governing law and disputes
-
-This License Agreement and all disputes arising from it will be governed by the laws of The Netherlands. All disputes arising in connection with this Agreement that cannot be settled amicably shall be brought before the competent court in Amsterdam, the Netherlands, to which jurisdiction NaN and You hereby irrevocably consent.
-
diff --git a/release/windows/inno/header.bmp b/release/windows/inno/header.bmp
deleted file mode 100644
index b631ba73933..00000000000
--- a/release/windows/inno/header.bmp
+++ /dev/null
Binary files differ
diff --git a/release/windows/inno/installer.bmp b/release/windows/inno/installer.bmp
deleted file mode 100644
index 10fb01454a4..00000000000
--- a/release/windows/inno/installer.bmp
+++ /dev/null
Binary files differ
diff --git a/release/windows/inno/installer.ico b/release/windows/inno/installer.ico
deleted file mode 100644
index 922c9d472d9..00000000000
--- a/release/windows/inno/installer.ico
+++ /dev/null
Binary files differ