Commits

Dean Giberson  committed e8355ed Merge

Merge remote-tracking branch 'upstream/master'

  • Participants
  • Parent commits 602c623, a425f3b

Comments (0)

Files changed (75)

File blender/CMakeLists.txt

 	if(WITH_OPENIMAGEIO)
 		set(OPENIMAGEIO ${LIBDIR}/openimageio)
 		set(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO}/include)
-		set(OPENIMAGEIO_LIBRARIES -force_load ${OPENIMAGEIO}/lib/libOpenImageIO.a ${PNG_LIBRARIES} ${JPEG_LIBRARIES} ${TIFF_LIBRARY} ${OPENEXR_LIBRARIES} ${ZLIB_LIBRARIES})
+		set(OPENIMAGEIO_LIBRARIES ${OPENIMAGEIO}/lib/libOpenImageIO.a ${PNG_LIBRARIES} ${JPEG_LIBRARIES} ${TIFF_LIBRARY} ${OPENEXR_LIBRARIES} ${ZLIB_LIBRARIES})
 		set(OPENIMAGEIO_LIBPATH ${OPENIMAGEIO}/lib ${JPEG_LIBPATH} ${PNG_LIBPATH} ${TIFF_LIBPATH} ${OPENEXR_LIBPATH} ${ZLIB_LIBPATH})
 		set(OPENIMAGEIO_DEFINITIONS "-DOIIO_STATIC_BUILD")
 	endif()

File blender/doc/python_api/examples/bpy.types.Operator.4.py

         return {'FINISHED'}
 
     def invoke(self, context, event):
-        context.window_manager.fileselect_add(self)
-        return {'RUNNING_MODAL'}
+        wm = context.window_manager
+        return wm.invoke_props_dialog(self)
 
     def draw(self, context):
         layout = self.layout

File blender/doc/python_api/examples/bpy.types.Operator.5.py

         elif event.type == 'LEFTMOUSE':  # Confirm
             return {'FINISHED'}
         elif event.type in ('RIGHTMOUSE', 'ESC'):  # Cancel
+            context.object.location.x = self.init_loc_x
             return {'CANCELLED'}
 
         return {'RUNNING_MODAL'}
 
     def invoke(self, context, event):
+        self.init_loc_x = context.object.location.x
         self.value = event.mouse_x
         self.execute(context)
 
-        print(context.window_manager.modal_handler_add(self))
+        context.window_manager.modal_handler_add(self)
         return {'RUNNING_MODAL'}
 
 

File blender/release/scripts/modules/bl_i18n_utils/spell_check_utils.py

     "catmull",
     "catrom",
     "chebychev",
+    "courant",
     "kutta",
     "lennard",
     "minkowski",

