Merged revision(s) 57768-57827 from trunk/blender into soc-2013-dingto

This commit is contained in:
Thomas Dinges 2013-06-27 16:16:54 +00:00
commit 4a113cab0a
90 changed files with 1042 additions and 633 deletions

@ -1527,7 +1527,7 @@ clean_OSL() {
compile_OSL() {
# To be changed each time we make edits that would modify the compiled result!
osl_magic=9
osl_magic=10
_init_osl
# Clean install if needed!

@ -4,7 +4,7 @@ Intro
.. warning::
Most of this object should only be useful if you actually manipulate i18n stuff from Python.
If you are a regular addon, you should only bother about :const:`contexts` member,
If you are a regular addon, you should only bother about :const:`contexts` member,
and the :func:`register`/:func:`unregister` functions! The :func:`pgettext` family of functions
should only be used in rare, specific cases (like e.g. complex "composited" UI strings...).

@ -8,6 +8,7 @@ Note that they will not block the scripts execution, so the caller can't wait fo
import bpy
def draw(self, context):
self.layout.label("Hello World")

@ -769,6 +769,7 @@ class CyclesWorld_PT_ambient_occlusion(CyclesButtonsPanel, Panel):
row.prop(light, "ao_factor", text="Factor")
row.prop(light, "distance", text="Distance")
class CyclesWorld_PT_mist(CyclesButtonsPanel, Panel):
bl_label = "Mist Pass"
bl_context = "world"
@ -935,7 +936,7 @@ class CyclesMaterial_PT_settings(CyclesButtonsPanel, Panel):
col = split.column(align=True)
col.label()
col.prop(mat, "pass_index")
col = layout.column()
col.prop(cmat, "sample_as_light")
col.prop(cmat, "use_transparent_shadow")
@ -1161,7 +1162,7 @@ class CyclesRender_PT_CurveRendering(CyclesButtonsPanel, Panel):
row = layout.row()
row.prop(ccscene, "use_parents", text="Include parents")
row = layout.row()
row.prop(ccscene, "minimum_width", text="Min Pixels")
row.prop(ccscene, "maximum_width", text="Max Ext.")
@ -1193,7 +1194,7 @@ class CyclesParticle_PT_CurveSettings(CyclesButtonsPanel, Panel):
row = layout.row()
row.prop(cpsys, "root_width", text="Root")
row.prop(cpsys, "tip_width", text="Tip")
row = layout.row()
row.prop(cpsys, "radius_scale", text="Scaling")
row.prop(cpsys, "use_closetip", text="Close tip")

@ -183,7 +183,7 @@ bool ObtainCacheParticleData(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, Par
int mi = clamp(b_psys.settings().material()-1, 0, mesh->used_shaders.size()-1);
int shader = mesh->used_shaders[mi];
int draw_step = background ? b_psys.settings().render_step() : b_psys.settings().draw_step();
int ren_step = (int)pow((float)2.0f,(float)draw_step);
int ren_step = (int)powf(2.0f, (float)draw_step);
int totparts = b_psys.particles.length();
int totchild = background ? b_psys.child_particles.length() : (int)((float)b_psys.child_particles.length() * (float)b_psys.settings().draw_percentage() / 100.0f);
int totcurves = totchild;

@ -607,13 +607,8 @@ public:
cuda_assert(cuParamSetSize(cuPathTrace, offset))
/* launch kernel: todo find optimal size, cache config for fermi */
#ifndef __APPLE__
int xthreads = 16;
int ythreads = 16;
#else
int xthreads = 8;
int ythreads = 8;
#endif
int xblocks = (rtile.w + xthreads - 1)/xthreads;
int yblocks = (rtile.h + ythreads - 1)/ythreads;
@ -676,13 +671,8 @@ public:
cuda_assert(cuParamSetSize(cuFilmConvert, offset))
/* launch kernel: todo find optimal size, cache config for fermi */
#ifndef __APPLE__
int xthreads = 16;
int ythreads = 16;
#else
int xthreads = 8;
int ythreads = 8;
#endif
int xblocks = (task.w + xthreads - 1)/xthreads;
int yblocks = (task.h + ythreads - 1)/ythreads;
@ -730,11 +720,7 @@ public:
cuda_assert(cuParamSetSize(cuDisplace, offset))
/* launch kernel: todo find optimal size, cache config for fermi */
#ifndef __APPLE__
int xthreads = 16;
#else
int xthreads = 8;
#endif
int xblocks = (task.shader_w + xthreads - 1)/xthreads;
cuda_assert(cuFuncSetCacheConfig(cuDisplace, CU_FUNC_CACHE_PREFER_L1))

@ -241,6 +241,9 @@ public:
{
cl_context context = get_something<cl_context>(platform, device, &Slot::context, slot_locker);
if(!context)
return NULL;
/* caller is going to release it when done with it, so retain it */
cl_int ciErr = clRetainContext(context);
assert(ciErr == CL_SUCCESS);
@ -255,6 +258,9 @@ public:
{
cl_program program = get_something<cl_program>(platform, device, &Slot::program, slot_locker);
if(!program)
return NULL;
/* caller is going to release it when done with it, so retain it */
cl_int ciErr = clRetainProgram(program);
assert(ciErr == CL_SUCCESS);

@ -41,6 +41,8 @@ __device float3 bsdf_diffuse_ramp_get_color(const ShaderClosure *sc, const float
float npos = pos * (float)(MAXCOLORS - 1);
int ipos = float_to_int(npos);
if (ipos < 0)
return colors[0];
if (ipos >= (MAXCOLORS - 1))
return colors[MAXCOLORS - 1];
float offset = npos - (float)ipos;

@ -41,6 +41,8 @@ __device float3 bsdf_phong_ramp_get_color(const ShaderClosure *sc, const float3
float npos = pos * (float)(MAXCOLORS - 1);
int ipos = float_to_int(npos);
if (ipos < 0)
return colors[0];
if (ipos >= (MAXCOLORS - 1))
return colors[MAXCOLORS - 1];
float offset = npos - (float)ipos;
@ -49,6 +51,8 @@ __device float3 bsdf_phong_ramp_get_color(const ShaderClosure *sc, const float3
__device int bsdf_phong_ramp_setup(ShaderClosure *sc)
{
sc->data0 = max(sc->data0, 0.0f);
sc->type = CLOSURE_BSDF_PHONG_RAMP_ID;
return SD_BSDF | SD_BSDF_HAS_EVAL | SD_BSDF_GLOSSY;
}

@ -108,7 +108,6 @@
/* data lookup defines */
#define kernel_data (*kg->data)
#define kernel_tex_lookup(t, x, offset, size) kernel_tex_lookup_(kg->t, offset, size, x)
#define kernel_tex_fetch(t, index) kg->t[index]
/* define NULL */

@ -22,6 +22,8 @@
#ifdef WITH_OPTIMIZED_KERNEL
#define __KERNEL_SSE2__
#include "kernel.h"
#include "kernel_compat_cpu.h"
#include "kernel_math.h"

@ -22,6 +22,7 @@
#ifdef WITH_OPTIMIZED_KERNEL
#define __KERNEL_SSE2__
#define __KERNEL_SSE3__
#define __KERNEL_SSSE3__

@ -93,7 +93,7 @@ foreach(_file ${SRC_OSL})
string(REPLACE ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} _OSO_FILE ${_OSO_FILE})
add_custom_command(
OUTPUT ${_OSO_FILE}
COMMAND ${OSL_COMPILER} -O2 -I"${CMAKE_CURRENT_SOURCE_DIR}" ${_OSL_FILE}
COMMAND ${OSL_COMPILER} -q -O2 -I"${CMAKE_CURRENT_SOURCE_DIR}" ${_OSL_FILE}
DEPENDS ${_OSL_FILE} ${SRC_OSL_HEADERS})
list(APPEND SRC_OSO
${_OSO_FILE}

@ -57,7 +57,7 @@ if env['WITH_BF_CYCLES_OSL']:
osl_file = os.path.join(source_dir, f)
oso_file = os.path.join(build_dir, f.replace('.osl', '.oso'))
command = "%s -O2 -I%s -o %s %s" % (osl_compiler, source_dir, oso_file, osl_file)
command = "%s -q -O2 -I%s -o %s %s" % (osl_compiler, source_dir, oso_file, osl_file)
shaders.Command(oso_file, f, command)
shaders.Depends(oso_file, [f] + dependencies)

@ -41,8 +41,8 @@ float brick(point p, float mortar_size, float bias,
rownum = (int)floor(p[1] / row_height);
if (offset_frequency && squash_frequency) {
brick_width *= ((int)(rownum) % squash_frequency) ? 1.0 : squash_amount; /* squash */
offset = ((int)(rownum) % offset_frequency) ? 0 : (brick_width * offset_amount); /* offset */
brick_width *= (rownum % squash_frequency) ? 1.0 : squash_amount; /* squash */
offset = (rownum % offset_frequency) ? 0.0 : (brick_width * offset_amount); /* offset */
}
bricknum = (int)floor((p[0] + offset) / brick_width);

@ -41,8 +41,8 @@ __device_noinline float2 svm_brick(float3 p, float scale, float mortar_size, flo
rownum = floor_to_int(p.y / row_height);
if(offset_frequency && squash_frequency) {
brick_width *= ((int)(rownum) % squash_frequency ) ? 1.0f : squash_amount; /* squash */
offset = ((int)(rownum) % offset_frequency ) ? 0 : (brick_width*offset_amount); /* offset */
brick_width *= (rownum % squash_frequency) ? 1.0f : squash_amount; /* squash */
offset = (rownum % offset_frequency) ? 0.0f : (brick_width*offset_amount); /* offset */
}
bricknum = floor_to_int((p.x+offset) / brick_width);

@ -1166,7 +1166,7 @@ __device float safe_powf(float a, float b)
return 1.0f;
if(a == 0.0f)
return 0.0f;
if(a < 0.0f && b != (int)b)
if(a < 0.0f && b != float_to_int(b))
return 0.0f;
return compatible_powf(a, b);

@ -61,58 +61,49 @@
#ifndef __KERNEL_GPU__
/* not enabled, globally applying it just gives slowdown,
* but useful for testing. */
//#define __KERNEL_SSE__
#ifdef __KERNEL_SSE__
#include <xmmintrin.h> /* SSE 1 */
#include <emmintrin.h> /* SSE 2 */
#include <pmmintrin.h> /* SSE 3 */
#include <tmmintrin.h> /* SSSE 3 */
#include <smmintrin.h> /* SSE 4 */
/* not enabled, globally applying it gives slowdown, only for testing. */
#if 0
#define __KERNEL_SSE__
#ifndef __KERNEL_SSE2__
#define __KERNEL_SSE2__
#endif
#ifndef __KERNEL_SSE3__
#define __KERNEL_SSE3__
#endif
#ifndef __KERNEL_SSSE3__
#define __KERNEL_SSSE3__
#endif
#ifndef __KERNEL_SSE4__
#define __KERNEL_SSE4__
#endif
#endif
#else
/* SSE2 is always available on x86_64 CPUs, so auto enable */
#if defined(__x86_64__) && !defined(__KERNEL_SSE2__)
#define __KERNEL_SSE2__
#endif
#if defined(__x86_64__) || defined(__KERNEL_SSSE3__)
/* SSE intrinsics headers */
#ifndef FREE_WINDOWS64
/* MinGW64 has conflicting declarations for these SSE headers in <windows.h>.
* Since we can't avoid including <windows.h>, better only include that */
#ifdef FREE_WINDOWS64
#include <windows.h>
#else
#ifdef __KERNEL_SSE2__
#include <xmmintrin.h> /* SSE 1 */
#include <emmintrin.h> /* SSE 2 */
#endif
#ifdef __KERNEL_SSE3__
#include <pmmintrin.h> /* SSE 3 */
#endif
#ifdef __KERNEL_SSSE3__
#include <tmmintrin.h> /* SSSE 3 */
#endif
#endif
#ifndef __KERNEL_SSE2__
#define __KERNEL_SSE2__
#endif
#else
#endif
/* MinGW64 has conflicting declarations for these SSE headers in <windows.h>.
* Since we can't avoid including <windows.h>, better only include that */
#include <windows.h>
#endif
@ -552,30 +543,6 @@ template<size_t i0, size_t i1, size_t i2, size_t i3> __device_inline const __m12
}
#endif
#ifndef __KERNEL_GPU__
static inline void *malloc_aligned(size_t size, size_t alignment)
{
void *data = (void*)malloc(size + sizeof(void*) + alignment - 1);
union { void *ptr; size_t offset; } u;
u.ptr = (char*)data + sizeof(void*);
u.offset = (u.offset + alignment - 1) & ~(alignment - 1);
*(((void**)u.ptr) - 1) = data;
return u.ptr;
}
static inline void free_aligned(void *ptr)
{
if(ptr) {
void *data = *(((void**)ptr) - 1);
free(data);
}
}
#endif
CCL_NAMESPACE_END
#endif /* __UTIL_TYPES_H__ */

@ -30,6 +30,26 @@ CCL_NAMESPACE_BEGIN
using std::vector;
static inline void *malloc_aligned(size_t size, size_t alignment)
{
void *data = (void*)malloc(size + sizeof(void*) + alignment - 1);
union { void *ptr; size_t offset; } u;
u.ptr = (char*)data + sizeof(void*);
u.offset = (u.offset + alignment - 1) & ~(alignment - 1);
*(((void**)u.ptr) - 1) = data;
return u.ptr;
}
static inline void free_aligned(void *ptr)
{
if(ptr) {
void *data = *(((void**)ptr) - 1);
free(data);
}
}
/* Array
*
* Simplified version of vector, serving multiple purposes:

@ -549,7 +549,7 @@ int cocoa_request_qtcodec_settings(bContext *C, wmOperator *op)
#pragma mark initialization/finalization
const char *user_locale; // Global current user locale
char GHOST_user_locale[128]; // Global current user locale
GHOST_SystemCocoa::GHOST_SystemCocoa()
{
@ -590,11 +590,13 @@ GHOST_SystemCocoa::GHOST_SystemCocoa()
m_ignoreWindowSizedMessages = false;
//Get current locale
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
CFLocaleRef myCFLocale = CFLocaleCopyCurrent();
NSLocale * myNSLocale = (NSLocale *) myCFLocale;
[myNSLocale autorelease];
NSString *nsIdentifier = [myNSLocale localeIdentifier];
user_locale = [nsIdentifier UTF8String];
strncpy(GHOST_user_locale, [nsIdentifier UTF8String], sizeof(GHOST_user_locale) - 1);
[pool drain];
}
GHOST_SystemCocoa::~GHOST_SystemCocoa()

@ -65,8 +65,8 @@ void bl_locale_set(const char *locale)
}
else {
#ifdef __APPLE__
extern const char *user_locale; // pulled from Ghost_SystemCocoa
std::string locale_osx = user_locale + std::string(".UTF-8");
extern char GHOST_user_locale[128]; // pulled from Ghost_SystemCocoa
std::string locale_osx = GHOST_user_locale + std::string(".UTF-8");
_locale = gen(locale_osx.c_str());
#else
_locale = gen("");

Binary file not shown.

@ -35,6 +35,7 @@ FLAG_MESSAGES = {
FORBIDDEN: "Explicitly forbidden!",
}
def gen_menu_file(stats, settings):
# Generate languages file used by Blender's i18n system.
# First, match all entries in LANGUAGES to a lang in stats, if possible!

@ -507,7 +507,8 @@ def keyconfig_set(filepath, report=None):
report({'ERROR'}, error_msg)
print(error_msg)
kc_new = next(chain(iter(kc for kc in keyconfigs if kc not in keyconfigs_old), (None,)))
kc_new = next(chain(iter(kc for kc in keyconfigs
if kc not in keyconfigs_old), (None,)))
if kc_new is None:
if report is not None:
report({'ERROR'}, "Failed to load keymap %r" % filepath)

@ -110,7 +110,7 @@ def complete_indices(word, namespace, obj=None, base=None):
# dictionary type
matches = ['%s[%r]' % (base, key) for key in sorted(obj.keys())]
else:
# list type,
# list type
matches = ['%s[%d]' % (base, idx) for idx in range(obj_len)]
if word != base:
matches = [match for match in matches if match.startswith(word)]

@ -42,6 +42,7 @@ class NodeCategory():
yield item
self.items = items_gen
class NodeItem():
def __init__(self, nodetype, label=None, settings={}, poll=None):
self.nodetype = nodetype
@ -81,6 +82,7 @@ class NodeItemCustom():
_node_categories = {}
def register_node_categories(identifier, cat_list):
if identifier in _node_categories:
raise KeyError("Node categories list '%s' already registered" % identifier)
@ -97,21 +99,21 @@ def register_node_categories(identifier, cat_list):
menu_types = []
panel_types = []
for cat in cat_list:
menu_type = type("NODE_MT_category_"+cat.identifier, (bpy.types.Menu,), {
"bl_space_type" : 'NODE_EDITOR',
"bl_label" : cat.name,
"category" : cat,
"poll" : cat.poll,
"draw" : draw_node_item,
menu_type = type("NODE_MT_category_" + cat.identifier, (bpy.types.Menu,), {
"bl_space_type": 'NODE_EDITOR',
"bl_label": cat.name,
"category": cat,
"poll": cat.poll,
"draw": draw_node_item,
})
panel_type = type("NODE_PT_category_"+cat.identifier, (bpy.types.Panel,), {
"bl_space_type" : 'NODE_EDITOR',
"bl_region_type" : 'TOOLS',
"bl_label" : cat.name,
"bl_options" : {'DEFAULT_CLOSED'},
"category" : cat,
"poll" : cat.poll,
"draw" : draw_node_item,
panel_type = type("NODE_PT_category_" + cat.identifier, (bpy.types.Panel,), {
"bl_space_type": 'NODE_EDITOR',
"bl_region_type": 'TOOLS',
"bl_label": cat.name,
"bl_options": {'DEFAULT_CLOSED'},
"category": cat,
"poll": cat.poll,
"draw": draw_node_item,
})
menu_types.append(menu_type)
@ -166,4 +168,3 @@ def unregister_node_categories(identifier=None):
for cat_types in _node_categories.values():
unregister_node_cat_types(cat_types)
_node_categories.clear()

@ -261,8 +261,8 @@ class ClearUselessActions(Operator):
for action in bpy.data.actions:
# if only user is "fake" user...
if ((self.only_unused is False) or
(action.use_fake_user and action.users == 1)):
if ((self.only_unused is False) or
(action.use_fake_user and action.users == 1)):
# if it has F-Curves, then it's a "action library"
# (i.e. walk, wave, jump, etc.)

@ -18,9 +18,17 @@
# <pep8-80 compliant>
import bpy, nodeitems_utils
from bpy.types import Operator, PropertyGroup
from bpy.props import BoolProperty, CollectionProperty, EnumProperty, IntProperty, StringProperty
import bpy
import nodeitems_utils
from bpy.types import (Operator,
PropertyGroup,
)
from bpy.props import (BoolProperty,
CollectionProperty,
EnumProperty,
IntProperty,
StringProperty,
)
class NodeSetting(PropertyGroup):
@ -30,6 +38,7 @@ class NodeSetting(PropertyGroup):
default="",
)
# Base class for node 'Add' operators
class NodeAddOperator():
@ -57,8 +66,12 @@ class NodeAddOperator():
# convert mouse position to the View2D for later node placement
if context.region.type == 'WINDOW':
# XXX, why use DPI for coords?
dpi_fac = context.user_preferences.system.dpi / 72.0
space.cursor_location = v2d.region_to_view(event.mouse_region_x,
event.mouse_region_y)
event.mouse_region_y)
space.cursor_location /= dpi_fac
else:
space.cursor_location = tree.view_center
@ -80,12 +93,12 @@ class NodeAddOperator():
for setting in self.settings:
# XXX catch exceptions here?
value = eval(setting.value)
try:
setattr(node, setting.name, value)
except AttributeError as e:
self.report({'ERROR_INVALID_INPUT'}, "Node has no attribute "+setting.name)
print (str(e))
self.report({'ERROR_INVALID_INPUT'}, "Node has no attribute " + setting.name)
print(str(e))
# Continue despite invalid attribute
if space.use_hidden_preview:
@ -198,7 +211,7 @@ class NODE_OT_add_search(NodeAddOperator, Operator):
# no need to keep
self._enum_item_hack.clear()
if item:
# apply settings from the node item
for setting in item.settings.items():

@ -30,7 +30,9 @@ class AddPresetBase():
- preset_subdir """
# bl_idname = "script.preset_base_add"
# bl_label = "Add a Python Preset"
bl_options = {'REGISTER', 'INTERNAL'} # only because invoke_props_popup requires. Also do not add to search menu.
# only because invoke_props_popup requires. Also do not add to search menu.
bl_options = {'REGISTER', 'INTERNAL'}
name = StringProperty(
name="Name",

@ -23,6 +23,7 @@
# Contributor(s): Keith "Wahooney" Boshoff, Campbell Barton
def applyVertexDirt(me, blur_iterations, blur_strength, clamp_dirt, clamp_clean, dirt_only):
from mathutils import Vector
from math import acos

@ -138,7 +138,7 @@ class VIEW3D_OT_select_or_deselect_all(Operator):
x = event.mouse_region_x
y = event.mouse_region_y
if self.extend == False and self.toggle == False and self.deselect == False:
if self.extend is False and self.toggle is False and self.deselect is False:
active_object = context.active_object
if active_object:

@ -1180,6 +1180,7 @@ class WM_OT_keyconfig_activate(Operator):
else:
return {'CANCELLED'}
class WM_OT_appconfig_default(Operator):
bl_idname = "wm.appconfig_default"
bl_label = "Default Application Configuration"
@ -1574,8 +1575,9 @@ class WM_OT_addon_enable(Operator):
def execute(self, context):
import addon_utils
err_str = ""
def err_cb():
import traceback
nonlocal err_str
@ -1618,6 +1620,7 @@ class WM_OT_addon_disable(Operator):
import addon_utils
err_str = ""
def err_cb():
import traceback
nonlocal err_str

@ -120,7 +120,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
def BEVEL(self, layout, ob, md):
split = layout.split()
col = split.column()
col.prop(md, "width")
col.prop(md, "segments")
@ -982,26 +982,26 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
def VERTEX_WEIGHT_EDIT(self, layout, ob, md):
split = layout.split()
col = split.column()
col.label(text="Vertex Group:")
col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
col.label(text="Default Weight:")
col.prop(md, "default_weight", text="")
col = split.column()
col.prop(md, "use_add")
sub = col.column()
sub.active = md.use_add
sub.prop(md, "add_threshold")
col = col.column()
col.prop(md, "use_remove")
sub = col.column()
sub.active = md.use_remove
sub.prop(md, "remove_threshold")
layout.separator()
layout.prop(md, "falloff_type")
@ -1047,20 +1047,20 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
col = split.column()
col.label(text="Target Object:")
col.prop(md, "target", text="")
split = layout.split()
col = split.column()
col.label(text="Distance:")
col.prop(md, "proximity_mode", text="")
if md.proximity_mode == 'GEOMETRY':
col.row().prop(md, "proximity_geometry")
col = split.column()
col.label()
col.prop(md, "min_dist")
col.prop(md, "max_dist")
layout.separator()
layout.prop(md, "falloff_type")
@ -1070,25 +1070,25 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
def SKIN(self, layout, ob, md):
layout.operator("object.skin_armature_create", text="Create Armature")
layout.separator()
col = layout.column(align=True)
col.prop(md, "branch_smoothing")
col.prop(md, "use_smooth_shade")
split = layout.split()
col = split.column()
col.label(text="Selected Vertices:")
sub = col.column(align=True)
sub.operator("object.skin_loose_mark_clear", text="Mark Loose").action = 'MARK'
sub.operator("object.skin_loose_mark_clear", text="Clear Loose").action = 'CLEAR'
sub = col.column()
sub.operator("object.skin_root_mark", text="Mark Root")
sub.operator("object.skin_radii_equalize", text="Equalize Radii")
col = split.column()
col.label(text="Symmetry Axes:")
col.prop(md, "use_x_symmetry")

@ -47,7 +47,7 @@ class RENDER_PT_freestyle(RenderFreestyleButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
rd = context.scene.render
layout.active = rd.use_freestyle
@ -55,7 +55,7 @@ class RENDER_PT_freestyle(RenderFreestyleButtonsPanel, Panel):
row = layout.row()
row.label(text="Line Thickness:")
row.prop(rd, "line_thickness_mode", expand=True)
if (rd.line_thickness_mode == 'ABSOLUTE'):
layout.prop(rd, "line_thickness")
@ -65,7 +65,7 @@ class RENDER_PT_freestyle(RenderFreestyleButtonsPanel, Panel):
# Render layer properties
class RenderLayerFreestyleButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
@ -77,7 +77,7 @@ class RenderLayerFreestyleButtonsPanel():
scene = context.scene
rd = context.scene.render
with_freestyle = bpy.app.build_options.freestyle
return (scene and with_freestyle and rd.use_freestyle
and rd.layers.active and(scene.render.engine in cls.COMPAT_ENGINES))
@ -119,28 +119,28 @@ class RENDERLAYER_PT_freestyle(RenderLayerFreestyleButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
rd = context.scene.render
rl = rd.layers.active
freestyle = rl.freestyle_settings
layout.active = rl.use_freestyle
layout.prop(freestyle, "mode", text="Control mode")
layout.label(text="Edge Detection Options:")
split = layout.split()
col = split.column()
col.prop(freestyle, "crease_angle")
col.prop(freestyle, "use_culling")
col.prop(freestyle, "use_advanced_options")
col = split.column()
col.prop(freestyle, "use_smoothness")
if freestyle.mode == 'SCRIPT':
col.prop(freestyle, "use_material_boundaries")
# Advanced options are hidden by default to warn new users
if freestyle.use_advanced_options:
if freestyle.mode == 'SCRIPT':
@ -184,7 +184,7 @@ class RENDERLAYER_PT_freestyle_lineset(RenderLayerFreestyleEditorButtonsPanel, P
def draw(self, context):
layout = self.layout
rd = context.scene.render
rl = rd.layers.active
freestyle = rl.freestyle_settings
@ -233,14 +233,14 @@ class RENDERLAYER_PT_freestyle_lineset(RenderLayerFreestyleEditorButtonsPanel, P
row.prop(lineset, "edge_type_combination", expand=True)
split = col.split()
sub = split.column()
self.draw_edge_type_buttons(sub, lineset, "silhouette")
self.draw_edge_type_buttons(sub, lineset, "border")
self.draw_edge_type_buttons(sub, lineset, "contour")
self.draw_edge_type_buttons(sub, lineset, "suggestive_contour")
self.draw_edge_type_buttons(sub, lineset, "ridge_valley")
sub = split.column()
self.draw_edge_type_buttons(sub, lineset, "crease")
self.draw_edge_type_buttons(sub, lineset, "edge_mark")
@ -518,7 +518,7 @@ class RENDERLAYER_PT_freestyle_linestyle(RenderLayerFreestyleEditorButtonsPanel,
def draw(self, context):
layout = self.layout
rd = context.scene.render
rl = rd.layers.active
lineset = rl.freestyle_settings.linesets.active

@ -643,7 +643,7 @@ class WORLD_PT_game_physics(WorldButtonsPanel, Panel):
sub.prop(gs, "deactivation_angular_threshold", text="Angular Threshold")
sub = col.row()
sub.prop(gs, "deactivation_time", text="Time")
col = layout.column()
col.prop(gs, "use_occlusion_culling", text="Occlusion Culling")
sub = col.column()

@ -67,10 +67,10 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, Panel):
# odd formatting here so translation script can extract string
layout.operator("fluid.bake", text=iface_("Bake (Req. Memory: %s)") % fluid.memory_estimate,
translate=False, icon='MOD_FLUIDSIM')
if bpy.app.build_options.openmp:
layout.prop(fluid, "threads", text="Simulation Threads")
split = layout.split()
col = split.column()

@ -78,6 +78,7 @@ class RENDER_PT_dimensions(RenderButtonsPanel, Panel):
_frame_rate_args_prev = None
_preset_class = None
@staticmethod
def _draw_framerate_label(*args):
# avoids re-creating text string each draw
@ -85,7 +86,7 @@ class RENDER_PT_dimensions(RenderButtonsPanel, Panel):
return RENDER_PT_dimensions._frame_rate_ret
fps, fps_base, preset_label = args
if fps_base == 1.0:
fps_rate = round(fps)
else:

@ -336,7 +336,8 @@ class CLIP_PT_tools_solve(CLIP_PT_tracking_panel, Panel):
col.prop(settings, "use_keyframe_selection")
col = layout.column(align=True)
col.active = not settings.use_tripod_solver and not settings.use_keyframe_selection
col.active = (not settings.use_tripod_solver and
not settings.use_keyframe_selection)
col.prop(tracking_object, "keyframe_a")
col.prop(tracking_object, "keyframe_b")
@ -408,7 +409,7 @@ class CLIP_PT_tools_orientation(CLIP_PT_reconstruction_panel, Panel):
layout.separator()
col = layout.column()
row = col.row(align=True);
row = col.row(align=True)
row.operator("clip.set_scale")
row.operator("clip.apply_solution_scale", text="Apply Scale")
col.prop(settings, "distance")

@ -756,7 +756,6 @@ class IMAGE_PT_tools_brush_texture(BrushButtonsPanel, Panel):
sub.prop(brush, "use_primary_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
class IMAGE_PT_tools_mask_texture(BrushButtonsPanel, Panel):
bl_label = "Texture Mask"
bl_options = {'DEFAULT_CLOSED'}
@ -783,7 +782,7 @@ class IMAGE_PT_tools_mask_texture(BrushButtonsPanel, Panel):
row.prop(brush, "use_secondary_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF')
else:
row.prop(brush, "use_secondary_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON')
sub = row.row()
sub.prop(brush, "mask_overlay_alpha", text="Alpha")
sub.prop(brush, "use_secondary_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
@ -901,7 +900,7 @@ class IMAGE_PT_tools_brush_appearance(BrushButtonsPanel, Panel):
return
col = layout.column()
col.prop(toolsettings, "show_brush");
col.prop(toolsettings, "show_brush")
col = col.column()
col.prop(brush, "cursor_color_add", text="")

@ -392,7 +392,7 @@ class INFO_MT_help(Menu):
layout = self.layout
layout.operator("wm.url_open", text="Manual", icon='HELP').url = "http://wiki.blender.org/index.php/Doc:2.6/Manual"
layout.operator("wm.url_open", text="Release Log", icon='URL').url = "http://www.blender.org/development/release-logs/blender-267"
layout.operator("wm.url_open", text="Release Log", icon='URL').url = "http://www.blender.org/development/release-logs/blender-268"
layout.separator()
layout.operator("wm.url_open", text="Blender Website", icon='URL').url = "http://www.blender.org"

@ -131,7 +131,7 @@ class NODE_MT_view(Menu):
layout.operator("node.properties", icon='MENU_PANEL')
layout.operator("node.toolbar", icon='MENU_PANEL')
layout.separator()
layout.operator("view2d.zoom_in")

@ -1171,12 +1171,12 @@ class USERPREF_PT_addons(Panel):
continue
# check if addon should be visible with current filters
if ((filter == "All") or
(filter == info["category"]) or
(filter == "Enabled" and is_enabled) or
(filter == "Disabled" and not is_enabled) or
(filter == "User" and (mod.__file__.startswith((scripts_addons_folder, userpref_addons_folder))))
):
if ((filter == "All") or
(filter == info["category"]) or
(filter == "Enabled" and is_enabled) or
(filter == "Disabled" and not is_enabled) or
(filter == "User" and (mod.__file__.startswith((scripts_addons_folder, userpref_addons_folder))))
):
if search and search not in info["name"].lower():
if info["author"]:

@ -238,8 +238,10 @@ class VIEW3D_MT_transform_armature(VIEW3D_MT_transform_base):
layout.separator()
obj = context.object
if (obj.type == 'ARMATURE' and obj.mode in {'EDIT', 'POSE'} and
obj.data.draw_type in {'BBONE', 'ENVELOPE'}):
if (obj.type == 'ARMATURE' and obj.mode in {'EDIT', 'POSE'} and
obj.data.draw_type in {'BBONE', 'ENVELOPE'}
):
layout.operator("transform.transform", text="Scale Envelope/BBone").mode = 'BONE_SIZE'
if context.edit_object and context.edit_object.type == 'ARMATURE':
@ -989,7 +991,7 @@ class VIEW3D_MT_object_specials(Menu):
props.data_path_item = "data.size_y"
props.header_text = "Lamp Size Y: %.3f"
elif lamp.type in {'SPOT', 'POINT', 'SUN'}:
elif lamp.type in {'SPOT', 'POINT', 'SUN'}:
props = layout.operator("wm.context_modal_mouse", text="Size")
props.data_path_iter = "selected_editable_objects"
props.data_path_item = "data.shadow_soft_size"
@ -2218,6 +2220,10 @@ class VIEW3D_MT_edit_font(Menu):
layout.operator("font.style_toggle", text="Toggle Underline").style = 'UNDERLINE'
layout.operator("font.style_toggle", text="Toggle Small Caps").style = 'SMALL_CAPS'
layout.separator()
layout.operator("font.insert_lorem")
class VIEW3D_MT_edit_text_chars(Menu):
bl_label = "Special Characters"

@ -563,7 +563,7 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
row = col.row(align=True)
ups = toolsettings.unified_paint_settings
if ((ups.use_unified_size and ups.use_locked_size) or
if ((ups.use_unified_size and ups.use_locked_size) or
((not ups.use_unified_size) and brush.use_locked_size)):
self.prop_unified_size(row, context, brush, "use_locked_size", icon='LOCKED')
self.prop_unified_size(row, context, brush, "unprojected_radius", slider=True, text="Radius")
@ -681,7 +681,7 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
row.prop(brush, "use_cursor_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF')
else:
row.prop(brush, "use_cursor_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON')
sub = row.row()
sub.prop(brush, "cursor_overlay_alpha", text="Alpha")
sub.prop(brush, "use_cursor_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
@ -714,17 +714,16 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
col = layout.column(align=True)
col.label(text="Overlay:")
row = col.row()
row = col.row()
if brush.use_cursor_overlay:
row.prop(brush, "use_cursor_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF')
else:
row.prop(brush, "use_cursor_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON')
sub = row.row()
sub.prop(brush, "cursor_overlay_alpha", text="Alpha")
sub.prop(brush, "use_cursor_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
# Weight Paint Mode #
elif context.weight_paint_object and brush:
layout.prop(toolsettings, "use_auto_normalize", text="Auto Normalize")
@ -776,7 +775,7 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
row.prop(brush, "use_cursor_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF')
else:
row.prop(brush, "use_cursor_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON')
sub = row.row()
sub.prop(brush, "cursor_overlay_alpha", text="Alpha")
sub.prop(brush, "use_cursor_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
@ -816,7 +815,7 @@ class VIEW3D_PT_tools_brush_texture(Panel, View3DPaintPanel):
row.prop(brush, "use_primary_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF')
else:
row.prop(brush, "use_primary_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON')
sub = row.row()
sub.prop(brush, "texture_overlay_alpha", text="Alpha")
sub.prop(brush, "use_primary_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
@ -843,7 +842,7 @@ class VIEW3D_PT_tools_mask_texture(View3DPanel, Panel):
col.template_ID_preview(brush, "mask_texture", new="texture.new", rows=3, cols=8)
brush_mask_texture_settings(col, brush)
col = layout.column(align=True)
col.active = brush.brush_capabilities.has_overlay
col.label(text="Overlay:")
@ -854,7 +853,7 @@ class VIEW3D_PT_tools_mask_texture(View3DPanel, Panel):
row.prop(brush, "use_secondary_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF')
else:
row.prop(brush, "use_secondary_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON')
sub = row.row()
sub.prop(brush, "mask_overlay_alpha", text="Alpha")
sub.prop(brush, "use_secondary_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
@ -1083,7 +1082,7 @@ class VIEW3D_PT_tools_brush_appearance(Panel, View3DPaintPanel):
return
col = layout.column()
col.prop(settings, "show_brush");
col.prop(settings, "show_brush")
col = col.column()
col.active = settings.show_brush

@ -27,19 +27,22 @@ from nodeitems_utils import NodeCategory, NodeItem, NodeItemCustom
class CompositorNodeCategory(NodeCategory):
@classmethod
def poll(cls, context):
return context.space_data.tree_type == 'CompositorNodeTree'
return (context.space_data.tree_type == 'CompositorNodeTree')
class ShaderNewNodeCategory(NodeCategory):
@classmethod
def poll(cls, context):
return context.space_data.tree_type == 'ShaderNodeTree' and \
context.scene.render.use_shading_nodes
return (context.space_data.tree_type == 'ShaderNodeTree' and
context.scene.render.use_shading_nodes)
class ShaderOldNodeCategory(NodeCategory):
@classmethod
def poll(cls, context):
return context.space_data.tree_type == 'ShaderNodeTree' and \
not context.scene.render.use_shading_nodes
return (context.space_data.tree_type == 'ShaderNodeTree' and
not context.scene.render.use_shading_nodes)
class TextureNodeCategory(NodeCategory):
@classmethod
@ -54,10 +57,12 @@ def group_make_draw(self, layout, context):
# maps node tree type to group node type
node_tree_group_type = {
'CompositorNodeTree' : 'CompositorNodeGroup',
'ShaderNodeTree' : 'ShaderNodeGroup',
'TextureNodeTree' : 'TextureNodeGroup',
'CompositorNodeTree': 'CompositorNodeGroup',
'ShaderNodeTree': 'ShaderNodeGroup',
'TextureNodeTree': 'TextureNodeGroup',
}
# generic node group items generator for shader, compositor and texture node groups
def node_group_items(context):
space = context.space_data
@ -86,7 +91,10 @@ def node_group_items(context):
if contains_group(group, ntree):
continue
yield NodeItem(node_tree_group_type[group.bl_idname], group.name, { "node_tree" : "bpy.data.node_groups[%r]" % group.name })
yield NodeItem(node_tree_group_type[group.bl_idname],
group.name,
{"node_tree": "bpy.data.node_groups[%r]" % group.name})
# only show input/output nodes inside node groups
def group_input_output_item_poll(context):
@ -233,8 +241,8 @@ shader_node_categories = [
]
compositor_node_categories = [
# Compositor Nodes
CompositorNodeCategory("CMP_INPUT", "Input", items = [
# Compositor Nodes
CompositorNodeCategory("CMP_INPUT", "Input", items=[
NodeItem("CompositorNodeRLayers"),
NodeItem("CompositorNodeImage"),
NodeItem("CompositorNodeMovieClip"),
@ -247,7 +255,7 @@ compositor_node_categories = [
NodeItem("CompositorNodeTrackPos"),
NodeItem("NodeGroupInput", poll=group_input_output_item_poll),
]),
CompositorNodeCategory("CMP_OUTPUT", "Output", items = [
CompositorNodeCategory("CMP_OUTPUT", "Output", items=[
NodeItem("CompositorNodeComposite"),
NodeItem("CompositorNodeViewer"),
NodeItem("CompositorNodeSplitViewer"),
@ -255,7 +263,7 @@ compositor_node_categories = [
NodeItem("CompositorNodeLevels"),
NodeItem("NodeGroupOutput", poll=group_input_output_item_poll),
]),
CompositorNodeCategory("CMP_OP_COLOR", "Color", items = [
CompositorNodeCategory("CMP_OP_COLOR", "Color", items=[
NodeItem("CompositorNodeMixRGB"),
NodeItem("CompositorNodeAlphaOver"),
NodeItem("CompositorNodeInvert"),
@ -269,7 +277,7 @@ compositor_node_categories = [
NodeItem("CompositorNodeTonemap"),
NodeItem("CompositorNodeZcombine"),
]),
CompositorNodeCategory("CMP_CONVERTOR", "Converter", items = [
CompositorNodeCategory("CMP_CONVERTOR", "Converter", items=[
NodeItem("CompositorNodeMath"),
NodeItem("CompositorNodeValToRGB"),
NodeItem("CompositorNodeSetAlpha"),
@ -285,7 +293,7 @@ compositor_node_categories = [
NodeItem("CompositorNodeSepYCCA"),
NodeItem("CompositorNodeCombYCCA"),
]),
CompositorNodeCategory("CMP_OP_FILTER", "Filter", items = [
CompositorNodeCategory("CMP_OP_FILTER", "Filter", items=[
NodeItem("CompositorNodeBlur"),
NodeItem("CompositorNodeBilateralblur"),
NodeItem("CompositorNodeDilateErode"),
@ -299,14 +307,14 @@ compositor_node_categories = [
NodeItem("CompositorNodeDBlur"),
NodeItem("CompositorNodePixelate"),
]),
CompositorNodeCategory("CMP_OP_VECTOR", "Vector", items = [
CompositorNodeCategory("CMP_OP_VECTOR", "Vector", items=[
NodeItem("CompositorNodeNormal"),
NodeItem("CompositorNodeMapValue"),
NodeItem("CompositorNodeMapRange"),
NodeItem("CompositorNodeNormalize"),
NodeItem("CompositorNodeCurveVec"),
]),
CompositorNodeCategory("CMP_MATTE", "Matte", items = [
CompositorNodeCategory("CMP_MATTE", "Matte", items=[
NodeItem("CompositorNodeKeying"),
NodeItem("CompositorNodeKeyingScreen"),
NodeItem("CompositorNodeChannelMatte"),
@ -320,7 +328,7 @@ compositor_node_categories = [
NodeItem("CompositorNodeColorMatte"),
NodeItem("CompositorNodeDoubleEdgeMask"),
]),
CompositorNodeCategory("CMP_DISTORT", "Distort", items = [
CompositorNodeCategory("CMP_DISTORT", "Distort", items=[
NodeItem("CompositorNodeScale"),
NodeItem("CompositorNodeLensdist"),
NodeItem("CompositorNodeMovieDistortion"),
@ -334,7 +342,7 @@ compositor_node_categories = [
NodeItem("CompositorNodeStabilize"),
]),
CompositorNodeCategory("CMP_GROUP", "Group", items=node_group_items),
CompositorNodeCategory("CMP_LAYOUT", "Layout", items = [
CompositorNodeCategory("CMP_LAYOUT", "Layout", items=[
NodeItem("NodeFrame"),
NodeItem("NodeReroute"),
NodeItem("CompositorNodeSwitch"),
@ -343,19 +351,19 @@ compositor_node_categories = [
texture_node_categories = [
# Texture Nodes
TextureNodeCategory("TEX_INPUT", "Input", items = [
TextureNodeCategory("TEX_INPUT", "Input", items=[
NodeItem("TextureNodeCurveTime"),
NodeItem("TextureNodeCoordinates"),
NodeItem("TextureNodeTexture"),
NodeItem("TextureNodeImage"),
NodeItem("NodeGroupInput", poll=group_input_output_item_poll),
]),
TextureNodeCategory("TEX_OUTPUT", "Output", items = [
TextureNodeCategory("TEX_OUTPUT", "Output", items=[
NodeItem("TextureNodeOutput"),
NodeItem("TextureNodeViewer"),
NodeItem("NodeGroupOutput", poll=group_input_output_item_poll),
]),
TextureNodeCategory("TEX_OP_COLOR", "Color", items = [
TextureNodeCategory("TEX_OP_COLOR", "Color", items=[
NodeItem("TextureNodeMixRGB"),
NodeItem("TextureNodeCurveRGB"),
NodeItem("TextureNodeInvert"),
@ -363,11 +371,11 @@ texture_node_categories = [
NodeItem("TextureNodeCompose"),
NodeItem("TextureNodeDecompose"),
]),
TextureNodeCategory("TEX_PATTERN", "Pattern", items = [
TextureNodeCategory("TEX_PATTERN", "Pattern", items=[
NodeItem("TextureNodeChecker"),
NodeItem("TextureNodeBricks"),
]),
TextureNodeCategory("TEX_TEXTURE", "Textures", items = [
TextureNodeCategory("TEX_TEXTURE", "Textures", items=[
NodeItem("TextureNodeTexNoise"),
NodeItem("TextureNodeTexDistNoise"),
NodeItem("TextureNodeTexClouds"),
@ -379,20 +387,20 @@ texture_node_categories = [
NodeItem("TextureNodeTexMusgrave"),
NodeItem("TextureNodeTexStucci"),
]),
TextureNodeCategory("TEX_CONVERTOR", "Converter", items = [
TextureNodeCategory("TEX_CONVERTOR", "Converter", items=[
NodeItem("TextureNodeMath"),
NodeItem("TextureNodeValToRGB"),
NodeItem("TextureNodeRGBToBW"),
NodeItem("TextureNodeValToNor"),
NodeItem("TextureNodeDistance"),
]),
TextureNodeCategory("TEX_DISTORT", "Distort", items = [
TextureNodeCategory("TEX_DISTORT", "Distort", items=[
NodeItem("TextureNodeScale"),
NodeItem("TextureNodeTranslate"),
NodeItem("TextureNodeRotate"),
]),
TextureNodeCategory("TEX_GROUP", "Group", items=node_group_items),
TextureNodeCategory("TEX_LAYOUT", "Layout", items = [
TextureNodeCategory("TEX_LAYOUT", "Layout", items=[
NodeItem("NodeFrame"),
NodeItem("NodeReroute"),
]),
@ -400,15 +408,15 @@ texture_node_categories = [
def register():
nodeitems_utils.register_node_categories("SHADER", shader_node_categories)
nodeitems_utils.register_node_categories("COMPOSITING", compositor_node_categories)
nodeitems_utils.register_node_categories("TEXTURE", texture_node_categories)
nodeitems_utils.register_node_categories('SHADER', shader_node_categories)
nodeitems_utils.register_node_categories('COMPOSITING', compositor_node_categories)
nodeitems_utils.register_node_categories('TEXTURE', texture_node_categories)
def unregister():
nodeitems_utils.unregister_node_categories("SHADER")
nodeitems_utils.unregister_node_categories("COMPOSITING")
nodeitems_utils.unregister_node_categories("TEXTURE")
nodeitems_utils.unregister_node_categories('SHADER')
nodeitems_utils.unregister_node_categories('COMPOSITING')
nodeitems_utils.unregister_node_categories('TEXTURE')
if __name__ == "__main__":

@ -12,18 +12,18 @@
</style>
</head>
<body>
<p class="title"><b>Blender 2.67</b></p>
<p class="title"><b>Blender 2.68</b></p>
<p><br></p>
<p class="header"><b>About</b></p>
<p class="body">Welcome to Blender, the free, open source 3D application for modeling, animation, rendering, compositing, video editing and game creation. Blender is available for Linux, Mac OS X, Windows and FreeBSD and has a large world-wide community.</p>
<p class="body">Blender can be used freely for any purpose, including commercial use and distribution. It's free and open-source software, released under the GNU GPL licence. The entire source code is available on our website.</p>
<p class="body">For more information, visit <a href="http://www.blender.org">blender.org</a>.</p>
<p><br></p>
<p class="header"><b>2.67</b></p>
<p class="body">The Blender Foundation and online developer community is proud to present Blender 2.67. This release is the eight official stable release of the Blender 2.6 series, in which we will refine the 2.5 series and add exciting new features. <a href="http://www.blender.org/development/release-logs/blender-267/">More information about this release</a>.</p>
<p class="header"><b>2.68</b></p>
<p class="body">The Blender Foundation and online developer community is proud to present Blender 2.68. This release is the ninth official stable release of the Blender 2.6 series, in which we will refine the 2.5 series and add exciting new features. <a href="http://www.blender.org/development/release-logs/blender-268/">More information about this release</a>.</p>
<p><br></p>
<p class="header"><b>Bugs</b></p>
<p class="body">Although Blender 2.67 is considered a stable release, you may encounter a bug. If you do, please help us by posting it in the bug tracker or using Help → Report a Bug from inside Blender. If it wasnt reported yet, please log in (or register) and fill in detailed information about the error. Please post detailed instructions on how to reproduce it or post a .blend file showcasing the bug.</p>
<p class="body">Although Blender 2.68 is considered a stable release, you may encounter a bug. If you do, please help us by posting it in the bug tracker or using Help → Report a Bug from inside Blender. If it wasnt reported yet, please log in (or register) and fill in detailed information about the error. Please post detailed instructions on how to reproduce it or post a .blend file showcasing the bug.</p>
<p><br></p>
<p class="header"><b>Package Contents</b></p>
<p class="body">The downloaded Blender package includes:</p>
@ -47,7 +47,7 @@
<p class="header"><b>Links</b></p>
<p class="body">Users:</p>
<p class="body"> General information <a href="http://www.blender.org">www.blender.org</a> <br>
Full release log <a href="http://www.blender.org/development/release-logs/blender-267/">www.blender.org/development/release-logs/blender-267/</a><br>
Full release log <a href="http://www.blender.org/development/release-logs/blender-268/">www.blender.org/development/release-logs/blender-268/</a><br>
Tutorials <a href="http://www.blender.org/education-help/">www.blender.org/education-help/</a> <br>
Manual <a href="http://wiki.blender.org/index.php/Doc:2.6/Manual">wiki.blender.org/index.php/Doc:2.6/Manual</a><br>
User Forum <a href="http://www.blenderartists.org">www.blenderartists.org</a><br>

@ -615,10 +615,13 @@ void DM_interp_poly_data(struct DerivedMesh *source, struct DerivedMesh *dest,
/* Temporary? A function to give a colorband to derivedmesh for vertexcolor ranges */
void vDM_ColorBand_store(const struct ColorBand *coba, const char alert_color[4]);
/* UNUSED */
#if 0
/** Simple function to get me->totvert amount of vertices/normals,
* correctly deformed and subsurfered. Needed especially when vertexgroups are involved.
* In use now by vertex/weight paint and particles */
DMCoNo *mesh_get_mapped_verts_nors(struct Scene *scene, struct Object *ob);
#endif
/* */
DerivedMesh *mesh_get_derived_final(struct Scene *scene, struct Object *ob,

@ -52,7 +52,7 @@ extern "C" {
/* can be left blank, otherwise a,b,c... etc with no quotes */
#define BLENDER_VERSION_CHAR b
/* alpha/beta/rc/release, docs use this */
#define BLENDER_VERSION_CYCLE alpha
#define BLENDER_VERSION_CYCLE rc
extern char versionstr[]; /* from blender.c */

@ -2432,6 +2432,8 @@ DerivedMesh *editbmesh_get_derived_base(Object *obedit, BMEditMesh *em)
return getEditDerivedBMesh(em, obedit, NULL);
}
/* UNUSED */
#if 0
/* ********* For those who don't grasp derived stuff! (ton) :) *************** */
@ -2488,6 +2490,8 @@ DMCoNo *mesh_get_mapped_verts_nors(Scene *scene, Object *ob)
return vertexcosnos;
}
#endif
/* ******************* GLSL ******************** */
typedef struct {

@ -148,12 +148,6 @@ PartDeflect *object_add_collision_fields(int type)
return pd;
}
/* temporal struct, used for reading return of mesh_get_mapped_verts_nors() */
typedef struct VeNoCo {
float co[3], no[3];
} VeNoCo;
/* ***************** PARTICLES ***************** */
/* -------------------------- Effectors ------------------ */

@ -2765,7 +2765,9 @@ int BKE_mesh_recalc_tessellation(CustomData *fdata,
BLI_scanfill_edge_add(&sf_ctx, sf_vert_last, sf_vert_first);
#ifdef USE_TESSFACE_CALCNORMAL
add_newell_cross_v3_v3v3(normal, sf_vert_last->co, sf_vert_first->co);
normalize_v3(normal);
if (UNLIKELY(normalize_v3(normal) == 0.0f)) {
normal[2] = 1.0f;
}
totfilltri = BLI_scanfill_calc_ex(&sf_ctx, 0, normal);
#else
totfilltri = BLI_scanfill_calc(&sf_ctx, 0);

@ -1222,6 +1222,9 @@ const char *BLI_get_folder(int folder_id, const char *subfolder)
if (get_path_local(path, "python", subfolder, ver)) break;
if (get_path_system(path, "python", subfolder, "BLENDER_SYSTEM_PYTHON", ver)) break;
return NULL;
default:
BLI_assert(0);
}
return path;
@ -1248,6 +1251,8 @@ const char *BLI_get_user_folder_notest(int folder_id, const char *subfolder)
case BLENDER_USER_SCRIPTS:
get_path_user(path, "scripts", subfolder, "BLENDER_USER_SCRIPTS", ver);
break;
default:
BLI_assert(0);
}
if ('\0' == path[0]) {
return NULL;

@ -95,13 +95,14 @@ static void calc_poly_normal(float normal[3], float verts[][3], int nverts)
*
* Same as #calc_poly_normal but operates directly on a bmesh face.
*/
static void bm_face_calc_poly_normal(BMFace *f)
static void bm_face_calc_poly_normal(BMFace *f, float n[3])
{
BMLoop *l_first = BM_FACE_FIRST_LOOP(f);
BMLoop *l_iter = l_first;
float const *v_prev = l_first->prev->v->co;
float const *v_curr = l_first->v->co;
float n[3] = {0.0f};
zero_v3(n);
/* Newell's Method */
do {
@ -113,8 +114,8 @@ static void bm_face_calc_poly_normal(BMFace *f)
} while (l_iter != l_first);
if (UNLIKELY(normalize_v3_v3(f->no, n) == 0.0f)) {
f->no[2] = 1.0f; /* other axis set to 0.0 */
if (UNLIKELY(normalize_v3(n) == 0.0f)) {
n[2] = 1.0f;
}
}
@ -458,20 +459,20 @@ void calc_poly_plane(float (*verts)[3], const int nverts)
* the list that bridges a concave region of the face or intersects
* any of the faces's edges.
*/
static void scale_edge_v3f(float v1[3], float v2[3], const float fac)
static void scale_edge_v2f(float v1[2], float v2[2], const float fac)
{
float mid[3];
float mid[2];
mid_v3_v3v3(mid, v1, v2);
mid_v2_v2v2(mid, v1, v2);
sub_v3_v3v3(v1, v1, mid);
sub_v3_v3v3(v2, v2, mid);
sub_v2_v2v2(v1, v1, mid);
sub_v2_v2v2(v2, v2, mid);
mul_v3_fl(v1, fac);
mul_v3_fl(v2, fac);
mul_v2_fl(v1, fac);
mul_v2_fl(v2, fac);
add_v3_v3v3(v1, v1, mid);
add_v3_v3v3(v2, v2, mid);
add_v2_v2v2(v1, v1, mid);
add_v2_v2v2(v2, v2, mid);
}
/**
@ -563,7 +564,7 @@ void BM_vert_normal_update_all(BMVert *v)
* is passed in as well.
*/
void BM_face_normal_update(BMFace *f)
void BM_face_calc_normal(BMFace *f, float r_no[3])
{
BMLoop *l;
@ -576,7 +577,7 @@ void BM_face_normal_update(BMFace *f)
const float *co3 = (l = l->next)->v->co;
const float *co4 = (l->next)->v->co;
normal_quad_v3(f->no, co1, co2, co3, co4);
normal_quad_v3(r_no, co1, co2, co3, co4);
break;
}
case 3:
@ -585,16 +586,21 @@ void BM_face_normal_update(BMFace *f)
const float *co2 = (l = l->next)->v->co;
const float *co3 = (l->next)->v->co;
normal_tri_v3(f->no, co1, co2, co3);
normal_tri_v3(r_no, co1, co2, co3);
break;
}
default:
{
bm_face_calc_poly_normal(f);
bm_face_calc_poly_normal(f, r_no);
break;
}
}
}
void BM_face_normal_update(BMFace *f)
{
BM_face_calc_normal(f, f->no);
}
/* exact same as 'bmesh_face_normal_update' but accepts vertex coords */
void BM_face_normal_update_vcos(BMesh *bm, BMFace *f, float no[3],
float const (*vertexCos)[3])
@ -1025,64 +1031,47 @@ void BM_face_triangulate(BMesh *bm, BMFace *f,
* intersecting splits, only the first of the set of intersecting
* splits survives
*/
void BM_face_legal_splits(BMesh *bm, BMFace *f, BMLoop *(*loops)[2], int len)
void BM_face_legal_splits(BMFace *f, BMLoop *(*loops)[2], int len)
{
BMIter iter;
const int len2 = len * 2;
BMLoop *l;
float v1[3], v2[3], v3[3] /*, v4[3 */, no[3], mid[3], *p1, *p2, *p3, *p4;
float out[3] = {-FLT_MAX, -FLT_MAX, 0.0f};
float (*projverts)[3] = BLI_array_alloca(projverts, f->len);
float (*edgeverts)[3] = BLI_array_alloca(edgeverts, len * 2);
float v1[2], v2[2], v3[2] /*, v4[3 */, no[3], mid[2], *p1, *p2, *p3, *p4;
float out[2] = {-FLT_MAX, -FLT_MAX};
float axis_mat[3][3];
float (*projverts)[2] = BLI_array_alloca(projverts, f->len);
float (*edgeverts)[2] = BLI_array_alloca(edgeverts, len2);
float fac1 = 1.0000001f, fac2 = 0.9f; //9999f; //0.999f;
int i, j, a = 0, clen;
i = 0;
l = BM_iter_new(&iter, bm, BM_LOOPS_OF_FACE, f);
for ( ; l; l = BM_iter_step(&iter)) {
BM_elem_index_set(l, i); /* set_loop */
copy_v3_v3(projverts[i], l->v->co);
i++;
}
for (i = 0; i < len; i++) {
copy_v3_v3(v1, loops[i][0]->v->co);
copy_v3_v3(v2, loops[i][1]->v->co);
scale_edge_v3f(v1, v2, fac2);
copy_v3_v3(edgeverts[a], v1);
a++;
copy_v3_v3(edgeverts[a], v2);
a++;
}
calc_poly_normal(no, projverts, f->len);
poly_rotate_plane(no, projverts, f->len);
poly_rotate_plane(no, edgeverts, len * 2);
/* TODO, the face normal may already be correct */
BM_face_calc_normal(f, no);
axis_dominant_v3_to_m3(axis_mat, no);
for (i = 0, l = BM_FACE_FIRST_LOOP(f); i < f->len; i++, l = l->next) {
p1 = projverts[i];
out[0] = max_ff(out[0], p1[0]);
out[1] = max_ff(out[1], p1[1]);
/* out[2] = 0.0f; */ /* keep at zero */
BM_elem_index_set(l, i); /* set_loop */
mul_v2_m3v3(projverts[i], axis_mat, l->v->co);
p1[2] = 0.0f;
out[0] = max_ff(out[0], projverts[i][0]);
out[1] = max_ff(out[1], projverts[i][1]);
}
/* ensure we are well outside the face bounds (value is arbitrary) */
add_v2_fl(out, 1.0f);
for (i = 0; i < len; i++) {
edgeverts[i * 2][2] = 0.0f;
edgeverts[i * 2 + 1][2] = 0.0f;
copy_v2_v2(edgeverts[a + 0], projverts[BM_elem_index_get(loops[i][0])]);
copy_v2_v2(edgeverts[a + 1], projverts[BM_elem_index_get(loops[i][1])]);
scale_edge_v2f(edgeverts[a + 0], edgeverts[a + 1], fac2);
a += 2;
}
/* do convexity test */
for (i = 0; i < len; i++) {
copy_v3_v3(v2, edgeverts[i * 2]);
copy_v3_v3(v3, edgeverts[i * 2 + 1]);
copy_v2_v2(v2, edgeverts[i * 2 + 0]);
copy_v2_v2(v3, edgeverts[i * 2 + 1]);
mid_v3_v3v3(mid, v2, v3);
mid_v2_v2v2(mid, v2, v3);
clen = 0;
for (j = 0; j < f->len; j++) {
@ -1090,10 +1079,10 @@ void BM_face_legal_splits(BMesh *bm, BMFace *f, BMLoop *(*loops)[2], int len)
p2 = projverts[(j + 1) % f->len];
#if 0
copy_v3_v3(v1, p1);
copy_v3_v3(v2, p2);
copy_v2_v2(v1, p1);
copy_v2_v2(v2, p2);
scale_edge_v3f(v1, v2, fac1);
scale_edge_v2f(v1, v2, fac1);
if (line_crosses_v2f(v1, v2, mid, out)) {
clen++;
}
@ -1114,10 +1103,10 @@ void BM_face_legal_splits(BMesh *bm, BMFace *f, BMLoop *(*loops)[2], int len)
p1 = projverts[i];
p2 = projverts[(i + 1) % f->len];
copy_v3_v3(v1, p1);
copy_v3_v3(v2, p2);
copy_v2_v2(v1, p1);
copy_v2_v2(v2, p2);
scale_edge_v3f(v1, v2, fac1);
scale_edge_v2f(v1, v2, fac1);
for (j = 0; j < len; j++) {
if (!loops[j][0]) {
@ -1141,10 +1130,10 @@ void BM_face_legal_splits(BMesh *bm, BMFace *f, BMLoop *(*loops)[2], int len)
p3 = edgeverts[j * 2];
p4 = edgeverts[j * 2 + 1];
copy_v3_v3(v1, p1);
copy_v3_v3(v2, p2);
copy_v2_v2(v1, p1);
copy_v2_v2(v2, p2);
scale_edge_v3f(v1, v2, fac1);
scale_edge_v2f(v1, v2, fac1);
if (line_crosses_v2f(v1, v2, p3, p4)) {
loops[i][0] = NULL;

@ -33,6 +33,7 @@ int BM_face_calc_tessellation(BMFace *f, BMLoop **r_loops, int (*r_index)[3])
__attribute__((nonnull))
#endif
;
void BM_face_calc_normal(BMFace *f, float r_no[3]);
float BM_face_calc_area(BMFace *f);
float BM_face_calc_perimeter(BMFace *f);
void BM_face_calc_plane(BMFace *f, float r_plane[3]);
@ -55,7 +56,7 @@ bool BM_face_point_inside_test(BMFace *f, const float co[3]);
void BM_face_triangulate(BMesh *bm, BMFace *f, BMFace **newfaces,
const bool use_beauty, const bool use_tag);
void BM_face_legal_splits(BMesh *bm, BMFace *f, BMLoop *(*loops)[2], int len);
void BM_face_legal_splits(BMFace *f, BMLoop *(*loops)[2], int len);
void BM_face_as_array_vert_tri(BMFace *f, BMVert *r_verts[3]);
void BM_face_as_array_vert_quad(BMFace *f, BMVert *r_verts[4]);

@ -83,7 +83,7 @@ static int bm_face_connect_verts(BMesh *bm, BMFace *f)
l_pair[1] = loops_split[0][0];
}
BM_face_legal_splits(bm, f, loops_split, STACK_SIZE(loops_split));
BM_face_legal_splits(f, loops_split, STACK_SIZE(loops_split));
for (i = 0; i < STACK_SIZE(loops_split); i++) {
BMVert **v_pair;

@ -1112,7 +1112,7 @@ void bmo_subdivide_edges_exec(BMesh *bm, BMOperator *op)
* - concave corner of an ngon.
* - 2 edges being used in 2+ ngons.
*/
// BM_face_legal_splits(bm, face, loops_split, BLI_array_count(loops_split));
// BM_face_legal_splits(face, loops_split, BLI_array_count(loops_split));
for (j = 0; j < BLI_array_count(loops_split); j++) {
if (loops_split[j][0]) {

@ -80,6 +80,7 @@ static void bm_vert_boundary_tangent(BMVert *v, float r_no[3], float r_no_face[3
}
if (e_a && e_b) {
/* note, with an incorrectly flushed selection this can crash */
l_a = bm_edge_tag_faceloop(e_a);
l_b = bm_edge_tag_faceloop(e_b);

@ -111,7 +111,7 @@ static void draw_modifier__generator(uiLayout *layout, ID *id, FModifier *fcm, s
uiBlock *block;
uiBut *but;
PointerRNA ptr;
short bwidth = width - 30; /* max button width */
short bwidth = width - 1.5 * UI_UNIT_X; /* max button width */
/* init the RNA-pointer */
RNA_pointer_create(id, &RNA_FModifierFunctionGenerator, fcm, &ptr);
@ -138,7 +138,7 @@ static void draw_modifier__generator(uiLayout *layout, ID *id, FModifier *fcm, s
/* draw polynomial order selector */
row = uiLayoutRow(layout, FALSE);
block = uiLayoutGetBlock(row);
but = uiDefButI(block, NUM, B_FMODIFIER_REDRAW, IFACE_("Poly Order:"), 10, 0, bwidth, 20,
but = uiDefButI(block, NUM, B_FMODIFIER_REDRAW, IFACE_("Poly Order:"), 0.5*UI_UNIT_X, 0, bwidth, UI_UNIT_Y,
&data->poly_order, 1, 100, 0, 0,
TIP_("'Order' of the Polynomial (for a polynomial with n terms, 'order' is n-1)"));
uiButSetFunc(but, validate_fmodifier_cb, fcm, NULL);
@ -147,11 +147,11 @@ static void draw_modifier__generator(uiLayout *layout, ID *id, FModifier *fcm, s
/* calculate maximum width of label for "x^n" labels */
if (data->arraysize > 2) {
BLI_snprintf(xval, sizeof(xval), "x^%u", data->arraysize);
maxXWidth = UI_GetStringWidth(xval) + 10; /* XXX: UI_GetStringWidth is not accurate */
maxXWidth = UI_GetStringWidth(xval) + 0.5 * UI_UNIT_X; /* XXX: UI_GetStringWidth is not accurate */
}
else {
/* basic size (just "x") */
maxXWidth = UI_GetStringWidth("x") + 10;
maxXWidth = UI_GetStringWidth("x") + 0.5 * UI_UNIT_X;
}
/* draw controls for each coefficient and a + sign at end of row */
@ -162,12 +162,12 @@ static void draw_modifier__generator(uiLayout *layout, ID *id, FModifier *fcm, s
for (i = 0; (i < data->arraysize) && (cp); i++, cp++) {
/* To align with first line... */
if (i)
uiDefBut(block, LABEL, 1, " ", 0, 0, 40, 20, NULL, 0.0, 0.0, 0, 0, "");
uiDefBut(block, LABEL, 1, " ", 0, 0, 2 * UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
else
uiDefBut(block, LABEL, 1, "y =", 0, 0, 40, 20, NULL, 0.0, 0.0, 0, 0, "");
uiDefBut(block, LABEL, 1, "y =", 0, 0, 2 * UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
/* coefficient */
uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 0, 0, bwidth / 2, 20, cp, -UI_FLT_MAX, UI_FLT_MAX,
uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 0, 0, bwidth / 2, UI_UNIT_Y, cp, -UI_FLT_MAX, UI_FLT_MAX,
10, 3, TIP_("Coefficient for polynomial"));
/* 'x' param (and '+' if necessary) */
@ -177,10 +177,10 @@ static void draw_modifier__generator(uiLayout *layout, ID *id, FModifier *fcm, s
BLI_strncpy(xval, "x", sizeof(xval));
else
BLI_snprintf(xval, sizeof(xval), "x^%u", i);
uiDefBut(block, LABEL, 1, xval, 0, 0, maxXWidth, 20, NULL, 0.0, 0.0, 0, 0, TIP_("Power of x"));
uiDefBut(block, LABEL, 1, xval, 0, 0, maxXWidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, TIP_("Power of x"));
if ( (i != (data->arraysize - 1)) || ((i == 0) && data->arraysize == 2) ) {
uiDefBut(block, LABEL, 1, "+", 0, 0, 20, 20, NULL, 0.0, 0.0, 0, 0, "");
uiDefBut(block, LABEL, 1, "+", 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
/* next coefficient on a new row */
row = uiLayoutRow(layout, TRUE);
@ -188,7 +188,7 @@ static void draw_modifier__generator(uiLayout *layout, ID *id, FModifier *fcm, s
}
else {
/* For alignment in UI! */
uiDefBut(block, LABEL, 1, " ", 0, 0, 20, 20, NULL, 0.0, 0.0, 0, 0, "");
uiDefBut(block, LABEL, 1, " ", 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
}
}
break;
@ -202,7 +202,7 @@ static void draw_modifier__generator(uiLayout *layout, ID *id, FModifier *fcm, s
/* draw polynomial order selector */
row = uiLayoutRow(layout, FALSE);
block = uiLayoutGetBlock(row);
but = uiDefButI(block, NUM, B_FMODIFIER_REDRAW, IFACE_("Poly Order:"), 0, 0, width - 30, 19,
but = uiDefButI(block, NUM, B_FMODIFIER_REDRAW, IFACE_("Poly Order:"), 0, 0, width - 1.5 * UI_UNIT_X, UI_UNIT_Y,
&data->poly_order, 1, 100, 0, 0,
TIP_("'Order' of the Polynomial (for a polynomial with n terms, 'order' is n-1)"));
uiButSetFunc(but, validate_fmodifier_cb, fcm, NULL);
@ -216,31 +216,31 @@ static void draw_modifier__generator(uiLayout *layout, ID *id, FModifier *fcm, s
for (i = 0; (i < data->poly_order) && (cp); i++, cp += 2) {
/* To align with first line */
if (i)
uiDefBut(block, LABEL, 1, " ", 0, 0, 50, 20, NULL, 0.0, 0.0, 0, 0, "");
uiDefBut(block, LABEL, 1, " ", 0, 0, 2.5 * UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
else
uiDefBut(block, LABEL, 1, "y =", 0, 0, 50, 20, NULL, 0.0, 0.0, 0, 0, "");
uiDefBut(block, LABEL, 1, "y =", 0, 0, 2.5 * UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
/* opening bracket */
uiDefBut(block, LABEL, 1, "(", 0, 0, 20, 20, NULL, 0.0, 0.0, 0, 0, "");
uiDefBut(block, LABEL, 1, "(", 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
/* coefficients */
uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 0, 0, 100, 20, cp, -UI_FLT_MAX, UI_FLT_MAX,
uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 0, 0, 5 * UI_UNIT_X, UI_UNIT_Y, cp, -UI_FLT_MAX, UI_FLT_MAX,
10, 3, TIP_("Coefficient of x"));
uiDefBut(block, LABEL, 1, "x +", 0, 0, 40, 20, NULL, 0.0, 0.0, 0, 0, "");
uiDefBut(block, LABEL, 1, "x +", 0, 0, 2 * UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 0, 0, 100, 20, cp + 1, -UI_FLT_MAX, UI_FLT_MAX,
uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 0, 0, 5 * UI_UNIT_X, UI_UNIT_Y, cp + 1, -UI_FLT_MAX, UI_FLT_MAX,
10, 3, TIP_("Second coefficient"));
/* closing bracket and multiplication sign */
if ( (i != (data->poly_order - 1)) || ((i == 0) && data->poly_order == 2) ) {
uiDefBut(block, LABEL, 1, ") \xc3\x97", 0, 0, 40, 20, NULL, 0.0, 0.0, 0, 0, "");
uiDefBut(block, LABEL, 1, ") \xc3\x97", 0, 0, 2 * UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
/* set up new row for the next pair of coefficients */
row = uiLayoutRow(layout, TRUE);
block = uiLayoutGetBlock(row);
}
else
uiDefBut(block, LABEL, 1, ") ", 0, 0, 40, 20, NULL, 0.0, 0.0, 0, 0, "");
uiDefBut(block, LABEL, 1, ") ", 0, 0, 2 * UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
}
}
break;
@ -438,9 +438,9 @@ static void draw_modifier__envelope(uiLayout *layout, ID *id, FModifier *fcm, sh
row = uiLayoutRow(layout, FALSE);
block = uiLayoutGetBlock(row);
uiDefBut(block, LABEL, 1, IFACE_("Control Points:"), 0, 0, 150, 20, NULL, 0.0, 0.0, 0, 0, "");
uiDefBut(block, LABEL, 1, IFACE_("Control Points:"), 0, 0, 7.5 * UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
but = uiDefBut(block, BUT, B_FMODIFIER_REDRAW, IFACE_("Add Point"), 0, 0, 150, 19,
but = uiDefBut(block, BUT, B_FMODIFIER_REDRAW, IFACE_("Add Point"), 0, 0, 7.5 * UI_UNIT_X, UI_UNIT_Y,
NULL, 0, 0, 0, 0, TIP_("Add a new control-point to the envelope on the current frame"));
uiButSetFunc(but, fmod_envelope_addpoint_cb, env, NULL);
@ -451,16 +451,16 @@ static void draw_modifier__envelope(uiLayout *layout, ID *id, FModifier *fcm, sh
block = uiLayoutGetBlock(row);
uiBlockBeginAlign(block);
but = uiDefButF(block, NUM, B_FMODIFIER_REDRAW, IFACE_("Fra:"), 0, 0, 90, 20,
but = uiDefButF(block, NUM, B_FMODIFIER_REDRAW, IFACE_("Fra:"), 0, 0, 4.5 * UI_UNIT_X, UI_UNIT_Y,
&fed->time, -MAXFRAMEF, MAXFRAMEF, 10, 1, TIP_("Frame that envelope point occurs"));
uiButSetFunc(but, validate_fmodifier_cb, fcm, NULL);
uiDefButF(block, NUM, B_FMODIFIER_REDRAW, IFACE_("Min:"), 0, 0, 100, 20,
uiDefButF(block, NUM, B_FMODIFIER_REDRAW, IFACE_("Min:"), 0, 0, 5 * UI_UNIT_X, UI_UNIT_Y,
&fed->min, -UI_FLT_MAX, UI_FLT_MAX, 10, 2, TIP_("Minimum bound of envelope at this point"));
uiDefButF(block, NUM, B_FMODIFIER_REDRAW, IFACE_("Max:"), 0, 0, 100, 20,
uiDefButF(block, NUM, B_FMODIFIER_REDRAW, IFACE_("Max:"), 0, 0, 5 * UI_UNIT_X, UI_UNIT_Y,
&fed->max, -UI_FLT_MAX, UI_FLT_MAX, 10, 2, TIP_("Maximum bound of envelope at this point"));
but = uiDefIconBut(block, BUT, B_FMODIFIER_REDRAW, ICON_X, 0, 0, 18, 20,
but = uiDefIconBut(block, BUT, B_FMODIFIER_REDRAW, ICON_X, 0, 0, 0.9 * UI_UNIT_X, UI_UNIT_Y,
NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Delete envelope control point"));
uiButSetFunc(but, fmod_envelope_deletepoint_cb, env, SET_INT_IN_POINTER(i));
uiBlockBeginAlign(block);

@ -47,6 +47,7 @@
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_bitmap.h"
#include "BLI_math.h"
#include "BLI_dynstr.h"
#include "BLI_rand.h"
@ -5143,7 +5144,6 @@ static int select_more_exec(bContext *C, wmOperator *UNUSED(op))
BPoint *bp, *tempbp;
int a;
short sel = 0;
short *selbpoints;
/* note that NURBS surface is a special case because we mimic */
/* the behavior of "select more" of mesh tools. */
@ -5151,11 +5151,12 @@ static int select_more_exec(bContext *C, wmOperator *UNUSED(op))
/* may not be optimal always (example: end of NURBS sphere) */
if (obedit->type == OB_SURF) {
for (nu = editnurb->first; nu; nu = nu->next) {
BLI_bitmap selbpoints;
a = nu->pntsu * nu->pntsv;
bp = nu->bp;
selbpoints = MEM_callocN(sizeof(short) * a - nu->pntsu, "selectlist");
selbpoints = BLI_BITMAP_NEW(a, "selectlist");
while (a > 0) {
if ((selbpoints[a] != 1) && (bp->hide == 0) && (bp->f1 & SELECT)) {
if ((!BLI_BITMAP_GET(selbpoints, a)) && (bp->hide == 0) && (bp->f1 & SELECT)) {
/* upper control point */
if (a % nu->pntsu != 0) {
tempbp = bp - 1;
@ -5168,7 +5169,7 @@ static int select_more_exec(bContext *C, wmOperator *UNUSED(op))
tempbp = bp + nu->pntsu;
if (!(tempbp->f1 & SELECT)) sel = select_bpoint(tempbp, SELECT, 1, VISIBLE);
/* make sure selected bpoint is discarded */
if (sel == 1) selbpoints[a - nu->pntsu] = 1;
if (sel == 1) BLI_BITMAP_SET(selbpoints, a - nu->pntsu);
}
/* right control point */
@ -5233,13 +5234,13 @@ static int select_less_exec(bContext *C, wmOperator *UNUSED(op))
BezTriple *bezt;
int a;
short sel = 0, lastsel = false;
short *selbpoints;
if (obedit->type == OB_SURF) {
for (nu = editnurb->first; nu; nu = nu->next) {
BLI_bitmap selbpoints;
a = nu->pntsu * nu->pntsv;
bp = nu->bp;
selbpoints = MEM_callocN(sizeof(short) * a, "selectlist");
selbpoints = BLI_BITMAP_NEW(a, "selectlist");
while (a--) {
if ((bp->hide == 0) && (bp->f1 & SELECT)) {
sel = 0;
@ -5251,7 +5252,7 @@ static int select_less_exec(bContext *C, wmOperator *UNUSED(op))
}
else {
bp--;
if ((selbpoints[a + 1] == 1) || ((bp->hide == 0) && (bp->f1 & SELECT))) sel++;
if (BLI_BITMAP_GET(selbpoints, a + 1) || ((bp->hide == 0) && (bp->f1 & SELECT))) sel++;
bp++;
}
@ -5269,7 +5270,7 @@ static int select_less_exec(bContext *C, wmOperator *UNUSED(op))
}
else {
bp -= nu->pntsu;
if ((selbpoints[a + nu->pntsu] == 1) || ((bp->hide == 0) && (bp->f1 & SELECT))) sel++;
if (BLI_BITMAP_GET(selbpoints, a + nu->pntsu) || ((bp->hide == 0) && (bp->f1 & SELECT))) sel++;
bp += nu->pntsu;
}
@ -5284,7 +5285,7 @@ static int select_less_exec(bContext *C, wmOperator *UNUSED(op))
if (sel != 4) {
select_bpoint(bp, DESELECT, 1, VISIBLE);
selbpoints[a] = 1;
BLI_BITMAP_SET(selbpoints, a);
}
}
else {

@ -299,7 +299,7 @@ static int insert_lorem_exec(bContext *C, wmOperator *UNUSED(op))
Object *obedit = CTX_data_edit_object(C);
const char *p, *p2;
int i;
static const char *lastlorem;
static const char *lastlorem = NULL;
if (lastlorem)
p = lastlorem;

@ -653,5 +653,5 @@ const char ED_lorem[] = {
32, 115, 101, 100, 32, 116, 117, 114, 112, 105, 115, 32, 117, 116, 32, 100, 111, 108, 111, 114, 32, 112, 108, 97, 99, 101, 114, 97, 116, 32, 100, 105,
103, 110, 105, 115, 115, 105, 109, 46, 32, 81, 117, 105, 115, 113, 117, 101, 32, 113, 117, 105, 115, 32, 108, 101, 111, 46, 32, 67, 114, 97, 115, 32,
117, 108, 116, 114, 105, 99, 101, 115, 46, 32, 77, 97, 101, 99, 101, 110, 97, 115, 32, 104, 101, 110, 100, 114, 101, 114, 105, 116, 32, 97, 117, 99,
116, 111, 114, 32, 116, 111, 114, 116, 111, 114, 46, 32, 69, 116, 105, 97, 109, 32, 115, 105, 116, 32, 97, 109, 101, 116, 32, 97, 114, 99, 117, 46
};
116, 111, 114, 32, 116, 111, 114, 116, 111, 114, 46, 32, 69, 116, 105, 97, 109, 32, 115, 105, 116, 32, 97, 109, 101, 116, 32, 97, 114, 99, 117, 46,
0};

@ -632,6 +632,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
memset(&type, 0, sizeof(ARegionType));
type.draw = ui_tooltip_region_draw_cb;
type.free = ui_tooltip_region_free_cb;
type.regionid = RGN_TYPE_TEMPORARY;
ar->type = &type;
/* set font, get bb */
@ -1159,6 +1160,7 @@ ARegion *ui_searchbox_create(bContext *C, ARegion *butregion, uiBut *but)
memset(&type, 0, sizeof(ARegionType));
type.draw = ui_searchbox_region_draw_cb;
type.free = ui_searchbox_region_free_cb;
type.regionid = RGN_TYPE_TEMPORARY;
ar->type = &type;
/* create searchbox data */
@ -1251,8 +1253,11 @@ ARegion *ui_searchbox_create(bContext *C, ARegion *butregion, uiBut *but)
}
if (rect_i.ymin < 0) {
int newy1;
UI_view2d_to_region_no_clip(&butregion->v2d, 0, but->rect.ymax + ofsy, NULL, &newy1);
int newy1 = but->rect.ymax + ofsy;
if (butregion->v2d.cur.xmin != butregion->v2d.cur.xmax)
UI_view2d_to_region_no_clip(&butregion->v2d, 0, newy1, NULL, &newy1);
newy1 += butregion->winrct.ymin;
rect_i.ymax = BLI_rcti_size_y(&rect_i) + newy1;
@ -1669,6 +1674,7 @@ uiPopupBlockHandle *ui_popup_block_create(bContext *C, ARegion *butregion, uiBut
memset(&type, 0, sizeof(ARegionType));
type.draw = ui_block_region_draw;
type.regionid = RGN_TYPE_TEMPORARY;
ar->type = &type;
UI_add_region_handlers(&ar->handlers);

@ -2478,14 +2478,14 @@ static void uilist_draw_item_default(struct uiList *ui_list, struct bContext *UN
/* Simplest one! */
switch (ui_list->layout_type) {
case UILST_LAYOUT_GRID:
uiItemL(layout, "", icon);
break;
case UILST_LAYOUT_DEFAULT:
case UILST_LAYOUT_COMPACT:
default:
uiItemL(layout, name, icon);
break;
case UILST_LAYOUT_GRID:
uiItemL(layout, "", icon);
break;
case UILST_LAYOUT_DEFAULT:
case UILST_LAYOUT_COMPACT:
default:
uiItemL(layout, name, icon);
break;
}
/* free name */
@ -2599,46 +2599,134 @@ void uiTemplateList(uiLayout *layout, bContext *C, const char *listtype_name, co
ui_list->layout_type = layout_type;
switch (layout_type) {
case UILST_LAYOUT_DEFAULT:
/* default rows */
if (rows == 0)
rows = 5;
if (maxrows == 0)
maxrows = 5;
if (ui_list->list_grip_size != 0)
rows = ui_list->list_grip_size;
case UILST_LAYOUT_DEFAULT:
/* default rows */
if (rows == 0)
rows = 5;
if (maxrows == 0)
maxrows = 5;
if (ui_list->list_grip_size != 0)
rows = ui_list->list_grip_size;
/* layout */
box = uiLayoutListBox(layout, ui_list, dataptr, prop, active_dataptr, activeprop);
row = uiLayoutRow(box, FALSE);
col = uiLayoutColumn(row, TRUE);
/* layout */
box = uiLayoutListBox(layout, ui_list, dataptr, prop, active_dataptr, activeprop);
row = uiLayoutRow(box, FALSE);
col = uiLayoutColumn(row, TRUE);
/* init numbers */
RNA_property_int_range(active_dataptr, activeprop, &min, &max);
/* init numbers */
RNA_property_int_range(active_dataptr, activeprop, &min, &max);
if (prop)
len = RNA_property_collection_length(dataptr, prop);
items = CLAMPIS(len, rows, MAX2(rows, maxrows));
if (prop)
len = RNA_property_collection_length(dataptr, prop);
items = CLAMPIS(len, rows, MAX2(rows, maxrows));
/* if list length changes and active is out of view, scroll to it */
if ((ui_list->list_last_len != len) &&
(activei < ui_list->list_scroll || activei >= ui_list->list_scroll + items))
{
ui_list->list_scroll = activei;
}
ui_list->list_scroll = min_ii(ui_list->list_scroll, len - items);
ui_list->list_scroll = max_ii(ui_list->list_scroll, 0);
ui_list->list_size = items;
ui_list->list_last_len = len;
if (dataptr->data && prop) {
/* create list items */
RNA_PROP_BEGIN (dataptr, itemptr, prop)
/* if list length changes and active is out of view, scroll to it */
if ((ui_list->list_last_len != len) &&
(activei < ui_list->list_scroll || activei >= ui_list->list_scroll + items))
{
if (i >= ui_list->list_scroll && i < ui_list->list_scroll + items) {
subblock = uiLayoutGetBlock(col);
overlap = uiLayoutOverlap(col);
ui_list->list_scroll = activei;
}
ui_list->list_scroll = min_ii(ui_list->list_scroll, len - items);
ui_list->list_scroll = max_ii(ui_list->list_scroll, 0);
ui_list->list_size = items;
ui_list->list_last_len = len;
if (dataptr->data && prop) {
/* create list items */
RNA_PROP_BEGIN (dataptr, itemptr, prop)
{
if (i >= ui_list->list_scroll && i < ui_list->list_scroll + items) {
subblock = uiLayoutGetBlock(col);
overlap = uiLayoutOverlap(col);
uiBlockSetFlag(subblock, UI_BLOCK_LIST_ITEM);
/* list item behind label & other buttons */
sub = uiLayoutRow(overlap, FALSE);
but = uiDefButR_prop(subblock, LISTROW, 0, "", 0, 0, UI_UNIT_X * 10, UI_UNIT_Y,
active_dataptr, activeprop, 0, 0, i, 0, 0, "");
uiButSetFlag(but, UI_BUT_NO_TOOLTIP);
sub = uiLayoutRow(overlap, FALSE);
icon = UI_rnaptr_icon_get(C, &itemptr, rnaicon, false);
if (icon == ICON_DOT)
icon = ICON_NONE;
draw_item(ui_list, C, sub, dataptr, &itemptr, icon, active_dataptr, active_propname, i);
/* If we are "drawing" active item, set all labels as active. */
if (i == activei) {
ui_layout_list_set_labels_active(sub);
}
}
i++;
}
RNA_PROP_END;
}
/* add dummy buttons to fill space */
while (i < ui_list->list_scroll + items) {
if (i >= ui_list->list_scroll)
uiItemL(col, "", ICON_NONE);
i++;
}
/* add scrollbar */
if (len > items) {
col = uiLayoutColumn(row, FALSE);
uiDefButI(block, SCROLL, 0, "", 0, 0, UI_UNIT_X * 0.75, UI_UNIT_Y * items, &ui_list->list_scroll,
0, len - items, items, 0, "");
}
break;
case UILST_LAYOUT_COMPACT:
row = uiLayoutRow(layout, TRUE);
if (dataptr->data && prop) {
/* create list items */
RNA_PROP_BEGIN (dataptr, itemptr, prop)
{
found = (activei == i);
if (found) {
icon = UI_rnaptr_icon_get(C, &itemptr, rnaicon, false);
if (icon == ICON_DOT)
icon = ICON_NONE;
draw_item(ui_list, C, row, dataptr, &itemptr, icon, active_dataptr, active_propname, i);
}
i++;
}
RNA_PROP_END;
}
/* if list is empty, add in dummy button */
if (i == 0)
uiItemL(row, "", ICON_NONE);
/* next/prev button */
BLI_snprintf(numstr, sizeof(numstr), "%d :", i);
but = uiDefIconTextButR_prop(block, NUM, 0, 0, numstr, 0, 0, UI_UNIT_X * 5, UI_UNIT_Y,
active_dataptr, activeprop, 0, 0, 0, 0, 0, "");
if (i == 0)
uiButSetFlag(but, UI_BUT_DISABLED);
break;
case UILST_LAYOUT_GRID:
box = uiLayoutListBox(layout, ui_list, dataptr, prop, active_dataptr, activeprop);
col = uiLayoutColumn(box, TRUE);
row = uiLayoutRow(col, FALSE);
if (dataptr->data && prop) {
/* create list items */
RNA_PROP_BEGIN (dataptr, itemptr, prop)
{
/* create button */
if (!(i % 9))
row = uiLayoutRow(col, FALSE);
subblock = uiLayoutGetBlock(row);
overlap = uiLayoutOverlap(row);
uiBlockSetFlag(subblock, UI_BLOCK_LIST_ITEM);
@ -2652,106 +2740,18 @@ void uiTemplateList(uiLayout *layout, bContext *C, const char *listtype_name, co
sub = uiLayoutRow(overlap, FALSE);
icon = UI_rnaptr_icon_get(C, &itemptr, rnaicon, false);
if (icon == ICON_DOT)
icon = ICON_NONE;
draw_item(ui_list, C, sub, dataptr, &itemptr, icon, active_dataptr, active_propname, i);
/* If we are "drawing" active item, set all labels as active. */
if (i == activei) {
ui_layout_list_set_labels_active(sub);
}
i++;
}
i++;
RNA_PROP_END;
}
RNA_PROP_END;
}
/* add dummy buttons to fill space */
while (i < ui_list->list_scroll + items) {
if (i >= ui_list->list_scroll)
uiItemL(col, "", ICON_NONE);
i++;
}
/* add scrollbar */
if (len > items) {
col = uiLayoutColumn(row, FALSE);
uiDefButI(block, SCROLL, 0, "", 0, 0, UI_UNIT_X * 0.75, UI_UNIT_Y * items, &ui_list->list_scroll,
0, len - items, items, 0, "");
}
break;
case UILST_LAYOUT_COMPACT:
row = uiLayoutRow(layout, TRUE);
if (dataptr->data && prop) {
/* create list items */
RNA_PROP_BEGIN (dataptr, itemptr, prop)
{
found = (activei == i);
if (found) {
icon = UI_rnaptr_icon_get(C, &itemptr, rnaicon, false);
if (icon == ICON_DOT)
icon = ICON_NONE;
draw_item(ui_list, C, row, dataptr, &itemptr, icon, active_dataptr, active_propname, i);
}
i++;
}
RNA_PROP_END;
}
/* if list is empty, add in dummy button */
if (i == 0)
uiItemL(row, "", ICON_NONE);
/* next/prev button */
BLI_snprintf(numstr, sizeof(numstr), "%d :", i);
but = uiDefIconTextButR_prop(block, NUM, 0, 0, numstr, 0, 0, UI_UNIT_X * 5, UI_UNIT_Y,
active_dataptr, activeprop, 0, 0, 0, 0, 0, "");
if (i == 0)
uiButSetFlag(but, UI_BUT_DISABLED);
break;
case UILST_LAYOUT_GRID:
box = uiLayoutListBox(layout, ui_list, dataptr, prop, active_dataptr, activeprop);
col = uiLayoutColumn(box, TRUE);
row = uiLayoutRow(col, FALSE);
if (dataptr->data && prop) {
/* create list items */
RNA_PROP_BEGIN (dataptr, itemptr, prop)
{
/* create button */
if (!(i % 9))
row = uiLayoutRow(col, FALSE);
subblock = uiLayoutGetBlock(row);
overlap = uiLayoutOverlap(row);
uiBlockSetFlag(subblock, UI_BLOCK_LIST_ITEM);
/* list item behind label & other buttons */
sub = uiLayoutRow(overlap, FALSE);
but = uiDefButR_prop(subblock, LISTROW, 0, "", 0, 0, UI_UNIT_X * 10, UI_UNIT_Y,
active_dataptr, activeprop, 0, 0, i, 0, 0, "");
uiButSetFlag(but, UI_BUT_NO_TOOLTIP);
sub = uiLayoutRow(overlap, FALSE);
icon = UI_rnaptr_icon_get(C, &itemptr, rnaicon, false);
draw_item(ui_list, C, sub, dataptr, &itemptr, icon, active_dataptr, active_propname, i);
/* If we are "drawing" active item, set all labels as active. */
if (i == activei) {
ui_layout_list_set_labels_active(sub);
}
i++;
}
RNA_PROP_END;
}
break;
break;
}
}

@ -1735,18 +1735,16 @@ static void widget_state_numslider(uiWidgetType *wt, int state)
/* labels use theme colors for text */
static void widget_state_option_menu(uiWidgetType *wt, int state)
{
bTheme *btheme = UI_GetTheme(); /* XXX */
/* call this for option button */
widget_state(wt, state);
/* if not selected we get theme from menu back */
if (state & UI_SELECT)
UI_GetThemeColor4ubv(TH_TEXT_HI, (unsigned char *)wt->wcol.text);
else {
bTheme *btheme = UI_GetTheme(); /* XXX */
copy_v3_v3_char(wt->wcol.text, btheme->tui.wcol_menu_back.text_sel);
else
copy_v3_v3_char(wt->wcol.text, btheme->tui.wcol_menu_back.text);
}
}

@ -898,6 +898,7 @@ void ui_theme_init_default(void)
rgba_char_args_set(btheme->tseq.transition, 162, 95, 111, 255);
rgba_char_args_set(btheme->tseq.meta, 109, 145, 131, 255);
rgba_char_args_set(btheme->tseq.preview_back, 0, 0, 0, 255);
rgba_char_args_set(btheme->tseq.grid, 64, 64, 64, 255);
/* space image */
btheme->tima = btheme->tv3d;
@ -1014,17 +1015,24 @@ void ui_style_init_default(void)
void UI_SetTheme(int spacetype, int regionid)
{
if (spacetype == 0) { /* called for safety, when delete themes */
theme_active = U.themes.first;
theme_spacetype = SPACE_VIEW3D;
theme_regionid = RGN_TYPE_WINDOW;
}
else {
if (spacetype) {
/* later on, a local theme can be found too */
theme_active = U.themes.first;
theme_spacetype = spacetype;
theme_regionid = regionid;
}
else if (regionid) {
/* popups */
theme_active = U.themes.first;
theme_spacetype = SPACE_BUTS;
theme_regionid = regionid;
}
else {
/* for safety, when theme was deleted */
theme_active = U.themes.first;
theme_spacetype = SPACE_VIEW3D;
theme_regionid = RGN_TYPE_WINDOW;
}
}
bTheme *UI_GetTheme(void)

@ -2392,16 +2392,18 @@ static void deselect_nth_active(BMEditMesh *em, BMVert **r_eve, BMEdge **r_eed,
EDBM_selectmode_flush(em);
ele = BM_mesh_active_elem_get(em->bm);
switch (ele->head.htype) {
case BM_VERT:
*r_eve = (BMVert *)ele;
return;
case BM_EDGE:
*r_eed = (BMEdge *)ele;
return;
case BM_FACE:
*r_efa = (BMFace *)ele;
return;
if (ele) {
switch (ele->head.htype) {
case BM_VERT:
*r_eve = (BMVert *)ele;
return;
case BM_EDGE:
*r_eed = (BMEdge *)ele;
return;
case BM_FACE:
*r_efa = (BMFace *)ele;
return;
}
}
if (em->selectmode & SCE_SELECT_VERTEX) {
@ -3186,6 +3188,8 @@ static int edbm_loop_to_region_exec(bContext *C, wmOperator *op)
}
}
EDBM_selectmode_flush(em);
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
return OPERATOR_FINISHED;
}

@ -407,34 +407,6 @@ void MESH_OT_edge_collapse(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
static int edbm_collapse_edge_loop_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
BMEditMesh *em = BKE_editmesh_from_object(obedit);
if (!EDBM_op_callf(em, op, "dissolve_edge_loop edges=%he", BM_ELEM_SELECT))
return OPERATOR_CANCELLED;
EDBM_update_generic(em, true, true);
return OPERATOR_FINISHED;
}
void MESH_OT_edge_collapse_loop(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Edge Collapse Loop";
ot->description = "Collapse selected edge loops";
ot->idname = "MESH_OT_edge_collapse_loop";
/* api callbacks */
ot->exec = edbm_collapse_edge_loop_exec;
ot->poll = ED_operator_editmesh;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
static int edbm_add_edge_face__smooth_get(BMesh *bm)
{
BMEdge *e;

@ -180,7 +180,6 @@ void MESH_OT_colors_rotate(struct wmOperatorType *ot);
void MESH_OT_colors_reverse(struct wmOperatorType *ot);
void MESH_OT_delete(struct wmOperatorType *ot);
void MESH_OT_edge_collapse(struct wmOperatorType *ot);
void MESH_OT_edge_collapse_loop(struct wmOperatorType *ot);
void MESH_OT_faces_shade_smooth(struct wmOperatorType *ot);
void MESH_OT_faces_shade_flat(struct wmOperatorType *ot);
void MESH_OT_split(struct wmOperatorType *ot);

@ -119,7 +119,6 @@ void ED_operatortypes_mesh(void)
WM_operatortype_append(MESH_OT_delete);
WM_operatortype_append(MESH_OT_edge_collapse);
WM_operatortype_append(MESH_OT_edge_collapse_loop);
WM_operatortype_append(MESH_OT_separate);
WM_operatortype_append(MESH_OT_dupli_extrude_cursor);

@ -2941,6 +2941,13 @@ static int vertex_group_poll(bContext *C)
return (ob && !ob->id.lib && OB_TYPE_SUPPORT_VGROUP(ob->type) && data && !data->lib);
}
static int vertex_group_mesh_poll(bContext *C)
{
Object *ob = ED_object_context(C);
ID *data = (ob) ? ob->data : NULL;
return (ob && !ob->id.lib && ob->type == OB_MESH && data && !data->lib);
}
static int UNUSED_FUNCTION(vertex_group_poll_edit) (bContext *C)
{
Object *ob = ED_object_context(C);
@ -2953,7 +2960,7 @@ static int UNUSED_FUNCTION(vertex_group_poll_edit) (bContext *C)
}
/* editmode _or_ weight paint vertex sel */
static int vertex_group_poll_edit_or_wpaint_vert_select(bContext *C)
static int vertex_group_vert_select_poll(bContext *C)
{
Object *ob = ED_object_context(C);
ID *data = (ob) ? ob->data : NULL;
@ -2965,6 +2972,45 @@ static int vertex_group_poll_edit_or_wpaint_vert_select(bContext *C)
vgroup_object_in_wpaint_vert_select(ob));
}
/* editmode _or_ weight paint vertex sel and active group unlocked */
static int vertex_group_vert_select_unlocked_poll(bContext *C)
{
Object *ob = ED_object_context(C);
ID *data = (ob) ? ob->data : NULL;
if (!(ob && !ob->id.lib && data && !data->lib))
return 0;
if (!(vgroup_object_in_edit_mode(ob) ||
vgroup_object_in_wpaint_vert_select(ob))) {
return 0;
}
if (ob->actdef != -1) {
bDeformGroup *dg = BLI_findlink(&ob->defbase, ob->actdef - 1);
if (dg) {
return !(dg->flag & DG_LOCK_WEIGHT);
}
}
return 0;
}
static int vertex_group_vert_select_mesh_poll(bContext *C)
{
Object *ob = ED_object_context(C);
ID *data = (ob) ? ob->data : NULL;
if (!(ob && !ob->id.lib && data && !data->lib))
return 0;
/* only difference to #vertex_group_vert_select_poll */
if (ob->type != OB_MESH)
return 0;
return (vgroup_object_in_edit_mode(ob) ||
vgroup_object_in_wpaint_vert_select(ob));
}
static int vertex_group_add_exec(bContext *C, wmOperator *UNUSED(op))
{
Object *ob = ED_object_context(C);
@ -3049,10 +3095,10 @@ void OBJECT_OT_vertex_group_assign(wmOperatorType *ot)
/* identifiers */
ot->name = "Assign Vertex Group";
ot->idname = "OBJECT_OT_vertex_group_assign";
ot->description = "Assign the selected vertices to the current (or a new) vertex group";
ot->description = "Assign the selected vertices to the active (or a new) vertex group";
/* api callbacks */
ot->poll = vertex_group_poll_edit_or_wpaint_vert_select;
ot->poll = vertex_group_vert_select_unlocked_poll;
ot->exec = vertex_group_assign_exec;
/* flags */
@ -3100,7 +3146,7 @@ void OBJECT_OT_vertex_group_remove_from(wmOperatorType *ot)
ot->description = "Remove the selected vertices from active or all vertex group(s)";
/* api callbacks */
ot->poll = vertex_group_poll_edit_or_wpaint_vert_select;
ot->poll = vertex_group_vert_select_unlocked_poll;
ot->exec = vertex_group_remove_from_exec;
/* flags */
@ -3137,7 +3183,7 @@ void OBJECT_OT_vertex_group_select(wmOperatorType *ot)
ot->description = "Select all the vertices assigned to the active vertex group";
/* api callbacks */
ot->poll = vertex_group_poll_edit_or_wpaint_vert_select;
ot->poll = vertex_group_vert_select_poll;
ot->exec = vertex_group_select_exec;
/* flags */
@ -3162,7 +3208,7 @@ void OBJECT_OT_vertex_group_deselect(wmOperatorType *ot)
ot->description = "Deselect all selected vertices assigned to the active vertex group";
/* api callbacks */
ot->poll = vertex_group_poll_edit_or_wpaint_vert_select;
ot->poll = vertex_group_vert_select_poll;
ot->exec = vertex_group_deselect_exec;
/* flags */
@ -3336,7 +3382,7 @@ void OBJECT_OT_vertex_group_fix(wmOperatorType *ot)
"groups' weights (this tool may be slow for many vertices)";
/* api callbacks */
ot->poll = vertex_group_poll;
ot->poll = vertex_group_mesh_poll;
ot->exec = vertex_group_fix_exec;
/* flags */
@ -4101,11 +4147,33 @@ static void vgroup_copy_active_to_sel_single(Object *ob, const int def_nr)
}
}
static int vertex_weight_paste(bContext *C, wmOperator *op)
static bool check_vertex_group_accessible(wmOperator *op, Object *ob, int def_nr)
{
bDeformGroup *dg = BLI_findlink(&ob->defbase, def_nr);
if (!dg) {
BKE_report(op->reports, RPT_ERROR, "Invalid Weight Group Index");
return true;
}
if (dg->flag & DG_LOCK_WEIGHT) {
BKE_report(op->reports, RPT_ERROR, "Weight Group is locked");
return true;
}
return false;
}
static int vertex_weight_paste_exec(bContext *C, wmOperator *op)
{
Object *ob = ED_object_context(C);
const int wg_index = RNA_int_get(op->ptr, "weight_group");
vgroup_copy_active_to_sel_single(ob, wg_index);
const int def_nr = RNA_int_get(op->ptr, "weight_group");
if (!check_vertex_group_accessible(op, ob, def_nr)) {
return OPERATOR_CANCELLED;
}
vgroup_copy_active_to_sel_single(ob, def_nr);
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob);
@ -4119,25 +4187,30 @@ void OBJECT_OT_vertex_weight_paste(wmOperatorType *ot)
ot->name = "Paste weight to Selected";
ot->idname = "OBJECT_OT_vertex_weight_paste";
ot->description = "Copy this group's weight to other selected verts";
ot->description = "Copy this group's weight to other selected verts (disabled if vertex Group is locked)";
/* api callbacks */
ot->poll = vertex_group_vert_select_mesh_poll;
ot->exec = vertex_weight_paste_exec;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
prop = RNA_def_int(ot->srna, "weight_group", -1, -1, INT_MAX, "Weight Index",
"Index of source weight in active Weight Group", -1, INT_MAX);
RNA_def_property_flag(prop, PROP_SKIP_SAVE | PROP_HIDDEN);
/* api callbacks */
ot->poll = vertex_group_poll;
ot->exec = vertex_weight_paste;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
static int vertex_weight_delete(bContext *C, wmOperator *op)
static int vertex_weight_delete_exec(bContext *C, wmOperator *op)
{
Object *ob = ED_object_context(C);
const int wg_index = RNA_int_get(op->ptr, "weight_group");
vgroup_remove_weight(ob, wg_index);
const int def_nr = RNA_int_get(op->ptr, "weight_group");
if (check_vertex_group_accessible(op, ob, def_nr)) {
return OPERATOR_CANCELLED;
}
vgroup_remove_weight(ob, def_nr);
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob);
@ -4151,21 +4224,21 @@ void OBJECT_OT_vertex_weight_delete(wmOperatorType *ot)
ot->name = "Delete Weight";
ot->idname = "OBJECT_OT_vertex_weight_delete";
ot->description = "Delete this weight from the vertex";
ot->description = "Delete this weight from the vertex (disabled if vertex Group is locked)";
/* api callbacks */
ot->poll = vertex_group_vert_select_mesh_poll;
ot->exec = vertex_weight_delete_exec;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
prop = RNA_def_int(ot->srna, "weight_group", -1, -1, INT_MAX, "Weight Index",
"Index of source weight in active Weight Group", -1, INT_MAX);
RNA_def_property_flag(prop, PROP_SKIP_SAVE | PROP_HIDDEN);
/* api callbacks */
ot->poll = vertex_group_poll;
ot->exec = vertex_weight_delete;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
static int vertex_weight_set_active(bContext *C, wmOperator *op)
static int vertex_weight_set_active_exec(bContext *C, wmOperator *op)
{
Object *ob = ED_object_context(C);
const int wg_index = RNA_int_get(op->ptr, "weight_group");
@ -4187,19 +4260,19 @@ void OBJECT_OT_vertex_weight_set_active(wmOperatorType *ot)
ot->idname = "OBJECT_OT_vertex_weight_set_active";
ot->description = "Set as active Vertex Group";
prop = RNA_def_int(ot->srna, "weight_group", -1, -1, INT_MAX, "Weight Index",
"Index of source weight in active Weight Group", -1, INT_MAX);
RNA_def_property_flag(prop, PROP_SKIP_SAVE | PROP_HIDDEN);
/* api callbacks */
ot->poll = vertex_group_poll;
ot->exec = vertex_weight_set_active;
ot->poll = vertex_group_vert_select_mesh_poll;
ot->exec = vertex_weight_set_active_exec;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
prop = RNA_def_int(ot->srna, "weight_group", -1, -1, INT_MAX, "Weight Index",
"Index of source weight in active Weight Group", -1, INT_MAX);
RNA_def_property_flag(prop, PROP_SKIP_SAVE | PROP_HIDDEN);
}
static int vertex_weight_normalize_active_vertex(bContext *C, wmOperator *UNUSED(op))
static int vertex_weight_normalize_active_vertex_exec(bContext *C, wmOperator *UNUSED(op))
{
Object *ob = ED_object_context(C);
ToolSettings *ts = CTX_data_tool_settings(C);
@ -4221,14 +4294,14 @@ void OBJECT_OT_vertex_weight_normalize_active_vertex(wmOperatorType *ot)
ot->description = "Normalize Active Vert Weights";
/* api callbacks */
ot->poll = vertex_group_poll;
ot->exec = vertex_weight_normalize_active_vertex;
ot->poll = vertex_group_vert_select_mesh_poll;
ot->exec = vertex_weight_normalize_active_vertex_exec;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
static int vertex_weight_copy(bContext *C, wmOperator *UNUSED(op))
static int vertex_weight_copy_exec(bContext *C, wmOperator *UNUSED(op))
{
Object *ob = ED_object_context(C);
ToolSettings *ts = CTX_data_tool_settings(C);
@ -4250,8 +4323,8 @@ void OBJECT_OT_vertex_weight_copy(wmOperatorType *ot)
ot->description = "Copy weights from Active to selected";
/* api callbacks */
ot->poll = vertex_group_poll;
ot->exec = vertex_weight_copy;
ot->poll = vertex_group_vert_select_mesh_poll;
ot->exec = vertex_weight_copy_exec;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;

@ -1635,23 +1635,17 @@ void ED_screen_full_restore(bContext *C, ScrArea *sa)
if (sl->next) {
/* specific checks for space types */
int sima_restore = 0;
/* Special check added for non-render image window (back from fullscreen through "Back to Previous" button) */
if (sl->spacetype == SPACE_IMAGE) {
SpaceImage *sima = sa->spacedata.first;
if (!(sima->flag & SI_PREVSPACE) && !(sima->flag & SI_FULLWINDOW))
sima_restore = 1;
}
if (sl->spacetype == SPACE_IMAGE && !sima_restore) {
SpaceImage *sima = sa->spacedata.first;
if (sima->flag & SI_PREVSPACE)
if(sima->flag & (SI_PREVSPACE|SI_FULLWINDOW)) {
sima->flag &= ~SI_PREVSPACE;
if (sima->flag & SI_FULLWINDOW) {
sima->flag &= ~SI_FULLWINDOW;
ED_screen_full_prevspace(C, sa);
}
else
ED_screen_full_toggle(C, win, sa);
}
else if (sl->spacetype == SPACE_FILE) {
ED_screen_full_prevspace(C, sa);

@ -254,6 +254,13 @@ static void screenshot_draw(bContext *UNUSED(C), wmOperator *op)
uiDefAutoButsRNA(layout, &ptr, screenshot_draw_check_prop, '\0');
}
static int screenshot_poll(bContext *C)
{
if (G.background)
return false;
return WM_operator_winactive(C);
}
void SCREEN_OT_screenshot(wmOperatorType *ot)
{
@ -266,7 +273,7 @@ void SCREEN_OT_screenshot(wmOperatorType *ot)
ot->exec = screenshot_exec;
ot->cancel = screenshot_cancel;
ot->ui = screenshot_draw;
ot->poll = WM_operator_winactive;
ot->poll = screenshot_poll;
ot->flag = 0;

@ -50,6 +50,7 @@ set(SRC
paint_undo.c
paint_utils.c
paint_vertex.c
paint_vertex_proj.c
sculpt.c
sculpt_undo.c
sculpt_uv.c

@ -1121,6 +1121,44 @@ static void screen_px_from_persp(
interp_v3_v3v3v3(pixelScreenCo, v1co, v2co, v3co, w);
}
/* same as screen_px_from_persp except we return ortho weights back to the caller.
* These weights will be used to determine correct interpolation of uvs in cloned uv layer */
static void screen_px_from_persp_ortho_weights(
float uv[2],
float v1co[4], float v2co[4], float v3co[4], /* screenspace coords */
float uv1co[2], float uv2co[2], float uv3co[2],
float pixelScreenCo[4],
float w[3])
{
float w_int[3];
float wtot_inv, wtot;
barycentric_weights_v2(uv1co, uv2co, uv3co, uv, w);
/* re-weight from the 4th coord of each screen vert */
w_int[0] = w[0] * v1co[3];
w_int[1] = w[1] * v2co[3];
w_int[2] = w[2] * v3co[3];
wtot = w_int[0] + w_int[1] + w_int[2];
if (wtot > 0.0f) {
wtot_inv = 1.0f / wtot;
w_int[0] *= wtot_inv;
w_int[1] *= wtot_inv;
w_int[2] *= wtot_inv;
}
else {
w[0] = w[1] = w[2] =
w_int[0] = w_int[1] = w_int[2] = 1.0f / 3.0f; /* dummy values for zero area face */
}
/* done re-weighting */
/* do interpolation based on projected weight */
interp_v3_v3v3v3(pixelScreenCo, v1co, v2co, v3co, w_int);
}
static void project_face_pixel(const MTFace *tf_other, ImBuf *ibuf_other, const float w[3],
int side, unsigned char rgba_ub[4], float rgba_f[4])
{
@ -2168,6 +2206,7 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i
float uv_clip[8][2];
int uv_clip_tot;
const short is_ortho = ps->is_ortho;
const short is_clone_other = ((ps->brush->imagepaint_tool == PAINT_TOOL_CLONE) && ps->dm_mtface_clone);
const short do_backfacecull = ps->do_backfacecull;
const short do_clip = ps->rv3d ? ps->rv3d->rflag & RV3D_CLIPPING : 0;
@ -2191,8 +2230,6 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i
* but since the first thing most people try is painting onto a quad- better make it work.
*/
tf_uv_pxoffset[0][0] = tf->uv[0][0] - xhalfpx;
tf_uv_pxoffset[0][1] = tf->uv[0][1] - yhalfpx;
@ -2277,7 +2314,8 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i
has_x_isect = has_isect = 1;
if (is_ortho) screen_px_from_ortho(uv, v1coSS, v2coSS, v3coSS, uv1co, uv2co, uv3co, pixelScreenCo, w);
else screen_px_from_persp(uv, v1coSS, v2coSS, v3coSS, uv1co, uv2co, uv3co, pixelScreenCo, w);
else if (is_clone_other) screen_px_from_persp_ortho_weights(uv, v1coSS, v2coSS, v3coSS, uv1co, uv2co, uv3co, pixelScreenCo, w);
else screen_px_from_persp(uv, v1coSS, v2coSS, v3coSS, uv1co, uv2co, uv3co, pixelScreenCo, w);
/* a pity we need to get the worldspace pixel location here */
if (do_clip || do_3d_mapping) {

@ -54,6 +54,7 @@ struct wmOperator;
struct wmOperatorType;
struct ImagePaintState;
struct wmWindowManager;
struct DMCoNo;
enum PaintMode;
/* paint_stroke.c */
@ -115,6 +116,20 @@ void PAINT_OT_vertex_paint(struct wmOperatorType *ot);
unsigned int vpaint_get_current_col(struct VPaint *vp);
/* paint_vertex_proj.c */
struct VertProjHandle;
struct VertProjHandle *ED_vpaint_proj_handle_create(
struct Scene *scene, struct Object *ob,
struct DMCoNo **r_vcosnos);
void ED_vpaint_proj_handle_update(
struct VertProjHandle *vp_handle,
/* runtime vars */
struct ARegion *ar, const float mval_fl[2]);
void ED_vpaint_proj_handle_free(
struct VertProjHandle *vp_handle);
/* paint_image.c */
typedef struct ImagePaintPartialRedraw {
int x1, y1, x2, y2; /* XXX, could use 'rcti' */

@ -29,24 +29,11 @@
* \ingroup edsculpt
*/
#include <math.h>
#include <string.h>
#ifdef WIN32
#include <io.h>
#else
#include <unistd.h>
#endif
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_math_color.h"
#include "BLI_memarena.h"
#include "BLI_utildefines.h"
#include "BLI_ghash.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
@ -57,14 +44,12 @@
#include "DNA_scene_types.h"
#include "DNA_brush_types.h"
#include "DNA_object_types.h"
#include "DNA_meshdata_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
#include "BKE_DerivedMesh.h"
#include "BKE_armature.h"
#include "BKE_action.h"
#include "BKE_brush.h"
#include "BKE_context.h"
@ -87,7 +72,7 @@
#include "ED_screen.h"
#include "ED_view3d.h"
#include "paint_intern.h"
#include "paint_intern.h" /* own include */
/* check if we can do partial updates and have them draw realtime
* (without rebuilding the 'derivedFinal') */
@ -2135,7 +2120,10 @@ struct WPaintData {
int *indexar;
int vgroup_active;
int vgroup_mirror;
void *vp_handle;
DMCoNo *vertexcosnos;
float wpimat[3][3];
/* variables for auto normalize */
@ -2244,7 +2232,8 @@ static int wpaint_stroke_test_start(bContext *C, wmOperator *op, const float UNU
}
/* painting on subsurfs should give correct points too, this returns me->totvert amount */
wpd->vertexcosnos = mesh_get_mapped_verts_nors(scene, ob);
wpd->vp_handle = ED_vpaint_proj_handle_create(scene, ob, &wpd->vertexcosnos);
wpd->indexar = get_indexarray(me);
copy_wpaint_prev(wp, me->dvert, me->totvert);
@ -2378,6 +2367,9 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
indexar = NULL;
}
/* incase we have modifiers */
ED_vpaint_proj_handle_update(wpd->vp_handle, vc->ar, mval);
/* make sure each vertex gets treated only once */
/* and calculate filter weight */
totw = 0.0f;
@ -2516,8 +2508,7 @@ static void wpaint_stroke_done(const bContext *C, struct PaintStroke *stroke)
struct WPaintData *wpd = paint_stroke_mode_data(stroke);
if (wpd) {
if (wpd->vertexcosnos)
MEM_freeN(wpd->vertexcosnos);
ED_vpaint_proj_handle_free(wpd->vp_handle);
MEM_freeN(wpd->indexar);
if (wpd->vgroup_validmap)
@ -2750,7 +2741,10 @@ typedef struct VPaintData {
ViewContext vc;
unsigned int paintcol;
int *indexar;
struct VertProjHandle *vp_handle;
DMCoNo *vertexcosnos;
float vpimat[3][3];
/* modify 'me->mcol' directly, since the derived mesh is drawing from this
@ -2829,7 +2823,8 @@ static int vpaint_stroke_test_start(bContext *C, struct wmOperator *op, const fl
paint_stroke_set_mode_data(stroke, vpd);
view3d_set_viewcontext(C, &vpd->vc);
vpd->vertexcosnos = mesh_get_mapped_verts_nors(vpd->vc.scene, ob);
vpd->vp_handle = ED_vpaint_proj_handle_create(vpd->vc.scene, ob, &vpd->vertexcosnos);
vpd->indexar = get_indexarray(me);
vpd->paintcol = vpaint_get_current_col(vp);
@ -3027,6 +3022,9 @@ static void vpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
swap_m4m4(vc->rv3d->persmat, mat);
/* incase we have modifiers */
ED_vpaint_proj_handle_update(vpd->vp_handle, vc->ar, mval);
/* clear modified tag for blur tool */
if (vpd->mlooptag)
memset(vpd->mlooptag, 0, sizeof(bool) * me->totloop);
@ -3072,8 +3070,7 @@ static void vpaint_stroke_done(const bContext *C, struct PaintStroke *stroke)
ViewContext *vc = &vpd->vc;
Object *ob = vc->obact;
if (vpd->vertexcosnos)
MEM_freeN(vpd->vertexcosnos);
ED_vpaint_proj_handle_free(vpd->vp_handle);
MEM_freeN(vpd->indexar);
/* frees prev buffer */

@ -0,0 +1,242 @@
/*
* ***** 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* The Original Code is Copyright (C) 2013 Blender Foundation.
* All rights reserved.
*
*
* Contributor(s): Blender Foundation
*
* ***** END GPL LICENSE BLOCK *****
*/
/** \file blender/editors/sculpt_paint/paint_vertex_proj.c
* \ingroup edsculpt
*
* Utility functions for getting vertex locations while painting
* (since they may be instanced multiple times in a DerivedMesh)
*/
#include "MEM_guardedalloc.h"
#include "BLI_math.h"
#include "DNA_mesh_types.h"
#include "DNA_object_types.h"
#include "BKE_DerivedMesh.h"
#include "BKE_context.h"
#include "ED_screen.h"
#include "ED_view3d.h"
#include "paint_intern.h" /* own include */
/* Opaque Structs for internal use */
/* stored while painting */
struct VertProjHandle {
DMCoNo *vcosnos;
bool use_update;
/* use for update */
float *dists;
Object *ob;
Scene *scene;
};
/* only for passing to the callbacks */
struct VertProjUpdate {
struct VertProjHandle *vp_handle;
/* runtime */
ARegion *ar;
const float *mval_fl;
};
/* -------------------------------------------------------------------- */
/* Internal Init */
static void vpaint_proj_dm_map_cosnos_init__map_cb(void *userData, int index, const float co[3],
const float no_f[3], const short no_s[3])
{
struct VertProjHandle *vp_handle = userData;
DMCoNo *co_no = &vp_handle->vcosnos[index];
/* check if we've been here before (normal should not be 0) */
if (!is_zero_v3(co_no->no)) {
/* remember that multiple dm verts share the same source vert */
vp_handle->use_update = true;
return;
}
copy_v3_v3(co_no->co, co);
if (no_f) {
copy_v3_v3(co_no->no, no_f);
}
else {
normal_short_to_float_v3(co_no->no, no_s);
}
}
static void vpaint_proj_dm_map_cosnos_init(Scene *scene, Object *ob,
struct VertProjHandle *vp_handle)
{
Mesh *me = ob->data;
DerivedMesh *dm;
dm = mesh_get_derived_final(scene, ob, CD_MASK_BAREMESH | CD_MASK_ORIGINDEX);
if (dm->foreachMappedVert) {
memset(vp_handle->vcosnos, 0, sizeof(DMCoNo) * me->totvert);
dm->foreachMappedVert(dm, vpaint_proj_dm_map_cosnos_init__map_cb, vp_handle);
}
else {
DMCoNo *v_co_no = vp_handle->vcosnos;
int a;
for (a = 0; a < me->totvert; a++, v_co_no++) {
dm->getVertCo(dm, a, v_co_no->co);
dm->getVertNo(dm, a, v_co_no->no);
}
}
dm->release(dm);
}
/* -------------------------------------------------------------------- */
/* Internal Update */
/* Same as init but take mouse location into account */
static void vpaint_proj_dm_map_cosnos_update__map_cb(void *userData, int index, const float co[3],
const float no_f[3], const short no_s[3])
{
struct VertProjUpdate *vp_update = userData;
struct VertProjHandle *vp_handle = vp_update->vp_handle;
DMCoNo *co_no = &vp_handle->vcosnos[index];
/* find closest vertex */
{
/* first find distance to this vertex */
float co_ss[2]; /* screenspace */
if (ED_view3d_project_float_object(vp_update->ar,
co, co_ss,
V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_NEAR) == V3D_PROJ_RET_OK)
{
const float dist = len_squared_v2v2(vp_update->mval_fl, co_ss);
if (dist > vp_handle->dists[index]) {
/* bail out! */
return;
}
vp_handle->dists[index] = dist;
}
}
/* continue with regular functionality */
copy_v3_v3(co_no->co, co);
if (no_f) {
copy_v3_v3(co_no->no, no_f);
}
else {
normal_short_to_float_v3(co_no->no, no_s);
}
}
static void vpaint_proj_dm_map_cosnos_update(struct VertProjHandle *vp_handle,
ARegion *ar, const float mval_fl[2])
{
struct VertProjUpdate vp_update = {vp_handle, ar, mval_fl};
Scene *scene = vp_handle->scene;
Object *ob = vp_handle->ob;
Mesh *me = ob->data;
DerivedMesh *dm;
/* quick sanity check - we shouldn't have to run this if there are no modifiers */
BLI_assert(ob->modifiers.first != NULL);
dm = mesh_get_derived_final(scene, ob, CD_MASK_BAREMESH | CD_MASK_ORIGINDEX);
/* highly unlikely this will become unavailable once painting starts (perhaps with animated modifiers) */
if (LIKELY(dm->foreachMappedVert)) {
fill_vn_fl(vp_handle->dists, me->totvert, FLT_MAX);
dm->foreachMappedVert(dm, vpaint_proj_dm_map_cosnos_update__map_cb, &vp_update);
}
dm->release(dm);
}
/* -------------------------------------------------------------------- */
/* Public Functions */
struct VertProjHandle *ED_vpaint_proj_handle_create(Scene *scene, Object *ob,
DMCoNo **r_vcosnos)
{
struct VertProjHandle *vp_handle = MEM_mallocN(sizeof(struct VertProjHandle), __func__);
Mesh *me = ob->data;
/* setup the handle */
vp_handle->vcosnos = MEM_mallocN(sizeof(DMCoNo) * me->totvert, "vertexcosnos map");
vp_handle->use_update = false;
/* sets 'use_update' if needed */
vpaint_proj_dm_map_cosnos_init(scene, ob, vp_handle);
if (vp_handle->use_update) {
vp_handle->dists = MEM_mallocN(sizeof(float) * me->totvert, __func__);
vp_handle->ob = ob;
vp_handle->scene = scene;
}
else {
vp_handle->dists = NULL;
vp_handle->ob = NULL;
vp_handle->scene = NULL;
}
*r_vcosnos = vp_handle->vcosnos;
return vp_handle;
}
void ED_vpaint_proj_handle_update(struct VertProjHandle *vp_handle,
ARegion *ar, const float mval_fl[2])
{
if (vp_handle->use_update) {
vpaint_proj_dm_map_cosnos_update(vp_handle, ar, mval_fl);
}
}
void ED_vpaint_proj_handle_free(struct VertProjHandle *vp_handle)
{
if (vp_handle->use_update) {
MEM_freeN(vp_handle->dists);
}
MEM_freeN(vp_handle->vcosnos);
MEM_freeN(vp_handle);
}

@ -1528,6 +1528,7 @@ static void do_multires_smooth_brush(Sculpt *sd, SculptSession *ss, PBVHNode *no
float *tmpgrid_mask, *tmprow_mask;
int v1, v2, v3, v4;
int thread_num;
BLI_bitmap *grid_hidden;
int *grid_indices, totgrid, gridsize, i, x, y;
sculpt_brush_test_init(ss, &test);
@ -1538,6 +1539,8 @@ static void do_multires_smooth_brush(Sculpt *sd, SculptSession *ss, PBVHNode *no
NULL, &gridsize, &griddata, &gridadj);
BKE_pbvh_get_grid_key(ss->pbvh, &key);
grid_hidden = BKE_pbvh_grid_hidden(ss->pbvh);
thread_num = 0;
#ifdef _OPENMP
if (sd->flags & SCULPT_USE_OPENMP)
@ -1549,8 +1552,10 @@ static void do_multires_smooth_brush(Sculpt *sd, SculptSession *ss, PBVHNode *no
tmprow_mask = ss->cache->tmprow_mask[thread_num];
for (i = 0; i < totgrid; ++i) {
data = griddata[grid_indices[i]];
adj = &gridadj[grid_indices[i]];
int gi = grid_indices[i];
BLI_bitmap gh = grid_hidden[gi];
data = griddata[gi];
adj = &gridadj[gi];
if (smooth_mask)
memset(tmpgrid_mask, 0, sizeof(float) * gridsize * gridsize);
@ -1611,6 +1616,11 @@ static void do_multires_smooth_brush(Sculpt *sd, SculptSession *ss, PBVHNode *no
float *mask;
int index;
if (gh) {
if (BLI_BITMAP_GET(gh, y * gridsize + x))
continue;
}
if (x == 0 && adj->index[0] == -1)
continue;

@ -446,7 +446,7 @@ void uiTemplateMarker(uiLayout *layout, PointerRNA *ptr, const char *propname, P
else
tip = TIP_("Marker is enabled at current frame");
uiDefButBitI(block, OPTIONN, MARKER_DISABLED, B_MARKER_FLAG, IFACE_("Enabled"), 10, 190, 145, 19,
uiDefButBitI(block, OPTIONN, MARKER_DISABLED, B_MARKER_FLAG, IFACE_("Enabled"), 0.5 * UI_UNIT_X, 9.5 * UI_UNIT_Y, 7.25 * UI_UNIT_X, UI_UNIT_Y,
&cb->marker_flag, 0, 0, 0, 0, tip);
col = uiLayoutColumn(layout, TRUE);
@ -455,33 +455,33 @@ void uiTemplateMarker(uiLayout *layout, PointerRNA *ptr, const char *propname, P
block = uiLayoutAbsoluteBlock(col);
uiBlockBeginAlign(block);
uiDefBut(block, LABEL, 0, IFACE_("Position:"), 0, 190, 300, 19, NULL, 0, 0, 0, 0, "");
uiDefButF(block, NUM, B_MARKER_POS, IFACE_("X:"), 10, 171, 145, 19, &cb->marker_pos[0],
uiDefBut(block, LABEL, 0, IFACE_("Position:"), 0, 10 * UI_UNIT_Y, 15 * UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, "");
uiDefButF(block, NUM, B_MARKER_POS, IFACE_("X:"), 0.5 * UI_UNIT_X, 9 * UI_UNIT_Y, 7.25 * UI_UNIT_X, UI_UNIT_Y, &cb->marker_pos[0],
-10 * width, 10.0 * width, step, digits, TIP_("X-position of marker at frame in screen coordinates"));
uiDefButF(block, NUM, B_MARKER_POS, IFACE_("Y:"), 165, 171, 145, 19, &cb->marker_pos[1],
uiDefButF(block, NUM, B_MARKER_POS, IFACE_("Y:"), 8.25 * UI_UNIT_X, 9 * UI_UNIT_Y, 7.25 * UI_UNIT_X, UI_UNIT_Y, &cb->marker_pos[1],
-10 * height, 10.0 * height, step, digits,
TIP_("Y-position of marker at frame in screen coordinates"));
uiDefBut(block, LABEL, 0, IFACE_("Offset:"), 0, 152, 300, 19, NULL, 0, 0, 0, 0, "");
uiDefButF(block, NUM, B_MARKER_OFFSET, IFACE_("X:"), 10, 133, 145, 19, &cb->track_offset[0],
uiDefBut(block, LABEL, 0, IFACE_("Offset:"), 0, 8 * UI_UNIT_Y, 15 * UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, "");
uiDefButF(block, NUM, B_MARKER_OFFSET, IFACE_("X:"), 0.5 * UI_UNIT_X, 7 * UI_UNIT_Y, 7.25 * UI_UNIT_X, UI_UNIT_Y, &cb->track_offset[0],
-10 * width, 10.0 * width, step, digits, TIP_("X-offset to parenting point"));
uiDefButF(block, NUM, B_MARKER_OFFSET, IFACE_("Y:"), 165, 133, 145, 19, &cb->track_offset[1],
uiDefButF(block, NUM, B_MARKER_OFFSET, IFACE_("Y:"), 8.25 * UI_UNIT_X, 7 * UI_UNIT_Y, 7.25 * UI_UNIT_X, UI_UNIT_Y, &cb->track_offset[1],
-10 * height, 10.0 * height, step, digits, TIP_("Y-offset to parenting point"));
uiDefBut(block, LABEL, 0, IFACE_("Pattern Area:"), 0, 114, 300, 19, NULL, 0, 0, 0, 0, "");
uiDefButF(block, NUM, B_MARKER_PAT_DIM, IFACE_("Width:"), 10, 95, 300, 19, &cb->marker_pat[0], 3.0f,
uiDefBut(block, LABEL, 0, IFACE_("Pattern Area:"), 0, 6 * UI_UNIT_Y, 15 * UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, "");
uiDefButF(block, NUM, B_MARKER_PAT_DIM, IFACE_("Width:"), 0.5 * UI_UNIT_X, 5 * UI_UNIT_Y, 15 * UI_UNIT_X, UI_UNIT_Y, &cb->marker_pat[0], 3.0f,
10.0 * width, step, digits, TIP_("Width of marker's pattern in screen coordinates"));
uiDefButF(block, NUM, B_MARKER_PAT_DIM, IFACE_("Height:"), 10, 76, 300, 19, &cb->marker_pat[1], 3.0f,
uiDefButF(block, NUM, B_MARKER_PAT_DIM, IFACE_("Height:"), 0.5 * UI_UNIT_X, 4 * UI_UNIT_Y, 15 * UI_UNIT_X, UI_UNIT_Y, &cb->marker_pat[1], 3.0f,
10.0 * height, step, digits, TIP_("Height of marker's pattern in screen coordinates"));
uiDefBut(block, LABEL, 0, IFACE_("Search Area:"), 0, 57, 300, 19, NULL, 0, 0, 0, 0, "");
uiDefButF(block, NUM, B_MARKER_SEARCH_POS, IFACE_("X:"), 10, 38, 145, 19, &cb->marker_search_pos[0],
uiDefBut(block, LABEL, 0, IFACE_("Search Area:"), 0, 3 * UI_UNIT_Y, 15 * UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, "");
uiDefButF(block, NUM, B_MARKER_SEARCH_POS, IFACE_("X:"), 0.5 * UI_UNIT_X, 2 * UI_UNIT_Y, 7.25 * UI_UNIT_X, UI_UNIT_Y, &cb->marker_search_pos[0],
-width, width, step, digits, TIP_("X-position of search at frame relative to marker's position"));
uiDefButF(block, NUM, B_MARKER_SEARCH_POS, IFACE_("Y:"), 165, 38, 145, 19, &cb->marker_search_pos[1],
uiDefButF(block, NUM, B_MARKER_SEARCH_POS, IFACE_("Y:"), 8.25 * UI_UNIT_X, 2 * UI_UNIT_Y, 7.25 * UI_UNIT_X, UI_UNIT_Y, &cb->marker_search_pos[1],
-height, height, step, digits, TIP_("Y-position of search at frame relative to marker's position"));
uiDefButF(block, NUM, B_MARKER_SEARCH_DIM, IFACE_("Width:"), 10, 19, 300, 19, &cb->marker_search[0], 3.0f,
uiDefButF(block, NUM, B_MARKER_SEARCH_DIM, IFACE_("Width:"), 0.5 * UI_UNIT_X, 1 * UI_UNIT_Y, 15 * UI_UNIT_X, UI_UNIT_Y, &cb->marker_search[0], 3.0f,
10.0 * width, step, digits, TIP_("Width of marker's search in screen coordinates"));
uiDefButF(block, NUM, B_MARKER_SEARCH_DIM, IFACE_("Height:"), 10, 0, 300, 19, &cb->marker_search[1], 3.0f,
uiDefButF(block, NUM, B_MARKER_SEARCH_DIM, IFACE_("Height:"), 0.5 * UI_UNIT_X, 0 * UI_UNIT_Y, 15 * UI_UNIT_X, UI_UNIT_Y, &cb->marker_search[1], 3.0f,
10.0 * height, step, digits, TIP_("Height of marker's search in screen coordinates"));
uiBlockEndAlign(block);

@ -316,7 +316,7 @@ void clip_draw_dopesheet_channels(const bContext *C, ARegion *ar)
*/
y = (float) CHANNEL_FIRST;
BLF_size(fontid, 11.0f, U.dpi);
BLF_size(fontid, 11.0f * U.pixelsize, U.dpi);
for (channel = dopesheet->channels.first; channel; channel = channel->next) {
float yminc = (float) (y - CHANNEL_HEIGHT_HALF);

@ -775,7 +775,7 @@ static void graph_panel_modifiers(const bContext *C, Panel *pa)
* a menu might be nicer but would be tricky as we need some custom filtering
*/
uiDefButO(block, BUT, "GRAPH_OT_fmodifier_add", WM_OP_INVOKE_REGION_WIN, IFACE_("Add Modifier"),
10, 0, 150, 20, TIP_("Adds a new F-Curve Modifier for the active F-Curve"));
0.5 * UI_UNIT_X, 0, 7.5 * UI_UNIT_X, UI_UNIT_Y, TIP_("Adds a new F-Curve Modifier for the active F-Curve"));
/* copy/paste (as sub-row)*/
row = uiLayoutRow(row, TRUE);

@ -831,13 +831,16 @@ static void view3d_main_area_listener(bScreen *sc, ScrArea *sa, ARegion *ar, wmN
break;
case NC_LAMP:
switch (wmn->data) {
case ND_LIGHTING_DRAW:
case ND_LIGHTING:
if ((v3d->drawtype == OB_MATERIAL) ||
(v3d->drawtype == OB_TEXTURE && (scene->gm.matmode == GAME_MAT_GLSL)))
{
ED_region_tag_redraw(ar);
}
break;
case ND_LIGHTING_DRAW:
ED_region_tag_redraw(ar);
break;
}
break;
case NC_IMAGE:

@ -839,13 +839,13 @@ static void view3d_panel_vgroup(const bContext *C, Panel *pa)
const bool *vgroup_validmap;
eVGroupSelect subset_type = ts->vgroupsubset;
int yco = 0;
int locked = 0;
int lock_count = 0;
uiBlockSetHandleFunc(block, do_view3d_vgroup_buttons, NULL);
bcol = uiLayoutColumn(pa->layout, true);
row = uiLayoutRow(bcol, true); /* The filter button row */
RNA_pointer_create(NULL, &RNA_ToolSettings, ts, &tools_ptr);
uiItemR(row, &tools_ptr, "vertex_group_subset", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
@ -853,11 +853,14 @@ static void view3d_panel_vgroup(const bContext *C, Panel *pa)
vgroup_validmap = ED_vgroup_subset_from_select_type(ob, subset_type, &vgroup_tot, &subset_count);
for (i = 0, dg = ob->defbase.first; dg; i++, dg = dg->next) {
bool locked = dg->flag & DG_LOCK_WEIGHT;
if (vgroup_validmap[i]) {
MDeformWeight *dw = defvert_find_index(dv, i);
if (dw) {
int x, xco = 0;
row = uiLayoutRow(col, true);
int icon;
uiLayout *split = uiLayoutSplit(col, 0.45, true);
row = uiLayoutRow(split, true);
/* The Weight Group Name */
@ -872,15 +875,17 @@ static void view3d_panel_vgroup(const bContext *C, Panel *pa)
}
xco += x;
row = uiLayoutRow(split, true);
uiLayoutSetEnabled(row, !locked);
/* The weight group value */
/* To be reworked still */
but = uiDefButF(block, NUM, B_VGRP_PNL_EDIT_SINGLE + i, "",
xco, yco, (x = UI_UNIT_X * 4), UI_UNIT_Y,
&dw->weight, 0.0, 1.0, 1, 3, "");
uiButSetFlag(but, UI_TEXT_LEFT);
if (dg->flag & DG_LOCK_WEIGHT) {
uiButSetFlag(but, UI_BUT_DISABLED);
locked++;
if (locked) {
lock_count++;
}
xco += x;
@ -889,14 +894,16 @@ static void view3d_panel_vgroup(const bContext *C, Panel *pa)
ot = ot_weight_paste;
WM_operator_properties_create_ptr(&op_ptr, ot);
RNA_int_set(&op_ptr, "weight_group", i);
uiItemFullO_ptr(row, ot, "", ICON_PASTEDOWN, op_ptr.data, WM_OP_INVOKE_DEFAULT, 0);
icon = (locked) ? ICON_BLANK1:ICON_PASTEDOWN;
uiItemFullO_ptr(row, ot, "", icon, op_ptr.data, WM_OP_INVOKE_DEFAULT, 0);
/* The weight entry delete function */
ot = ot_weight_delete;
WM_operator_properties_create_ptr(&op_ptr, ot);
RNA_int_set(&op_ptr, "weight_group", i);
uiItemFullO_ptr(row, ot, "", ICON_X, op_ptr.data, WM_OP_INVOKE_DEFAULT, 0);
icon = (locked) ? ICON_LOCKED:ICON_X;
uiItemFullO_ptr(row, ot, "", icon, op_ptr.data, WM_OP_INVOKE_DEFAULT, 0);
yco -= UI_UNIT_Y;
@ -914,14 +921,17 @@ static void view3d_panel_vgroup(const bContext *C, Panel *pa)
but = uiDefButO_ptr(block, BUT, ot, WM_OP_EXEC_DEFAULT, "Normalize",
0, yco, UI_UNIT_X * 5, UI_UNIT_Y,
TIP_("Normalize weights of active vertex (if affected groups are unlocked"));
if (locked) {
if (lock_count) {
uiButSetFlag(but, UI_BUT_DISABLED);
}
ot = WM_operatortype_find("OBJECT_OT_vertex_weight_copy", 1);
but = uiDefButO_ptr(block, BUT, ot, WM_OP_EXEC_DEFAULT, "Copy",
UI_UNIT_X * 5, yco, UI_UNIT_X * 5, UI_UNIT_Y,
TIP_("Copy active vertex to other selected verts"));
TIP_("Copy active vertex to other selected verts (if affected groups are unlocked)"));
if (lock_count) {
uiButSetFlag(but, UI_BUT_DISABLED);
}
}
}

@ -136,10 +136,7 @@ static void rna_Lamp_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
Lamp *la = ptr->id.data;
DAG_id_tag_update(&la->id, 0);
if (scene->gm.matmode == GAME_MAT_GLSL)
WM_main_add_notifier(NC_LAMP | ND_LIGHTING_DRAW, la);
else
WM_main_add_notifier(NC_LAMP | ND_LIGHTING, la);
WM_main_add_notifier(NC_LAMP | ND_LIGHTING, la);
}
static void rna_Lamp_draw_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)

@ -74,13 +74,14 @@ static int validate_array_type(PyObject *seq, int dim, int totdim, int dimsize[]
/* not the last dimension */
if (dim + 1 < totdim) {
/* check that a sequence contains dimsize[dim] items */
const Py_ssize_t seq_size = PySequence_Size(seq);
const int seq_size = PySequence_Size(seq);
if (seq_size == -1) {
PyErr_Format(PyExc_ValueError, "%s sequence expected at dimension %d, not '%s'",
error_prefix, (int)dim + 1, Py_TYPE(seq)->tp_name);
error_prefix, dim + 1, Py_TYPE(seq)->tp_name);
return -1;
}
for (i = 0; i < seq_size; i++) {
Py_ssize_t item_seq_size;
PyObject *item;
int ok = 1;
item = PySequence_GetItem(seq, i);
@ -90,7 +91,7 @@ static int validate_array_type(PyObject *seq, int dim, int totdim, int dimsize[]
error_prefix, Py_TYPE(seq)->tp_name, i);
ok = 0;
}
else if (!PySequence_Check(item)) {
else if ((item_seq_size = PySequence_Size(item)) == -1) {
/* BLI_snprintf(error_str, error_str_size, "expected a sequence of %s", item_type_str); */
PyErr_Format(PyExc_TypeError, "%s expected a sequence of %s, not %s",
error_prefix, item_type_str, Py_TYPE(item)->tp_name);
@ -101,12 +102,12 @@ static int validate_array_type(PyObject *seq, int dim, int totdim, int dimsize[]
* dimsize[2] = 5
*
* dim = 0 */
else if (PySequence_Size(item) != dimsize[dim + 1]) {
else if (item_seq_size != dimsize[dim + 1]) {
/* BLI_snprintf(error_str, error_str_size,
* "sequences of dimension %d should contain %d items",
* (int)dim + 1, (int)dimsize[dim + 1]); */
PyErr_Format(PyExc_ValueError, "%s sequences of dimension %d should contain %d items",
error_prefix, (int)dim + 1, (int)dimsize[dim + 1]);
* dim + 1, dimsize[dim + 1]); */
PyErr_Format(PyExc_ValueError, "%s sequences of dimension %d should contain %d items, not %d",
error_prefix, dim + 1, dimsize[dim + 1], item_seq_size);
ok = 0;
}
else if (validate_array_type(item, dim + 1, totdim, dimsize, check_item_type, item_type_str, error_prefix) == -1) {
@ -125,9 +126,15 @@ static int validate_array_type(PyObject *seq, int dim, int totdim, int dimsize[]
const int seq_size = PySequence_Size(seq);
if (seq_size == -1) {
PyErr_Format(PyExc_ValueError, "%s sequence expected at dimension %d, not '%s'",
error_prefix, (int)dim + 1, Py_TYPE(seq)->tp_name);
error_prefix, dim + 1, Py_TYPE(seq)->tp_name);
return -1;
}
else if (seq_size != dimsize[dim]) {
PyErr_Format(PyExc_ValueError, "%s sequences of dimension %d should contain %d items, not %d",
error_prefix, dim, dimsize[dim], seq_size);
return -1;
}
for (i = 0; i < seq_size; i++) {
PyObject *item = PySequence_GetItem(seq, i);

@ -157,6 +157,7 @@ static Render *envmap_render_copy(Render *re, EnvMap *env)
envre->r.yasp = envre->r.xasp = 1;
RE_InitState(envre, NULL, &envre->r, NULL, cuberes, cuberes, NULL);
envre->main = re->main;
envre->scene = re->scene; /* unsure about this... */
envre->scene_color_manage = re->scene_color_manage;
envre->lay = re->lay;

@ -411,6 +411,7 @@ void RE_FreeRender(Render *re)
/* main dbase can already be invalid now, some database-free code checks it */
re->main = NULL;
re->scene = NULL;
RE_Database_Free(re); /* view render can still have full database */
free_sample_tables(re);

@ -1922,7 +1922,7 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers)
if (CTX_wm_window(C) == NULL)
return action;
if (!ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE) && !ISTIMER(event->type)) {
if (!ELEM3(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE, EVENT_NONE) && !ISTIMER(event->type)) {
/* test for CLICK events */
if (wm_action_not_handled(action)) {

@ -1674,7 +1674,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar
uiItemStringO(col, IFACE_("Credits"), ICON_URL, "WM_OT_url_open", "url",
"http://www.blender.org/development/credits");
uiItemStringO(col, IFACE_("Release Log"), ICON_URL, "WM_OT_url_open", "url",
"http://www.blender.org/development/release-logs/blender-267");
"http://www.blender.org/development/release-logs/blender-268");
uiItemStringO(col, IFACE_("Manual"), ICON_URL, "WM_OT_url_open", "url",
"http://wiki.blender.org/index.php/Doc:2.6/Manual");
uiItemStringO(col, IFACE_("Blender Website"), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org");
@ -3021,7 +3021,7 @@ static void tweak_gesture_modal(bContext *C, const wmEvent *event)
}
break;
default:
if (!ISTIMER(event->type)) {
if (!ISTIMER(event->type) && event->type != EVENT_NONE) {
WM_gesture_end(C, gesture);
}
break;

@ -1363,7 +1363,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniformMatrix3,
#ifdef SORT_UNIFORMS
mat.getValue(matr);
mat.getValue3x3(matr);
SetUniformfv(loc, BL_Uniform::UNI_MAT3, matr, (sizeof(float)*9), (transp!=0) );
#else
SetUniform(loc,mat,(transp!=0));