File blender/release/scripts/modules/console_python.py

     sc = context.space_data
     lines = [
         "import bpy",
-        "import bpy.context as C",
-        "import bpy.data as D",
+        "from bpy import data as D",
+        "from bpy import context as C",
         "from mathutils import *",
         "from math import *",
         "",

File blender/release/scripts/startup/bl_operators/wm.py

         # in case a new module path was created to install this addon.
         bpy.utils.refresh_script_paths()
 
-        # TODO, should not be a warning.
-        #~ self.report({'WARNING'}, "File installed to '%s'\n" % path_dest)
+        # print message
+        msg = "File %r installed into %r\n" % (pyfile, path_dest)
+        self.report({'INFO'}, msg)
+        print(msg)
+
         return {'FINISHED'}
 
     def invoke(self, context, event):

File blender/release/scripts/startup/bl_ui/properties_object_constraint.py

         row.prop(con, "use_transform_limit")
         row.label()
 
+        self.space_template(layout, con)
+
     def STRETCH_TO(self, context, layout, con):
         self.target_template(layout, con)
 

File blender/release/scripts/templates/ui_panel.py

         row.prop(scene, "frame_end")
 
         # Create an row where the buttons are aligned to each other.
-        layout.label(text=" Aligned Row")
+        layout.label(text=" Aligned Row:")
 
         row = layout.row(align=True)
         row.prop(scene, "frame_start")
 
         # Second column, aligned
         col = split.column(align=True)
-        col.label(text="Column Two")
+        col.label(text="Column Two:")
         col.prop(scene, "frame_start")
         col.prop(scene, "frame_end")
+        
+        # Big render button
+        layout.label(text="Big Button:")
+        row = layout.row()
+        row.scale_y = 3.0
+        row.operator("render.render")
+        
+        # Different sizes in a row
+        layout.label(text="Different button sizes:")
+        row = layout.row(align=True)
+        row.operator("render.render")
+        
+        sub = row.row()
+        sub.scale_x = 2.0
+        sub.operator("render.render")
+        
+        row.operator("render.render")
 
 
 def register():

File blender/source/blender/blenfont/BLF_api.h

  * of the string, using the default font and both value
  * are multiplied by the aspect of the font.
  */
+void  BLF_width_and_height_default(const char *str, float *width, float *height);
 float BLF_width_default(const char *str);
 float BLF_height_default(const char *str);
 

File blender/source/blender/blenfont/intern/blf.c

 int blf_mono_font = -1;
 int blf_mono_font_render = -1;
 
-static FontBLF *BLF_get(int fontid)
+static FontBLF *blf_get(int fontid)
 {
 	if (fontid >= 0 && fontid < BLF_MAX_FONT)
 		return global_font[fontid];
 	return -1;
 }
 
+static int blf_global_font_init(void)
+{
+	if (global_font_default == -1) {
+		global_font_default = blf_search("default");
+	}
+
+	if (global_font_default == -1) {
+		printf("Warning: Can't find default font!\n");
+		return 0;
+	}
+	else {
+		return 1;
+	}
+}
+
 int BLF_load(const char *name)
 {
 	FontBLF *font;
 
 void BLF_metrics_attach(int fontid, unsigned char *mem, int mem_size)
 {
-	FontBLF *font = BLF_get(fontid);
+	FontBLF *font = blf_get(fontid);
 
 	if (font) {
 		blf_font_attach_from_mem(font, mem, mem_size);
 
 void BLF_enable(int fontid, int option)
 {
-	FontBLF *font = BLF_get(fontid);
+	FontBLF *font = blf_get(fontid);
 
 	if (font) {
 		font->flags |= option;
 
 void BLF_disable(int fontid, int option)
 {
-	FontBLF *font = BLF_get(fontid);
+	FontBLF *font = blf_get(fontid);
 
 	if (font) {
 		font->flags &= ~option;
 
 void BLF_enable_default(int option)
 {
-	FontBLF *font = BLF_get(global_font_default);
+	FontBLF *font = blf_get(global_font_default);
 
 	if (font) {
 		font->flags |= option;
 
 void BLF_disable_default(int option)
 {
-	FontBLF *font = BLF_get(global_font_default);
+	FontBLF *font = blf_get(global_font_default);
 
 	if (font) {
 		font->flags &= ~option;
 
 void BLF_aspect(int fontid, float x, float y, float z)
 {
-	FontBLF *font = BLF_get(fontid);
+	FontBLF *font = blf_get(fontid);
 
 	if (font) {
 		font->aspect[0] = x;
 
 void BLF_matrix(int fontid, const double m[16])
 {
-	FontBLF *font = BLF_get(fontid);
+	FontBLF *font = blf_get(fontid);
 
 	if (font) {
 		memcpy(font->m, m, sizeof(font->m));
 
 void BLF_position(int fontid, float x, float y, float z)
 {
-	FontBLF *font = BLF_get(fontid);
+	FontBLF *font = blf_get(fontid);
 
 	if (font) {
 		float xa, ya, za;
 
 void BLF_size(int fontid, int size, int dpi)
 {
-	FontBLF *font = BLF_get(fontid);
+	FontBLF *font = blf_get(fontid);
 
 	if (font) {
 		blf_font_size(font, size, dpi);
 
 void BLF_blur(int fontid, int size)
 {
-	FontBLF *font = BLF_get(fontid);
+	FontBLF *font = blf_get(fontid);
 
 	if (font) {
 		font->blur = size;
 	if (!str)
 		return;
 
-	if (global_font_default == -1)
-		global_font_default = blf_search("default");
-
-	if (global_font_default == -1) {
-		printf("Warning: Can't found default font!!\n");
+	if (!blf_global_font_init())
 		return;
-	}
 
 	BLF_size(global_font_default, global_font_points, global_font_dpi);
 	BLF_position(global_font_default, x, y, z);
 	if (!str)
 		return;
 
-	if (global_font_default == -1)
-		global_font_default = blf_search("default");
-
-	if (global_font_default == -1) {
-		printf("Warning: Can't found default font!!\n");
+	if (!blf_global_font_init())
 		return;
-	}
 
 	BLF_size(global_font_default, global_font_points, global_font_dpi);
 	BLF_position(global_font_default, x, y, z);
 
 void BLF_rotation_default(float angle)
 {
-	FontBLF *font = BLF_get(global_font_default);
+	FontBLF *font = blf_get(global_font_default);
 
 	if (font) {
 		font->angle = angle;
 
 void BLF_draw(int fontid, const char *str, size_t len)
 {
-	FontBLF *font = BLF_get(fontid);
+	FontBLF *font = blf_get(fontid);
 	GLint mode, param;
 
 	if (font && font->glyph_cache) {
 
 void BLF_draw_ascii(int fontid, const char *str, size_t len)
 {
-	FontBLF *font = BLF_get(fontid);
+	FontBLF *font = blf_get(fontid);
 	GLint mode, param;
 
 	if (font && font->glyph_cache) {
 
 void BLF_boundbox(int fontid, const char *str, rctf *box)
 {
-	FontBLF *font = BLF_get(fontid);
+	FontBLF *font = blf_get(fontid);
 
 	if (font) {
 		blf_font_boundbox(font, str, box);
 
 void BLF_width_and_height(int fontid, const char *str, float *width, float *height)
 {
-	FontBLF *font = BLF_get(fontid);
+	FontBLF *font = blf_get(fontid);
 
 	if (font && font->glyph_cache) {
 		blf_font_width_and_height(font, str, width, height);
 	}
+	else {
+		*width = *height = 0.0f;
+	}
+}
+
+void BLF_width_and_height_default(const char *str, float *width, float *height)
+{
+	if (!blf_global_font_init()) {
+		*width = *height = 0.0f;
+		return;
+	}
+
+	BLF_width_and_height(global_font_default, str, width, height);
 }
 
 float BLF_width(int fontid, const char *str)
 {
-	FontBLF *font = BLF_get(fontid);
+	FontBLF *font = blf_get(fontid);
 
 	if (font && font->glyph_cache) {
 		return blf_font_width(font, str);
 
 float BLF_fixed_width(int fontid)
 {
-	FontBLF *font = BLF_get(fontid);
+	FontBLF *font = blf_get(fontid);
 
 	if (font && font->glyph_cache) {
 		return blf_font_fixed_width(font);
 
 float BLF_width_default(const char *str)
 {
-	if (global_font_default == -1)
-		global_font_default = blf_search("default");
-
-	if (global_font_default == -1) {
-		printf("Error: Can't found default font!!\n");
+	if (!blf_global_font_init())
 		return 0.0f;
-	}
 
 	BLF_size(global_font_default, global_font_points, global_font_dpi);
 	return BLF_width(global_font_default, str);
 
 float BLF_height(int fontid, const char *str)
 {
-	FontBLF *font = BLF_get(fontid);
+	FontBLF *font = blf_get(fontid);
 
 	if (font && font->glyph_cache) {
 		return blf_font_height(font, str);
 
 float BLF_height_max(int fontid)
 {
-	FontBLF *font = BLF_get(fontid);
+	FontBLF *font = blf_get(fontid);
 
 	if (font && font->glyph_cache) {
 		return font->glyph_cache->max_glyph_height;
 
 float BLF_width_max(int fontid)
 {
-	FontBLF *font = BLF_get(fontid);
+	FontBLF *font = blf_get(fontid);
 
 	if (font && font->glyph_cache) {
 		return font->glyph_cache->max_glyph_width;
 
 float BLF_descender(int fontid)
 {
-	FontBLF *font = BLF_get(fontid);
+	FontBLF *font = blf_get(fontid);
 
 	if (font && font->glyph_cache) {
 		return font->glyph_cache->descender;
 
 float BLF_ascender(int fontid)
 {
-	FontBLF *font = BLF_get(fontid);
+	FontBLF *font = blf_get(fontid);
 
 	if (font && font->glyph_cache) {
 		return font->glyph_cache->ascender;
 
 float BLF_height_default(const char *str)
 {
-	if (global_font_default == -1)
-		global_font_default = blf_search("default");
-
-	if (global_font_default == -1) {
-		printf("Error: Can't found default font!!\n");
+	if (!blf_global_font_init())
 		return 0.0f;
-	}
 
 	BLF_size(global_font_default, global_font_points, global_font_dpi);
 
 
 void BLF_rotation(int fontid, float angle)
 {
-	FontBLF *font = BLF_get(fontid);
+	FontBLF *font = blf_get(fontid);
 
 	if (font) {
 		font->angle = angle;
 
 void BLF_clipping(int fontid, float xmin, float ymin, float xmax, float ymax)
 {
-	FontBLF *font = BLF_get(fontid);
+	FontBLF *font = blf_get(fontid);
 
 	if (font) {
 		font->clip_rec.xmin = xmin;
 
 void BLF_clipping_default(float xmin, float ymin, float xmax, float ymax)
 {
-	FontBLF *font = BLF_get(global_font_default);
+	FontBLF *font = blf_get(global_font_default);
 
 	if (font) {
 		font->clip_rec.xmin = xmin;
 
 void BLF_shadow(int fontid, int level, float r, float g, float b, float a)
 {
-	FontBLF *font = BLF_get(fontid);
+	FontBLF *font = blf_get(fontid);
 
 	if (font) {
 		font->shadow = level;
 
 void BLF_shadow_offset(int fontid, int x, int y)
 {
-	FontBLF *font = BLF_get(fontid);
+	FontBLF *font = blf_get(fontid);
 
 	if (font) {
 		font->shadow_x = x;
 
 void BLF_buffer(int fontid, float *fbuf, unsigned char *cbuf, int w, int h, int nch, struct ColorManagedDisplay *display)
 {
-	FontBLF *font = BLF_get(fontid);
+	FontBLF *font = blf_get(fontid);
 
 	if (font) {
 		font->buf_info.fbuf = fbuf;
 
 void BLF_buffer_col(int fontid, float r, float g, float b, float a)
 {
-	FontBLF *font = BLF_get(fontid);
+	FontBLF *font = blf_get(fontid);
 
 	if (font) {
 		font->buf_info.col[0] = r;
 
 void BLF_draw_buffer(int fontid, const char *str)
 {
-	FontBLF *font = BLF_get(fontid);
+	FontBLF *font = blf_get(fontid);
 
 	if (font && font->glyph_cache && (font->buf_info.fbuf || font->buf_info.cbuf)) {
 		blf_font_buffer(font, str);

File blender/source/blender/blenkernel/BKE_sequencer.h

 void BKE_sequence_iterator_next(SeqIterator *iter);
 void BKE_sequence_iterator_end(SeqIterator *iter);
 
-#define SEQP_BEGIN(ed, _seq)                                                  \
+#define SEQP_BEGIN(_ed, _seq)                                                 \
 	{                                                                         \
-		SeqIterator iter;                                                     \
-		for (BKE_sequence_iterator_begin(ed, &iter, 1);                       \
-		     iter.valid;                                                      \
-		     BKE_sequence_iterator_next(&iter))                               \
+		SeqIterator iter_macro;                                               \
+		for (BKE_sequence_iterator_begin(_ed, &iter_macro, 1);                \
+		     iter_macro.valid;                                                \
+		     BKE_sequence_iterator_next(&iter_macro))                         \
 		{                                                                     \
-			_seq = iter.seq;
+			_seq = iter_macro.seq;
 
 #define SEQ_BEGIN(ed, _seq)                                                   \
 	{                                                                         \
-		SeqIterator iter;                                                     \
-		for (BKE_sequence_iterator_begin(ed, &iter, 0);                       \
-		     iter.valid;                                                      \
-		     BKE_sequence_iterator_next(&iter))                               \
+		SeqIterator iter_macro;                                               \
+		for (BKE_sequence_iterator_begin(ed, &iter_macro, 0);                 \
+		     iter_macro.valid;                                                \
+		     BKE_sequence_iterator_next(&iter_macro))                         \
 		{                                                                     \
-			_seq = iter.seq;
+			_seq = iter_macro.seq;
 
 #define SEQ_END                                                               \
 		}                                                                     \
-		BKE_sequence_iterator_end(&iter);                                     \
+		BKE_sequence_iterator_end(&iter_macro);                               \
 	}
 
 typedef struct SeqRenderData {

File blender/source/blender/blenkernel/intern/brush.c

 }
 
 /* scale brush size to reflect a change in the brush's unprojected radius */
-void BKE_brush_scale_size(int *BKE_brush_size_get,
+void BKE_brush_scale_size(int *r_brush_size,
                           float new_unprojected_radius,
                           float old_unprojected_radius)
 {
 	/* avoid division by zero */
 	if (old_unprojected_radius != 0)
 		scale /= new_unprojected_radius;
-	(*BKE_brush_size_get) = (int)((float)(*BKE_brush_size_get) * scale);
+	(*r_brush_size) = (int)((float)(*r_brush_size) * scale);
 }
 
 /* Brush Painting */

File blender/source/blender/blenkernel/intern/curve.c

 	BevPoint *bevp2, *bevp1, *bevp0; /* standard for all make_bevel_list_3D_* funcs */
 	int nr;
 
-	float bevp0_tan[3], cross_tmp[3];
+	float bevp0_tan[3];
 
 	bevel_list_calc_bisect(bl);
 	if (bl->poly == -1) /* check its not cyclic */
 
 	nr = bl->nr;
 	while (nr--) {
+		float cross_tmp[3];
 		cross_v3_v3v3(cross_tmp, bevp1->tan, bevp1->dir);
 		cross_v3_v3v3(bevp1->tan, cross_tmp, bevp1->dir);
 		normalize_v3(bevp1->tan);

File blender/source/blender/blenkernel/intern/depsgraph.c

 	if (ob->type == OB_ARMATURE) {
 		if (ob->pose) {
 			bPoseChannel *pchan;
-			bConstraint *con;
 			
 			for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
 				for (con = pchan->constraints.first; con; con = con->next) {

File blender/source/blender/blenkernel/intern/effect.c

 
 #include "BLI_math.h"
 #include "BLI_blenlib.h"
+#include "BLI_noise.h"
 #include "BLI_jitter.h"
 #include "BLI_rand.h"
 #include "BLI_utildefines.h"

File blender/source/blender/blenkernel/intern/fmodifier.c

 #include "BLF_translation.h"
 
 #include "BLI_blenlib.h"
+#include "BLI_noise.h"
 #include "BLI_math.h" /* windows needs for M_PI */
 #include "BLI_utildefines.h"
 

File blender/source/blender/blenkernel/intern/implicit.c

 
 DO_INLINE float fbstar(float length, float L, float kb, float cb)
 {
-	float tempfb = kb * fb(length, L);
-
-	float fbstar = cb * (length - L);
+	float tempfb_fl = kb * fb(length, L);
+	float fbstar_fl = cb * (length - L);
 	
-	if (tempfb < fbstar)
-		return fbstar;
+	if (tempfb_fl < fbstar_fl)
+		return fbstar_fl;
 	else
-		return tempfb;		
+		return tempfb_fl;
 }
 
 // function to calculae bending spring force (taken from Choi & Co)
 DO_INLINE float fbstar_jacobi(float length, float L, float kb, float cb)
 {
-	float tempfb = kb * fb(length, L);
-	float fbstar = cb * (length - L);
+	float tempfb_fl = kb * fb(length, L);
+	float fbstar_fl = cb * (length - L);
 
-	if (tempfb < fbstar) {
+	if (tempfb_fl < fbstar_fl) {
 		return cb;
 	}
 	else {

File blender/source/blender/blenkernel/intern/mesh.c

 		MDisps *ld = CustomData_get(ldata, loopstart, CD_MDISPS);
 		MDisps *fd = CustomData_get(fdata, findex, CD_MDISPS);
 		float (*disps)[3] = fd->disps;
-		int i, tot = mf->v4 ? 4 : 3;
+		int tot = mf->v4 ? 4 : 3;
 		int side, corners;
 
 		if (CustomData_external_test(fdata, CD_MDISPS)) {

File blender/source/blender/blenkernel/intern/mesh_validate.c

 	}
 
 	for (i = 1; i < totvert; i++, mv++) {
-		int j;
 		int fix_normal = TRUE;
 
 		for (j = 0; j < 3; j++) {
 		MDeformVert *dv;
 		for (i = 0, dv = dverts; i < totvert; i++, dv++) {
 			MDeformWeight *dw;
-			unsigned int j;
 
 			for (j = 0, dw = dv->dw; j < dv->totweight; j++, dw++) {
 				/* note, greater then max defgroups is accounted for in our code, but not < 0 */
 {
 	CustomData edata;
 	EdgeHashIterator *ehi;
-	MPoly *mp = mesh->mpoly;
+	MPoly *mp;
 	MEdge *med, *med_orig;
 	EdgeHash *eh = BLI_edgehash_new();
 	int i, totedge, totpoly = mesh->totpoly;
 	}
 
 	/* mesh loops (bmesh only) */
-	for (i = 0; i < totpoly; i++, mp++) {
+	for (mp = mesh->mpoly, i = 0; i < totpoly; mp++, i++) {
 		MLoop *l = &mesh->mloop[mp->loopstart];
 		int j, l_prev = (l + (mp->totloop - 1))->v;
 		for (j = 0; j < mp->totloop; j++, l++) {
 	if (mesh->totpoly) {
 		/* second pass, iterate through all loops again and assign
 		 * the newly created edges to them. */
-		MPoly *mp = mesh->mpoly;
-		for (i = 0; i < mesh->totpoly; i++, mp++) {
+		for (mp = mesh->mpoly, i = 0; i < mesh->totpoly; mp++, i++) {
 			MLoop *l = &mesh->mloop[mp->loopstart];
 			MLoop *l_prev = (l + (mp->totloop - 1));
 			int j;

File blender/source/blender/blenkernel/intern/multires.c

 		int totlvl = ccgdm->multires.totlvl;
 		
 		if (lvl < totlvl) {
-			Mesh *me = ob->data;
 			DerivedMesh *lowdm, *cddm, *highdm;
 			CCGElem **highGridData, **lowGridData, **subGridData, **gridData, *diffGrid;
 			CCGKey highGridKey, lowGridKey;

File blender/source/blender/blenkernel/intern/object.c

 
 					if (so->treestore) {
 						TreeStoreElem *tselem = so->treestore->data;
-						int a;
-						for (a = 0; a < so->treestore->usedelem; a++, tselem++) {
+						int i;
+						for (i = 0; i < so->treestore->usedelem; i++, tselem++) {
 							if (tselem->id == (ID *)ob) tselem->id = NULL;
 						}
 					}

File blender/source/blender/blenkernel/intern/particle.c

 #include "DNA_dynamicpaint_types.h"
 
 #include "BLI_blenlib.h"
+#include "BLI_noise.h"
 #include "BLI_math.h"
 #include "BLI_utildefines.h"
 #include "BLI_kdtree.h"

File blender/source/blender/blenlib/BLI_blenlib.h

 
 #include "BLI_rect.h"
 
-#include "BLI_noise.h"
-
 #ifdef __cplusplus
 }
 #endif

File blender/source/blender/bmesh/intern/bmesh_queries.c

 }
 
 /**
+ * Returns whether or not a given edge is is part of a given loop.
+ */
+int BM_edge_in_loop(BMEdge *e, BMLoop *l)
+{
+	return (l->e == e || l->prev->e == e);
+}
+
+/**
  * Returns whether or not two vertices are in
  * a given edge
  */

File blender/source/blender/bmesh/intern/bmesh_queries.h

 int     BM_verts_in_face(BMesh *bm, BMFace *f, BMVert **varr, int len);
 
 int     BM_edge_in_face(BMFace *f, BMEdge *e);
+int     BM_edge_in_loop(BMEdge *e, BMLoop *l);
 
 int     BM_vert_in_edge(BMEdge *e, BMVert *v);
 int     BM_verts_in_edge(BMVert *v1, BMVert *v2, BMEdge *e);

File blender/source/blender/editors/armature/editarmature_retarget.c

 	ReebArcIterator arc_iter;
 	BArcIterator *iter = (BArcIterator *)&arc_iter;
 	RigEdge *edge;
-	EmbedBucket *bucket = NULL;
 	ReebNode *node_start, *node_end;
 	ReebArc *earc = iarc->link_mesh;
 	float angle_weight = 1.0; // GET FROM CONTEXT
 
 	/* equal number of joints and potential position, just fill them in */
 	if (nb_joints == earc->bcount) {
-		int i;
-		
 		/* init with first values */
 		for (i = 0; i < nb_joints; i++) {
 			best_positions[i] = i + 1;
 		MemoNode *result;
 #endif
 		float **positions_cache = MEM_callocN(sizeof(float *) * (nb_positions + 2), "positions cache");
-		int i;
 		
 		positions_cache[0] = node_start->p;
 		positions_cache[nb_positions + 1] = node_end->p;
 	{
 		float *no = NULL;
 		if (i < nb_joints) {
-			bucket = IT_peek(iter, best_positions[i]);
+			EmbedBucket *bucket = IT_peek(iter, best_positions[i]);
 			vec1 = bucket->p;
 			no = bucket->no;
 		}

File blender/source/blender/editors/armature/poseobject.c

 	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 	
 	/* properties */
-	RNA_def_int(ot->srna, "type", 0, 0, 10, "Bone Group Index", "", 0, INT_MAX);
+	RNA_def_int(ot->srna, "type", 0, 0, INT_MAX, "Bone Group Index", "", 0, 10);
 }
 
 

File blender/source/blender/editors/curve/editcurve.c

 	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 	
 	RNA_def_float_vector_xyz(ot->srna, "center", 3, NULL, -FLT_MAX, FLT_MAX, "Center", "Center in global view space", -FLT_MAX, FLT_MAX);
-	RNA_def_float_vector(ot->srna, "axis", 3, NULL, -1.0f, 1.0f, "Axis", "Axis in global view space", -FLT_MAX, FLT_MAX);
+	RNA_def_float_vector(ot->srna, "axis", 3, NULL, -FLT_MAX, FLT_MAX, "Axis", "Axis in global view space", -1.0f, 1.0f);
 }
 
 /***************** add vertex operator **********************/
 	/* flags */
 	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 
-	RNA_def_int(ot->srna, "nth", 2, 2, 100, "Nth Selection", "", 1, INT_MAX);
+	RNA_def_int(ot->srna, "nth", 2, 2, INT_MAX, "Nth Selection", "", 2, 100);
 }
 
 /********************** add duplicate operator *********************/

File blender/source/blender/editors/interface/interface_ops.c

 		     !BLI_ghashIterator_isDone(&ghi);
 		     BLI_ghashIterator_step(&ghi))
 		{
-			uiBut *but = BLI_ghashIterator_getKey(&ghi);
-			if (but && ui_editsource_uibut_match(&ui_editsource_info->but_orig, but)) {
+			uiBut *but_key = BLI_ghashIterator_getKey(&ghi);
+			if (but_key && ui_editsource_uibut_match(&ui_editsource_info->but_orig, but_key)) {
 				but_store = BLI_ghashIterator_getValue(&ghi);
 				break;
 			}

File blender/source/blender/editors/mask/mask_add.c

 				                                                          &tot_diff_point);
 
 				if (diff_points) {
-					int i, tot_point;
+					int j, tot_point;
 					unsigned int tot_feather_point;
 					float *feather_points = NULL, *points;
 
 						tot_point = tot_diff_point;
 					}
 
-					for (i = 0; i < tot_point - 1; i++) {
+					for (j = 0; j < tot_point - 1; j++) {
 						float cur_dist, a[2], b[2];
 
-						a[0] = points[2 * i] * scalex;
-						a[1] = points[2 * i + 1] * scaley;
+						a[0] = points[2 * j] * scalex;
+						a[1] = points[2 * j + 1] * scaley;
 
-						b[0] = points[2 * i + 2] * scalex;
-						b[1] = points[2 * i + 3] * scaley;
+						b[0] = points[2 * j + 2] * scalex;
+						b[1] = points[2 * j + 3] * scaley;
 
 						cur_dist = dist_to_line_segment_v2(co, a, b);
 
 						if (cur_dist < dist) {
 							if (tangent)
-								sub_v2_v2v2(tangent, &diff_points[2 * i + 2], &diff_points[2 * i]);
+								sub_v2_v2v2(tangent, &diff_points[2 * j + 2], &diff_points[2 * j]);
 
 							point_masklay = masklay;
 							point_spline = spline;
 							point = use_deform ? &spline->points[(cur_point - spline->points_deform)] : cur_point;
 							dist = cur_dist;
-							u = (float)i / tot_point;
+							u = (float)j / tot_point;
 
 						}
 					}

File blender/source/blender/editors/mask/mask_ops.c

 		customdata->uw = uw;
 
 		if (uw) {
-			float co[2];
+			float co_uw[2];
 			float weight_scalar = BKE_mask_point_weight_scalar(spline, point, uw->u);
 
 			customdata->weight = uw->w;
 			customdata->weight_scalar = weight_scalar;
-			BKE_mask_point_segment_co(spline, point, uw->u, co);
+			BKE_mask_point_segment_co(spline, point, uw->u, co_uw);
 			BKE_mask_point_normal(spline, point, uw->u, customdata->no);
 
-			madd_v2_v2v2fl(customdata->feather, co, customdata->no, uw->w * weight_scalar);
+			madd_v2_v2v2fl(customdata->feather, co_uw, customdata->no, uw->w * weight_scalar);
 		}
 		else {
 			BezTriple *bezt = &point->bezt;

File blender/source/blender/editors/mesh/editmesh_rip.c

 
 #include "mesh_intern.h"
 
-/* helper to find edge for edge_rip */
+/**
+ * helper to find edge for edge_rip,
+ *
+ * \param inset is used so we get some useful distance
+ * when comparing multiple edges that meet at the same
+ * point and would result in teh same distance.
+ */
+#define INSET_DEFAULT 0.00001f
 static float edbm_rip_rip_edgedist(ARegion *ar, float mat[][4],
-                                   const float co1[3], const float co2[3], const float mvalf[2])
+                                   const float co1[3], const float co2[3], const float mvalf[2],
+                                   const float inset)
 {
 	float vec1[2], vec2[2];
 
 	ED_view3d_project_float_v2_m4(ar, co1, vec1, mat);
 	ED_view3d_project_float_v2_m4(ar, co2, vec2, mat);
 
+	if (inset != 0.0f) {
+		const float dist = inset / len_v2v2(vec1, vec2);
+		interp_v2_v2v2(vec1, vec1, vec2, dist);
+		interp_v2_v2v2(vec2, vec2, vec1, dist);
+	}
+
 	/* TODO: use dist_squared_to_line_segment_v2() looks like we only ever use for comparison */
 	return dist_to_line_segment_v2(mvalf, vec1, vec2);
 }
 
+#if 0
+static float edbm_rip_rip_linedist(ARegion *ar, float mat[][4],
+                                   const float co1[3], const float co2[3], const float mvalf[2])
+{
+	float vec1[2], vec2[2];
+
+	ED_view3d_project_float_v2_m4(ar, co1, vec1, mat);
+	ED_view3d_project_float_v2_m4(ar, co2, vec2, mat);
+
+	return dist_to_line_v2(mvalf, vec1, vec2);
+}
+#endif
+
+/* calculaters a point along the loop tangent which can be used to measure against edges */
+static void edbm_calc_loop_co(BMLoop *l, float l_mid_co[3])
+{
+	BM_loop_calc_face_tangent(l, l_mid_co);
+
+	/* scale to average of surrounding edge size, only needs to be approx, but should
+	 * be roughly equivalent to the check below which uses the middle of the edge. */
+	mul_v3_fl(l_mid_co, (BM_edge_calc_length(l->e) + BM_edge_calc_length(l->prev->e)) / 2.0f);
+
+	add_v3_v3(l_mid_co, l->v->co);
+}
+
+
 static float edbm_rip_edge_side_measure(BMEdge *e, BMLoop *e_l,
                                         ARegion *ar,
                                         float projectMat[4][4], const float fmval[2])
 			totboundary_edge += (is_boundary != 0 || BM_edge_is_wire(e));
 			if (!BM_elem_flag_test(e, BM_ELEM_HIDDEN)) {
 				if (is_boundary == FALSE && BM_edge_is_manifold(e)) {
-					d = edbm_rip_rip_edgedist(ar, projectMat, e->v1->co, e->v2->co, fmval);
+					d = edbm_rip_rip_edgedist(ar, projectMat, e->v1->co, e->v2->co, fmval, INSET_DEFAULT);
 					if (d < dist) {
 						dist = d;
 						e2 = e;
 			}
 		}
 
+		/* if we are ripping a single vertex from 3 faces,
+		 * then measure the distance to the face corner as well as the edge */
+		if (BM_vert_face_count(v) == 3 &&
+		    BM_vert_edge_count(v) == 3)
+		{
+			BMEdge *e_all[3];
+			BMLoop *l_all[3];
+			int i1, i2;
+
+			BM_iter_as_array(bm, BM_EDGES_OF_VERT, v, (void **)e_all, 3);
+			BM_iter_as_array(bm, BM_LOOPS_OF_VERT, v, (void **)l_all, 3);
+
+			/* not do a loop similar to the one above, but test against loops */
+			for (i1 = 0; i1 < 3; i1++) {
+				/* consider wire as boundary for this purpose,
+				 * otherwise we can't a face away from a wire edge */
+				float l_mid_co[3];
+				l = l_all[i1];
+				edbm_calc_loop_co(l, l_mid_co);
+				d = edbm_rip_rip_edgedist(ar, projectMat, l->v->co, l_mid_co, fmval, INSET_DEFAULT);
+
+				if (d < dist) {
+					dist = d;
+
+					/* find the edge that is not in this loop */
+					e2 = NULL;
+					for (i2 = 0; i2 < 3; i2++) {
+						if (!BM_edge_in_loop(e_all[i2], l)) {
+							e2 = e_all[i2];
+							break;
+						}
+					}
+					BLI_assert(e2 != NULL);
+				}
+			}
+		}
 	}
 
 	/* should we go ahead with edge rip or do we need to do special case, split off vertex?:
 					BM_ITER_ELEM (l, &iter, vout[i], BM_LOOPS_OF_VERT) {
 						if (!BM_elem_flag_test(l->f, BM_ELEM_HIDDEN)) {
 							float l_mid_co[3];
-							BM_loop_calc_face_tangent(l, l_mid_co);
-
-							/* scale to average of surrounding edge size, only needs to be approx, but should
-							 * be roughly equivalent to the check below which uses the middle of the edge. */
-							mul_v3_fl(l_mid_co, (BM_edge_calc_length(l->e) + BM_edge_calc_length(l->prev->e)) / 2.0f);
-							add_v3_v3(l_mid_co, v->co);
+							edbm_calc_loop_co(l, l_mid_co);
 
-							d = edbm_rip_rip_edgedist(ar, projectMat, v->co, l_mid_co, fmval);
+							d = edbm_rip_rip_edgedist(ar, projectMat, v->co, l_mid_co, fmval, INSET_DEFAULT);
 
 							if (d < dist) {
 								dist = d;
 							float e_mid_co[3];
 							mid_v3_v3v3(e_mid_co, e->v1->co, e->v2->co);
 
-							d = edbm_rip_rip_edgedist(ar, projectMat, v->co, e_mid_co, fmval);
+							d = edbm_rip_rip_edgedist(ar, projectMat, v->co, e_mid_co, fmval, INSET_DEFAULT);
 
 							if (d < dist) {
 								dist = d;
 					add_v3_v3v3(l_corner_co, l_prev_co, l_next_co);
 					add_v3_v3(l_corner_co, l->v->co);
 
-					d = edbm_rip_rip_edgedist(ar, projectMat, l->v->co, l_corner_co, fmval);
+					d = edbm_rip_rip_edgedist(ar, projectMat, l->v->co, l_corner_co, fmval, INSET_DEFAULT);
 					if (d < dist) {
 						v_best = v;
 						dist = d;
 	BMEdge *e, *e2;
 	BMVert *v;
 	const int totedge_orig = bm->totedge;
-	int i;
 	float projectMat[4][4], fmval[3] = {event->mval[0], event->mval[1]};
 
-	int totedge;
-	int all_minifold;
-
 	EdgeLoopPair *eloop_pairs;
 
 	ED_view3d_ob_project_mat_get(rv3d, obedit, projectMat);
 
-	/* important this runs on the original selection, before tempering with tagging */
+	/* important this runs on the original selection, before tampering with tagging */
 	eloop_pairs = edbm_ripsel_looptag_helper(bm);
 
 	/* expand edge selection */
 	BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) {
+		int all_manifold;
+		int totedge_manifold;  /* manifold, visible edges */
+		int i;
+
 		e2 = NULL;
 		i = 0;
-		totedge = 0;
-		all_minifold = TRUE;
+		totedge_manifold = 0;
+		all_manifold = TRUE;
 		BM_ITER_ELEM (e, &eiter, v, BM_EDGES_OF_VERT) {
 
 			if (!BM_edge_is_wire(e) &&
 					e2 = e;
 					i++;
 				}
-				totedge++;
+				totedge_manifold++;
 			}
 
 			/** #BM_vert_other_disk_edge has no hidden checks so don't check hidden here */
-			if ((all_minifold == TRUE) && (BM_edge_is_manifold(e) == FALSE)) {
-				all_minifold = FALSE;
+			if ((all_manifold == TRUE) && (BM_edge_is_manifold(e) == FALSE)) {
+				all_manifold = FALSE;
 			}
 		}
 
 		/* single edge, extend */
 		if (i == 1 && e2->l) {
-			if ((totedge == 4) || (all_minifold == FALSE)) {
+			/* note: if the case of 3 edges has one change in loop stepping,
+			 * if this becomes more involved we may be better off splitting
+			 * the 3 edge case into its own else-if branch */
+			if ((totedge_manifold == 4 || totedge_manifold == 3) || (all_manifold == FALSE)) {
 				BMLoop *l_a = e2->l;
 				BMLoop *l_b = l_a->radial_next;
 
-				/* find the best face to follow, this what the edge won't point away from
+				/* find the best face to follow, this way the edge won't point away from
 				 * the mouse when there are more then 4 (takes the shortest face fan around) */
 				l = (edbm_rip_edge_side_measure(e2, l_a, ar, projectMat, fmval) <
 				     edbm_rip_edge_side_measure(e2, l_b, ar, projectMat, fmval)) ? l_a : l_b;
 				 * not crashing but adds duplicate edge. */
 				if (BM_edge_is_manifold(l->e)) {
 					l = l->radial_next;
-					l = BM_face_other_edge_loop(l->f, l->e, v);
+
+					if (totedge_manifold != 3)
+						l = BM_face_other_edge_loop(l->f, l->e, v);
 
 					if (l) {
 						BM_elem_flag_enable(l->e, BM_ELEM_TAG);

File blender/source/blender/editors/mesh/editmesh_select.c

 	/* flags */
 	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 
-	RNA_def_int(ot->srna, "nth", 2, 2, 100, "Nth Selection", "", 1, INT_MAX);
-	RNA_def_int(ot->srna, "offset", 0, 0, 100, "Offset", "", 0, INT_MAX);
+	RNA_def_int(ot->srna, "nth", 2, 2, INT_MAX, "Nth Selection", "", 2, 100);
+	RNA_def_int(ot->srna, "offset", 0, 0, INT_MAX, "Offset", "", 0, 100);
 }
 
 void em_setup_viewcontext(bContext *C, ViewContext *vc)

File blender/source/blender/editors/mesh/editmesh_tools.c

 #include "RNA_access.h"
 
 #include "BLI_blenlib.h"
+#include "BLI_noise.h"
 #include "BLI_math.h"
 #include "BLI_rand.h"
 
 	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 	
 	/* props */
-	RNA_def_float(ot->srna, "offset", 2.0f, 0.0f, 100.0f, "Offset", "", 0.0f, FLT_MAX);
-	RNA_def_int(ot->srna, "steps", 10, 0, 180, "Steps", "", 0, INT_MAX);
+	RNA_def_float(ot->srna, "offset", 2.0f, 0.0f, FLT_MAX, "Offset", "", 0.0f, 100.0f);
+	RNA_def_int(ot->srna, "steps", 10, 0, INT_MAX, "Steps", "", 0, 180);
 }
 
 /* generic extern called extruder */
 	/* flags */
 	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 
-	RNA_def_int(ot->srna, "repeat", 1, 1, 100, "Number of times to smooth the mesh", "", 1, INT_MAX);
+	RNA_def_int(ot->srna, "repeat", 1, 1, 1000, "Number of times to smooth the mesh", "", 1, 100);
 	RNA_def_boolean(ot->srna, "xaxis", 1, "X-Axis", "Smooth along the X axis");
 	RNA_def_boolean(ot->srna, "yaxis", 1, "Y-Axis", "Smooth along the Y axis");
 	RNA_def_boolean(ot->srna, "zaxis", 1, "Z-Axis", "Smooth along the Z axis");
 	RNA_def_float(ot->srna, "degrees", 90.0f, -FLT_MAX, FLT_MAX, "Degrees", "Degrees", -360.0f, 360.0f);
 
 	RNA_def_float_vector(ot->srna, "center", 3, NULL, -FLT_MAX, FLT_MAX, "Center", "Center in global view space", -FLT_MAX, FLT_MAX);
-	RNA_def_float_vector(ot->srna, "axis", 3, NULL, -1.0f, 1.0f, "Axis", "Axis in global view space", -FLT_MAX, FLT_MAX);
+	RNA_def_float_vector(ot->srna, "axis", 3, NULL, -FLT_MAX, FLT_MAX, "Axis", "Axis in global view space", -1.0f, 1.0f);
 
 }
 
 
 	RNA_def_float_vector(ot->srna, "center", 3, NULL, -FLT_MAX, FLT_MAX,
 	                     "Center", "Center in global view space", -FLT_MAX, FLT_MAX);
-	RNA_def_float_vector(ot->srna, "axis", 3, NULL, -1.0f, 1.0f,
-	                     "Axis", "Axis in global view space", -FLT_MAX, FLT_MAX);
+	RNA_def_float_vector(ot->srna, "axis", 3, NULL, -FLT_MAX, FLT_MAX,
+	                     "Axis", "Axis in global view space", -1.0f, 1.0f);
 }
 
 static int edbm_select_by_number_vertices_exec(bContext *C, wmOperator *op)
 	char *pblock[3] = {NULL, NULL, NULL}, *pb;
 	BMElemSort *sblock[3] = {NULL, NULL, NULL}, *sb;
 	int *map[3] = {NULL, NULL, NULL}, *mp;
-	int totelem[3] = {0, 0, 0}, tot;
-	int affected[3] = {0, 0, 0}, aff;
+	int totelem[3] = {0, 0, 0};
+	int affected[3] = {0, 0, 0};
 	int i, j;
 
 	if (!(types && flag && action))
 		if (pb && sb && !map[j]) {
 			char *p_blk;
 			BMElemSort *s_blk;
-			tot = totelem[j];
-			aff = affected[j];
+			int tot = totelem[j];
+			int aff = affected[j];
 
 			qsort(sb, aff, sizeof(BMElemSort), bmelemsort_comp);
 

File blender/source/blender/editors/object/object_shapekey.c

 	kb = BLI_findlink(&key->block, ob->shapenr - 1);
 
 	if (kb) {
-		int i1, i2;
-		float *fp1, *fp2;
-		float tvec[3];
 		char *tag_elem = MEM_callocN(sizeof(char) * kb->totelem, "shape_key_mirror");
 
 
 		if (ob->type == OB_MESH) {
 			Mesh *me = ob->data;
 			MVert *mv;
+			int i1, i2;
+			float *fp1, *fp2;
+			float tvec[3];
 
 			mesh_octree_table(ob, NULL, NULL, 's');
 

File blender/source/blender/editors/object/object_transform.c

 {
 	Main *bmain = CTX_data_main(C);
 	Scene *scene = CTX_data_scene(C);
-	float rsmat[3][3], tmat[3][3], obmat[3][3], iobmat[3][3], mat[4][4], scale;
-	int a, change = 1;
+	float rsmat[3][3], obmat[3][3], iobmat[3][3], mat[4][4], scale;
+	int change = 1;
 	
 	/* first check if we can execute */
 	CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects)
 			copy_v3_v3(mat[3], ob->loc);
 
 			if (!(apply_scale && apply_rot)) {
+				float tmat[3][3];
 				/* correct for scale and rotation that is still applied */
 				BKE_object_to_mat3(ob, obmat);
 				invert_m3_m3(iobmat, obmat);
 		if (ob->type == OB_MESH) {
 			Mesh *me = ob->data;
 			MVert *mvert;
+			int a;
 
 			if (apply_scale)
 				multiresModifier_scale_disp(scene, ob);
 			Nurb *nu;
 			BPoint *bp;
 			BezTriple *bezt;
+			int a;
 
 			scale = mat3_to_scale(rsmat);
 
 
 			/* offset other selected objects */
 			if (do_inverse_offset && (centermode != GEOMETRY_TO_ORIGIN)) {
+				CollectionPointerLink *ctx_link_other;
+
 				/* was the object data modified
 				 * note: the functions above must set 'cent' */
 				copy_v3_v3(centn, cent);
 				ignore_parent_tx(bmain, scene, ob);
 				
 				/* other users? */
-				CTX_DATA_BEGIN (C, Object *, ob_other, selected_editable_objects)
+				//CTX_DATA_BEGIN (C, Object *, ob_other, selected_editable_objects)
+				//{
+
+				/* use existing context looper */
+				for (ctx_link_other = ctx_data_list.first;
+				     ctx_link_other;
+				     ctx_link_other = ctx_link_other->next)
 				{
+					Object *ob_other = ctx_link_other->ptr.data;
+
 					if ((ob_other->flag & OB_DONE) == 0 &&
 					    ((ob->data && (ob->data == ob_other->data)) ||
 					     (ob->dup_group == ob_other->dup_group &&
 						ignore_parent_tx(bmain, scene, ob_other);
 					}
 				}
-				CTX_DATA_END;
+				//CTX_DATA_END;
 			}
 		}
 	}

File blender/source/blender/editors/object/object_vgroup.c

 static void vgroup_select_verts(Object *ob, int select)
 {
 	const int def_nr = ob->actdef - 1;
-	MDeformVert *dv;
 
 	if (!BLI_findlink(&ob->defbase, def_nr)) {
 		return;
 
 			BM_ITER_MESH (eve, &iter, em->bm, BM_VERTS_OF_MESH) {
 				if (!BM_elem_flag_test(eve, BM_ELEM_HIDDEN)) {
-					dv = CustomData_bmesh_get(&em->bm->vdata, eve->head.data, CD_MDEFORMVERT);
+					MDeformVert *dv = CustomData_bmesh_get(&em->bm->vdata, eve->head.data, CD_MDEFORMVERT);
 					if (defvert_find_index(dv, def_nr)) {
 						BM_vert_select_set(em->bm, eve, select);
 					}
 		Lattice *lt = vgroup_edit_lattice(ob);
 		
 		if (lt->dvert) {
+			MDeformVert *dv;
 			BPoint *bp;
 			int a, tot;
 			
 /* only in editmode */
 static void vgroup_assign_verts(Object *ob, const float weight)
 {
-	MDeformVert *dv;
 	const int def_nr = ob->actdef - 1;
 
 	if (!BLI_findlink(&ob->defbase, def_nr))
 			/* Go through the list of editverts and assign them */
 			BM_ITER_MESH (eve, &iter, em->bm, BM_VERTS_OF_MESH) {
 				if (BM_elem_flag_test(eve, BM_ELEM_SELECT)) {
+					MDeformVert *dv;
 					MDeformWeight *dw;
 					dv = CustomData_bmesh_get(&em->bm->vdata, eve->head.data, CD_MDEFORMVERT); /* can be NULL */
 					dw = defvert_verify_index(dv, def_nr);
 	}
 	else if (ob->type == OB_LATTICE) {
 		Lattice *lt = vgroup_edit_lattice(ob);
+		MDeformVert *dv;
 		BPoint *bp;
 		int a, tot;
 

File blender/source/blender/editors/physics/physics_pointcache.c

 	
 	for (pid=pidlist.first; pid; pid=pid->next) {
 		if (pid->cache == cache) {
-			PointCache *cache = BKE_ptcache_add(pid->ptcaches);
-			cache->step = pid->default_step;
-			*(pid->cache_ptr) = cache;
+			PointCache *cache_new = BKE_ptcache_add(pid->ptcaches);
+			cache_new->step = pid->default_step;
+			*(pid->cache_ptr) = cache_new;
 			break;
 		}
 	}

File blender/source/blender/editors/render/render_preview.c

 		
 		/* get rid of copied world */
 		BLI_remlink(&pr_main->world, sp->worldcopy);
-		BKE_world_free_ex(sp->worldcopy, FALSE);
+		BKE_world_free_ex(sp->worldcopy, TRUE); /* [#32865] - we need to unlink the texture copies, unlike for materials */
 		
 		properties = IDP_GetProperties((ID *)sp->worldcopy, FALSE);
 		if (properties) {

File blender/source/blender/editors/render/render_shading.c

 	ot->flag = OPTYPE_REGISTER; /* no undo since this doesnt modify the env-map */
 	
 	/* properties */
-	prop = RNA_def_float_array(ot->srna, "layout", 12, default_envmap_layout, 0.0f, 0.0f, "File layout", "Flat array describing the X,Y position of each cube face in the output image, where 1 is the size of a face - order is [+Z -Z +Y -X -Y +X] (use -1 to skip a face)", 0.0f, 0.0f);
+	prop = RNA_def_float_array(ot->srna, "layout", 12, default_envmap_layout, 0.0f, 0.0f,
+	                           "File layout",
+	                           "Flat array describing the X,Y position of each cube face in the output image, "
+	                           "where 1 is the size of a face - order is [+Z -Z +Y -X -Y +X] "
+	                           "(use -1 to skip a face)", 0.0f, 0.0f);
 	RNA_def_property_flag(prop, PROP_HIDDEN);
 
 	WM_operator_properties_filesel(ot, FOLDERFILE | IMAGEFILE | MOVIEFILE, FILE_SPECIAL, FILE_SAVE,

File blender/source/blender/editors/sculpt_paint/paint_cursor.c

 {
 	Scene *scene = CTX_data_scene(C);
 	Paint *paint = paint_get_active_from_context(C);
-	Brush *brush = paint_brush(paint);
 	float window[2];
 	int hit;
 
 	if (vc->obact->sculpt && vc->obact->sculpt->pbvh &&
 	    sculpt_stroke_get_location(C, location, window))
 	{
+		Brush *brush = paint_brush(paint);
 		*pixel_radius =
 		    project_brush_radius(vc,
 		                         BKE_brush_unprojected_radius_get(scene, brush),

File blender/source/blender/editors/sculpt_paint/paint_image.c

 			float (*outset_uv)[2] = ps->faceSeamUVs[face_index];
 			float insetCos[4][3]; /* inset face coords.  NOTE!!! ScreenSace for ortho, Worldspace in prespective view */
 
-			float fac;
 			float *vCoSS[4]; /* vertex screenspace coords */
 			
 			float bucket_clip_edges[2][2]; /* store the screenspace coords of the face, clipped by the bucket's screen aligned rectangle */
 									
 									/* test we're inside uvspace bucket and triangle bounds */
 									if (isect_point_quad_v2(uv, seam_subsection[0], seam_subsection[1], seam_subsection[2], seam_subsection[3])) {
+										float fac;
 										
 										/* We need to find the closest point along the face edge,
 										 * getting the screen_px_from_*** wont work because our actual location
 #if 1
 												/* get the UV on the line since we want to copy the pixels from there for bleeding */
 												float uv_close[2];
-												float fac = closest_to_line_v2(uv_close, uv, tf_uv_pxoffset[fidx1], tf_uv_pxoffset[fidx2]);
-												if      (fac < 0.0f) copy_v2_v2(uv_close, tf_uv_pxoffset[fidx1]);
-												else if (fac > 1.0f) copy_v2_v2(uv_close, tf_uv_pxoffset[fidx2]);
+												float uv_fac = closest_to_line_v2(uv_close, uv, tf_uv_pxoffset[fidx1], tf_uv_pxoffset[fidx2]);
+												if      (uv_fac < 0.0f) copy_v2_v2(uv_close, tf_uv_pxoffset[fidx1]);
+												else if (uv_fac > 1.0f) copy_v2_v2(uv_close, tf_uv_pxoffset[fidx2]);
 
 												if (side) {
 													barycentric_weights_v2(tf_uv_pxoffset[0], tf_uv_pxoffset[2], tf_uv_pxoffset[3], uv_close, w);
 #else											/* this is buggy with quads, don't use for now */
 
 												/* Cheat, we know where we are along the edge so work out the weights from that */
-												fac = fac1 + (fac * (fac2 - fac1));
+												uv_fac = fac1 + (uv_fac * (fac2 - fac1));
 
 												w[0] = w[1] = w[2] = 0.0;
 												if (side) {
-													w[fidx1 ? fidx1 - 1 : 0] = 1.0f - fac;
-													w[fidx2 ? fidx2 - 1 : 0] = fac;
+													w[fidx1 ? fidx1 - 1 : 0] = 1.0f - uv_fac;
+													w[fidx2 ? fidx2 - 1 : 0] = uv_fac;
 												}
 												else {
-													w[fidx1] = 1.0f - fac;
-													w[fidx2] = fac;
+													w[fidx1] = 1.0f - uv_fac;
+													w[fidx2] = uv_fac;
 												}
 #endif
 											}

File blender/source/blender/editors/sculpt_paint/paint_vertex.c

 		}
 		else {
 			/* reset the weights */
-			unsigned int i;
 			MDeformWeight *dw_old = odv->dw;
 			MDeformWeight *dw_new = ndv->dw;
 
 	Object *ob = CTX_data_active_object(C);
 	struct WPaintData *wpd;
 	Mesh *me;
-	bDeformGroup *dg;
 
 	float mat[4][4], imat[4][4];
 	
 		return FALSE;
 	}
 
-	/* check if we are attempting to paint onto a locked vertex group,
-	 * and other options disallow it from doing anything useful */
-	dg = BLI_findlink(&ob->defbase, (ob->actdef - 1));
-	if (dg->flag & DG_LOCK_WEIGHT) {
-		BKE_report(op->reports, RPT_WARNING, "Active group is locked, aborting");
-		return FALSE;
+	{
+		/* check if we are attempting to paint onto a locked vertex group,
+		 * and other options disallow it from doing anything useful */
+		bDeformGroup *dg = BLI_findlink(&ob->defbase, (ob->actdef - 1));
+		if (dg->flag & DG_LOCK_WEIGHT) {
+			BKE_report(op->reports, RPT_WARNING, "Active group is locked, aborting");
+			return FALSE;
+		}
 	}
 
 	/* ALLOCATIONS! no return after this line */

File blender/source/blender/editors/sculpt_paint/sculpt.c

 	StrokeCache *cache = ss->cache;
 	Brush *brush = paint_brush(&sd->paint);
 
-	int dx, dy;
-
 	/* RNA_float_get_array(ptr, "location", cache->traced_location); */
 
 	if (cache->first_time ||
 	if (brush->flag & BRUSH_ANCHORED) {
 		int hit = 0;
 
-		dx = cache->mouse[0] - cache->initial_mouse[0];
-		dy = cache->mouse[1] - cache->initial_mouse[1];
+		const float dx = cache->mouse[0] - cache->initial_mouse[0];
+		const float dy = cache->mouse[1] - cache->initial_mouse[1];
 
 		sd->anchored_size = cache->pixel_radius = sqrt(dx * dx + dy * dy);
 
 			float halfway[2];
 			float out[3];
 
-			halfway[0] = (float)dx * 0.5f + cache->initial_mouse[0];
-			halfway[1] = (float)dy * 0.5f + cache->initial_mouse[1];
+			halfway[0] = dx * 0.5f + cache->initial_mouse[0];
+			halfway[1] = dy * 0.5f + cache->initial_mouse[1];
 
 			if (sculpt_stroke_get_location(C, out, halfway)) {
 				copy_v3_v3(sd->anchored_location, out);
 	sculpt_update_brush_delta(sd, ob, brush);
 
 	if (brush->sculpt_tool == SCULPT_TOOL_ROTATE) {
-		dx = cache->mouse[0] - cache->initial_mouse[0];
-		dy = cache->mouse[1] - cache->initial_mouse[1];
+		const float dx = cache->mouse[0] - cache->initial_mouse[0];
+		const float dy = cache->mouse[1] - cache->initial_mouse[1];
 
 		cache->vertex_rotation = -atan2f(dx, dy) * cache->bstrength;
 

File blender/source/blender/editors/space_buttons/buttons_context.c

 		}
 		else {
 			/* get settings from active particle system instead */
-			PointerRNA *ptr = get_pointer_type(path, &RNA_ParticleSystem);
+			ptr = get_pointer_type(path, &RNA_ParticleSystem);
 			
 			if (ptr && ptr->data) {
 				ParticleSettings *part = ((ParticleSystem *)ptr->data)->part;

File blender/source/blender/editors/space_clip/clip_ops.c

 	ot->flag = OPTYPE_BLOCKING | OPTYPE_GRAB_POINTER;
 
 	/* properties */
-	RNA_def_float(ot->srna, "factor", 0.0f, 0.0f, FLT_MAX,
+	RNA_def_float(ot->srna, "factor", 0.0f, -FLT_MAX, FLT_MAX,
 	              "Factor", "Zoom factor, values higher than 1.0 zoom in, lower values zoom out", -FLT_MAX, FLT_MAX);
 }
 
 	ot->poll = ED_space_clip_view_clip_poll;
 
 	/* properties */
-	RNA_def_float(ot->srna, "ratio", 0.0f, 0.0f, FLT_MAX,
+	RNA_def_float(ot->srna, "ratio", 0.0f, -FLT_MAX, FLT_MAX,
 	              "Ratio", "Zoom ratio, 1.0 is 1:1, higher is zoomed in, lower is zoomed out", -FLT_MAX, FLT_MAX);
 }
 

File blender/source/blender/editors/space_clip/tracking_ops.c

 	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 
 	/* properties */
-	RNA_def_float_vector(ot->srna, "location", 2, NULL, -FLT_MIN, FLT_MAX,
+	RNA_def_float_vector(ot->srna, "location", 2, NULL, -FLT_MAX, FLT_MAX,
 	                     "Location", "Location of marker on frame", -1.0f, 1.0f);
 }
 

File blender/source/blender/editors/space_clip/tracking_select.c

 		MovieTrackingTrack *track = tracking_marker_check_slide(C, event, NULL, NULL, NULL);
 
 		if (track) {
-			SpaceClip *sc = CTX_wm_space_clip(C);
 			MovieClip *clip = ED_space_clip_get_clip(sc);
 
 			clip->tracking.act_track = track;

File blender/source/blender/editors/space_image/image_ops.c

 	ot->flag = OPTYPE_BLOCKING;
 	
 	/* properties */
-	RNA_def_float(ot->srna, "factor", 0.0f, 0.0f, FLT_MAX,
+	RNA_def_float(ot->srna, "factor", 0.0f, -FLT_MAX, FLT_MAX,
 	              "Factor", "Zoom factor, values higher than 1.0 zoom in, lower values zoom out", -FLT_MAX, FLT_MAX);
 }
 
 	ot->poll = space_image_main_area_poll;
 	
 	/* properties */
-	RNA_def_float(ot->srna, "ratio", 0.0f, 0.0f, FLT_MAX,
+	RNA_def_float(ot->srna, "ratio", 0.0f, -FLT_MAX, FLT_MAX,
 	              "Ratio", "Zoom ratio, 1.0 is 1:1, higher is zoomed in, lower is zoomed out", -FLT_MAX, FLT_MAX);
 }
 

File blender/source/blender/editors/space_nla/nla_draw.c

 				
 				/* draw NLA-action line 'status-icons' - only when there's an action */
 				if ((ale->type == ANIMTYPE_NLAACTION) && (ale->data)) {
-					AnimData *adt = ale->adt;
-					
 					offset += 16;
 					
 					/* now draw some indicator icons  */

File blender/source/blender/editors/space_node/drawnode.c

 		void *lock;
 		ImBuf *ibuf = BKE_image_acquire_ibuf(ima, NULL, &lock);
 		if (ibuf) {
-			SpaceNode *snode = CTX_wm_space_node(C);
 			float x, y; 
 			unsigned char *display_buffer;
 			void *cache_handle;

File blender/source/blender/editors/space_node/node_edit.c

 	bNodeTree *ntree = snode->edittree;
 	bNode *gnode = node_tree_get_editgroup(snode->nodetree);
 	float gnode_x = 0.0f, gnode_y = 0.0f;
-	bNode *node, *new_node;
+	bNode *node;
 	bNodeLink *link, *newlink;
 
 	ED_preview_kill_jobs(C);
 	
 	for (node = ntree->nodes.first; node; node = node->next) {
 		if (node->flag & SELECT) {
+			bNode *new_node;
 			new_node = nodeCopyNode(NULL, node);
 			BKE_node_clipboard_add_node(new_node);
 		}

File blender/source/blender/editors/space_node/node_templates.c