Merging r37952 through r38022 from trunk into soc-2011-tomato

This commit is contained in:
Sergey Sharybin 2011-07-01 16:39:13 +00:00
commit f141b59497
32 changed files with 2246 additions and 1944 deletions

@ -717,7 +717,7 @@ elseif(WIN32)
set(PYTHON_LIBRARIES ${LIBDIR}/python/lib/python32.lib)
endif()
set(PLATFORM_LINKFLAGS "/SUBSYSTEM:CONSOLE /STACK:2097152 /INCREMENTAL:NO /NODEFAULTLIB:msvcrt.lib\;msvcmrt.lib\;msvcurt.lib\;msvcrtd.lib ")
set(PLATFORM_LINKFLAGS "/SUBSYSTEM:CONSOLE /STACK:2097152 /INCREMENTAL:NO /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcmrt.lib /NODEFAULTLIB:msvcurt.lib /NODEFAULTLIB:msvcrtd.lib")
# MSVC only, Mingw doesnt need
if(CMAKE_CL_64)
@ -726,7 +726,7 @@ elseif(WIN32)
set(PLATFORM_LINKFLAGS "/MACHINE:IX86 /LARGEADDRESSAWARE ${PLATFORM_LINKFLAGS}")
endif()
set(PLATFORM_LINKFLAGS_DEBUG "/NODEFAULTLIB:libcmt.lib\;libc.lib")
set(PLATFORM_LINKFLAGS_DEBUG "/NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libc.lib")
else()
# keep GCC spesific stuff here

@ -26,7 +26,7 @@
from cmake_consistency_check_config import IGNORE, UTF8_CHECK, SOURCE_DIR
import os
from os.path import join, dirname, normpath, abspath, splitext
from os.path import join, dirname, normpath, splitext
print("Scanning:", SOURCE_DIR)
@ -183,7 +183,6 @@ def is_ignore(f):
# First do stupid check, do these files exist?
print("\nChecking for missing references:")
import sys
is_err = False
errs = []
for f in (global_h | global_c):

@ -181,7 +181,7 @@ CXX_WARN = []
LLIBS = ['ws2_32', 'vfw32', 'winmm', 'kernel32', 'user32', 'gdi32', 'comdlg32', 'advapi32', 'shfolder', 'shell32', 'ole32', 'oleaut32', 'uuid']
PLATFORM_LINKFLAGS = ['/SUBSYSTEM:CONSOLE','/MACHINE:IX86','/STACK:2097152','/INCREMENTAL:NO', '/LARGEADDRESSAWARE', '/NODEFAULTLIB:msvcrt.lib;msvcmrt.lib;msvcurt.lib;msvcrtd.lib']
PLATFORM_LINKFLAGS = ['/SUBSYSTEM:CONSOLE','/MACHINE:IX86','/STACK:2097152','/INCREMENTAL:NO', '/LARGEADDRESSAWARE', '/NODEFAULTLIB:msvcrt.lib', '/NODEFAULTLIB:msvcmrt.lib', '/NODEFAULTLIB:msvcurt.lib', '/NODEFAULTLIB:msvcrtd.lib']
# # Todo
# BF_PROFILE_CCFLAGS = ['-pg', '-g ']

@ -190,7 +190,7 @@ if BF_DEBUG:
else:
BF_NUMJOBS=6
PLATFORM_LINKFLAGS = ['/SUBSYSTEM:CONSOLE','/MACHINE:X64','/STACK:2097152','/OPT:NOREF','/INCREMENTAL:NO', '/NODEFAULTLIB:msvcrt.lib;msvcmrt.lib;msvcurt.lib;msvcrtd.lib']
PLATFORM_LINKFLAGS = ['/SUBSYSTEM:CONSOLE','/MACHINE:X64','/STACK:2097152','/OPT:NOREF','/INCREMENTAL:NO', '/NODEFAULTLIB:msvcrt.lib', '/NODEFAULTLIB:msvcmrt.lib', '/NODEFAULTLIB:msvcurt.lib', '/NODEFAULTLIB:msvcrtd.lib']
BF_BUILDDIR = '..\\build\\blender25-win64-vc'
BF_INSTALLDIR='..\\install\\blender25-win64-vc'

File diff suppressed because it is too large Load Diff

1888
doc/python_api/rst/bgl.rst Normal file

File diff suppressed because it is too large Load Diff

@ -67,7 +67,7 @@ if 1:
else:
# for testing so doc-builds dont take so long.
EXCLUDE_MODULES = (
# "bpy.context",
"bpy.context",
"bpy.app",
"bpy.path",
"bpy.data",
@ -76,10 +76,10 @@ else:
"bpy.context",
"bpy.types", # supports filtering
"bpy.ops", # supports filtering
#"bpy_extras",
"bpy_extras",
"bge",
"aud",
"bgl",
#"bgl",
"blf",
"mathutils",
"mathutils.geometry",
@ -1028,8 +1028,8 @@ def rna2sphinx(BASEPATH):
fw(" mathutils.rst\n\n")
if "mathutils.geometry" not in EXCLUDE_MODULES:
fw(" mathutils.geometry.rst\n\n")
# XXX TODO
#fw(" bgl.rst\n\n")
if "bgl" not in EXCLUDE_MODULES:
fw(" bgl.rst\n\n")
if "blf" not in EXCLUDE_MODULES:
fw(" blf.rst\n\n")
if "aud" not in EXCLUDE_MODULES:
@ -1159,14 +1159,16 @@ def rna2sphinx(BASEPATH):
import mathutils.geometry as module
pymodule2sphinx(BASEPATH, "mathutils.geometry", module, "Geometry Utilities")
if "mathutils.geometry" not in EXCLUDE_MODULES:
if "blf" not in EXCLUDE_MODULES:
import blf as module
pymodule2sphinx(BASEPATH, "blf", module, "Font Drawing")
# XXX TODO
#import bgl as module
#pymodule2sphinx(BASEPATH, "bgl", module, "Blender OpenGl wrapper")
#del module
if "bgl" not in EXCLUDE_MODULES:
#import bgl as module
#pymodule2sphinx(BASEPATH, "bgl", module, "Blender OpenGl wrapper")
#del module
import shutil
shutil.copy2(os.path.join(BASEPATH, "..", "rst", "bgl.rst"), BASEPATH)
if "aud" not in EXCLUDE_MODULES:
import aud as module

@ -54,7 +54,7 @@ public:
const bool stereoVisual,
const GHOST_TUns16 numOfAASamples
) :
GHOST_Window(title,left,top,width,height,state,type,stereoVisual,numOfAASamples),
GHOST_Window(width,height,state,type,stereoVisual,numOfAASamples),
m_system (system)
{
setTitle(title);

@ -65,4 +65,4 @@ def _main():
_main()
del _main
del _main

@ -287,7 +287,7 @@ def ngon_tesselate(from_data, indices, fix_loops=True):
else:
return v1[1], v2[1]
if not PREF_FIX_LOOPS:
if not fix_loops:
'''
Normal single concave loop filling
'''

@ -60,7 +60,7 @@ class EditExternally(bpy.types.Operator):
filepath = bpy.path.abspath(self.filepath)
if not os.path.exists(filepath):
self.report({'ERROR'}, "Image path %r not found." % filepath)
self.report({'ERROR'}, "Image path %r not found, image may be packed or unsaved." % filepath)
return {'CANCELLED'}
cmd = self._editor_guess(context) + [filepath]

@ -81,8 +81,8 @@ class MeshMirrorUV(bpy.types.Operator):
@classmethod
def poll(cls, context):
ob = context.active_object
return (ob and ob.type == 'MESH')
obj = context.active_object
return (obj and obj.type == 'MESH' and obj.data.uv_textures.active)
def execute(self, context):
DIR = (self.direction == 'NEGATIVE')
@ -120,12 +120,7 @@ class MeshMirrorUV(bpy.types.Operator):
if j is not None:
vmap[i] = j
active_uv_layer = None
for lay in mesh.uv_textures:
if lay.active:
active_uv_layer = lay.data
break
active_uv_layer = mesh.uv_textures.active.data
fuvs = [(uv.uv1, uv.uv2, uv.uv3, uv.uv4) for uv in active_uv_layer]
fuvs_cpy = [(uv[0].copy(), uv[1].copy(), uv[2].copy(), uv[3].copy()) for uv in fuvs]

@ -132,7 +132,7 @@ class QuickExplode(bpy.types.Operator):
fake_context = bpy.context.copy()
obj_act = context.active_object
if obj_act.type != 'MESH':
if obj_act is None or obj_act.type != 'MESH':
self.report({'ERROR'}, "Active object is not a mesh")
return {'CANCELLED'}

@ -878,7 +878,7 @@ class PARTICLE_PT_render(ParticleButtonsPanel, bpy.types.Panel):
col.prop(part, "billboard_tilt_random", text="Random", slider=True)
col = row.column()
col.prop(part, "billboard_offset")
row = layout.row()
col = row.column()
col.prop(part, "billboard_size", text="Scale")

@ -883,7 +883,7 @@ class USERPREF_PT_addons(bpy.types.Panel):
if user_script_path is not None:
user_addon_paths.append(os.path.join(user_script_path(), "addons"))
user_addon_paths.append(os.path.join(bpy.utils.resource_path('USER'), "scripts", "addons"))
for path in user_addon_paths:
if bpy.path.is_subdir(mod.__file__, path):
return True
@ -1001,8 +1001,7 @@ class USERPREF_PT_addons(bpy.types.Panel):
for i in range(4 - tot_row):
split.separator()
# Append missing scripts
# First collect scripts that are used but have no script file.

@ -51,7 +51,7 @@ extern "C" {
/* used by packaging tools */
/* can be left blank, otherwise a,b,c... etc with no quotes */
#define BLENDER_VERSION_CHAR
#define BLENDER_VERSION_CHAR a
/* alpha/beta/rc/release, docs use this */
#define BLENDER_VERSION_CYCLE release

@ -63,6 +63,7 @@
#include "BKE_library.h"
#include "BKE_main.h"
#include "BKE_object.h"
#include "BKE_deform.h"
#include "RNA_access.h"
@ -1005,7 +1006,7 @@ static float *get_weights_array(Object *ob, char *vgroup)
MDeformVert *dvert= NULL;
EditMesh *em= NULL;
EditVert *eve;
int totvert= 0, index= 0;
int totvert= 0, defgrp_index= 0;
/* no vgroup string set? */
if(vgroup[0]==0) return NULL;
@ -1028,10 +1029,10 @@ static float *get_weights_array(Object *ob, char *vgroup)
if(dvert==NULL) return NULL;
/* find the group (weak loop-in-loop) */
index= defgroup_name_index(ob, vgroup);
if(index >= 0) {
defgrp_index= defgroup_name_index(ob, vgroup);
if(defgrp_index >= 0) {
float *weights;
int i, j;
int i;
weights= MEM_callocN(totvert*sizeof(float), "weights");
@ -1040,23 +1041,13 @@ static float *get_weights_array(Object *ob, char *vgroup)
dvert= CustomData_em_get(&em->vdata, eve->data, CD_MDEFORMVERT);
if(dvert) {
for(j=0; j<dvert->totweight; j++) {
if(dvert->dw[j].def_nr == index) {
weights[i]= dvert->dw[j].weight;
break;
}
}
weights[i]= defvert_find_weight(dvert, defgrp_index);
}
}
}
else {
for(i=0; i < totvert; i++, dvert++) {
for(j=0; j<dvert->totweight; j++) {
if(dvert->dw[j].def_nr == index) {
weights[i]= dvert->dw[j].weight;
break;
}
}
weights[i]= defvert_find_weight(dvert, defgrp_index);
}
}

@ -265,7 +265,7 @@ void ED_keymap_armature(wmKeyConfig *keyconf)
/* set flags */
WM_keymap_add_menu(keymap, "VIEW3D_MT_bone_options_toggle", WKEY, KM_PRESS, KM_SHIFT, 0);
WM_keymap_add_menu(keymap, "VIEW3D_MT_bone_options_enable", WKEY, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_menu(keymap, "VIEW3D_MT_bone_options_enable", WKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
WM_keymap_add_menu(keymap, "VIEW3D_MT_bone_options_disable", WKEY, KM_PRESS, KM_ALT, 0);
/* armature/bone layers */
@ -343,7 +343,7 @@ void ED_keymap_armature(wmKeyConfig *keyconf)
/* set flags */
WM_keymap_add_menu(keymap, "VIEW3D_MT_bone_options_toggle", WKEY, KM_PRESS, KM_SHIFT, 0);
WM_keymap_add_menu(keymap, "VIEW3D_MT_bone_options_enable", WKEY, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_menu(keymap, "VIEW3D_MT_bone_options_enable", WKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
WM_keymap_add_menu(keymap, "VIEW3D_MT_bone_options_disable", WKEY, KM_PRESS, KM_ALT, 0);
/* armature/bone layers */

@ -142,13 +142,13 @@ void uiDrawBox(int mode, float minx, float miny, float maxx, float maxy, float r
static void round_box_shade_col(float *col1, float *col2, float fac)
{
float col[3];
float col[4];
col[0]= (fac*col1[0] + (1.0f-fac)*col2[0]);
col[1]= (fac*col1[1] + (1.0f-fac)*col2[1]);
col[2]= (fac*col1[2] + (1.0f-fac)*col2[2]);
glColor3fv(col);
col[3]= (fac*col1[3] + (1.0f-fac)*col2[3]);
glColor4fv(col);
}
@ -159,7 +159,7 @@ void uiDrawBoxShade(int mode, float minx, float miny, float maxx, float maxy, fl
float vec[7][2]= {{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293},
{0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}};
float div= maxy-miny;
float coltop[3], coldown[3], color[4];
float coltop[4], coldown[4], color[4];
int a;
/* mult */
@ -173,9 +173,11 @@ void uiDrawBoxShade(int mode, float minx, float miny, float maxx, float maxy, fl
coltop[0]= color[0]+shadetop; if(coltop[0]>1.0f) coltop[0]= 1.0f;
coltop[1]= color[1]+shadetop; if(coltop[1]>1.0f) coltop[1]= 1.0f;
coltop[2]= color[2]+shadetop; if(coltop[2]>1.0f) coltop[2]= 1.0f;
coltop[3]= color[3];
coldown[0]= color[0]+shadedown; if(coldown[0]<0.0f) coldown[0]= 0.0f;
coldown[1]= color[1]+shadedown; if(coldown[1]<0.0f) coldown[1]= 0.0f;
coldown[2]= color[2]+shadedown; if(coldown[2]<0.0f) coldown[2]= 0.0f;
coldown[3]= color[3];
glShadeModel(GL_SMOOTH);
glBegin(mode);

@ -180,7 +180,7 @@ void ui_draw_anti_tria(float x1, float y1, float x2, float y2, float x3, float y
glEnable(GL_BLEND);
glGetFloatv(GL_CURRENT_COLOR, color);
color[3]= 0.125;
color[3]*= 0.125;
glColor4fv(color);
/* for each AA step */

@ -1704,7 +1704,7 @@ void OBJECT_OT_shade_smooth(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Shade Smooth";
ot->description= "Display faces 'smooth' (using vertext normals)";
ot->description= "Display faces 'smooth' (using vertex normals)";
ot->idname= "OBJECT_OT_shade_smooth";
/* api callbacks */

@ -56,6 +56,7 @@
#include "BKE_object.h"
#include "BKE_report.h"
#include "BKE_scene.h"
#include "BKE_deform.h"
#include "RNA_define.h"
#include "RNA_access.h"
@ -85,7 +86,7 @@ static int return_editmesh_indexar(EditMesh *em, int *tot, int **indexar, float
*indexar= index= MEM_mallocN(4*totvert, "hook indexar");
*tot= totvert;
nr= 0;
cent[0]= cent[1]= cent[2]= 0.0;
zero_v3(cent);
for(eve= em->verts.first; eve; eve= eve->next) {
if(eve->f & SELECT) {
@ -102,30 +103,29 @@ static int return_editmesh_indexar(EditMesh *em, int *tot, int **indexar, float
static int return_editmesh_vgroup(Object *obedit, EditMesh *em, char *name, float *cent)
{
MDeformVert *dvert;
EditVert *eve;
int i, totvert=0;
cent[0]= cent[1]= cent[2]= 0.0;
zero_v3(cent);
if(obedit->actdef) {
const int defgrp_index= obedit->actdef-1;
int totvert=0;
MDeformVert *dvert;
EditVert *eve;
/* find the vertices */
for(eve= em->verts.first; eve; eve= eve->next) {
dvert= CustomData_em_get(&em->vdata, eve->data, CD_MDEFORMVERT);
if(dvert) {
for(i=0; i<dvert->totweight; i++){
if(dvert->dw[i].def_nr == (obedit->actdef-1)) {
totvert++;
add_v3_v3(cent, eve->co);
}
if(defvert_find_weight(dvert, defgrp_index) > 0.0f) {
add_v3_v3(cent, eve->co);
totvert++;
}
}
}
if(totvert) {
bDeformGroup *defGroup = BLI_findlink(&obedit->defbase, obedit->actdef-1);
strcpy(name, defGroup->name);
bDeformGroup *dg = BLI_findlink(&obedit->defbase, defgrp_index);
BLI_strncpy(name, dg->name, sizeof(dg->name));
mul_v3_fl(cent, 1.0f/(float)totvert);
return 1;
}

@ -446,6 +446,7 @@ static int parent_clear_exec(bContext *C, wmOperator *op)
DAG_scene_sort(bmain, scene);
DAG_ids_flush_update(bmain, 0);
WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, NULL);
WM_event_add_notifier(C, NC_OBJECT|ND_PARENT, NULL);
return OPERATOR_FINISHED;
}

@ -188,17 +188,12 @@ static void area_draw_azone(short x1, short y1, short x2, short y2)
}
static void region_draw_azone(AZone *az)
static void region_draw_azone_icon(AZone *az)
{
GLUquadricObj *qobj = NULL;
short midx = az->x1 + (az->x2 - az->x1)/2;
short midy = az->y1 + (az->y2 - az->y1)/2;
if(az->ar==NULL) return;
/* only display action zone icons when the region is hidden */
if (!(az->ar->flag & RGN_FLAG_HIDDEN)) return;
qobj = gluNewQuadric();
glPushMatrix();
@ -227,6 +222,79 @@ static void region_draw_azone(AZone *az)
sdrawline(midx-2, midy, midx+3, midy);
}
static void region_draw_azone_tab(AZone *az)
{
float col[3];
glEnable(GL_BLEND);
UI_GetThemeColor3fv(TH_HEADER, col);
glColor4f(col[0], col[1], col[2], 0.5f);
/* add code to draw region hidden as 'too small' */
switch(az->edge) {
case AE_TOP_TO_BOTTOMRIGHT:
uiSetRoundBox(3 + 16);
uiDrawBoxShade(GL_POLYGON, (float)az->x1, (float)az->y1, (float)az->x2, (float)az->y2, 4.0f, -0.3f, 0.05f);
glColor4ub(0, 0, 0, 255);
uiRoundRect((float)az->x1, 0.3f+(float)az->y1, (float)az->x2, 0.3f+(float)az->y2, 4.0f);
break;
case AE_BOTTOM_TO_TOPLEFT:
uiSetRoundBox(12 + 16);
uiDrawBoxShade(GL_POLYGON, (float)az->x1, (float)az->y1, (float)az->x2, (float)az->y2, 4.0f, -0.3f, 0.05f);
glColor4ub(0, 0, 0, 255);
uiRoundRect((float)az->x1, 0.3f+(float)az->y1, (float)az->x2, 0.3f+(float)az->y2, 4.0f);
break;
case AE_LEFT_TO_TOPRIGHT:
uiSetRoundBox(9 + 16);
uiDrawBoxShade(GL_POLYGON, (float)az->x1, (float)az->y1, (float)az->x2, (float)az->y2, 4.0f, -0.3f, 0.05f);
glColor4ub(0, 0, 0, 255);
uiRoundRect((float)az->x1, (float)az->y1, (float)az->x2, (float)az->y2, 4.0f);
break;
case AE_RIGHT_TO_TOPLEFT:
uiSetRoundBox(6 + 16);
uiDrawBoxShade(GL_POLYGON, (float)az->x1, (float)az->y1, (float)az->x2, (float)az->y2, 4.0f, -0.3f, 0.05f);
glColor4ub(0, 0, 0, 255);
uiRoundRect((float)az->x1, (float)az->y1, (float)az->x2, (float)az->y2, 4.0f);
break;
}
glDisable(GL_BLEND);
}
static void region_draw_azone_tria(AZone *az)
{
extern void ui_draw_anti_tria(float x1, float y1, float x2, float y2, float x3, float y3); /* xxx temp */
glEnable(GL_BLEND);
//UI_GetThemeColor3fv(TH_HEADER, col);
glColor4f(0.0f, 0.0f, 0.0f, 0.35f);
/* add code to draw region hidden as 'too small' */
switch(az->edge) {
case AE_TOP_TO_BOTTOMRIGHT:
ui_draw_anti_tria((float)az->x1, (float)az->y1, (float)az->x2, (float)az->y1, (float)(az->x1+az->x2)/2, (float)az->y2);
break;
case AE_BOTTOM_TO_TOPLEFT:
ui_draw_anti_tria((float)az->x1, (float)az->y2, (float)az->x2, (float)az->y2, (float)(az->x1+az->x2)/2, (float)az->y1);
break;
case AE_LEFT_TO_TOPRIGHT:
ui_draw_anti_tria((float)az->x2, (float)az->y1, (float)az->x2, (float)az->y2, (float)az->x1, (float)(az->y1+az->y2)/2);
break;
case AE_RIGHT_TO_TOPLEFT:
ui_draw_anti_tria((float)az->x1, (float)az->y1, (float)az->x1, (float)az->y2, (float)az->x2, (float)(az->y1+az->y2)/2);
break;
}
glDisable(GL_BLEND);
}
/* only exported for WM */
void ED_area_overdraw(bContext *C)
@ -248,7 +316,19 @@ void ED_area_overdraw(bContext *C)
if(az->type==AZONE_AREA) {
area_draw_azone(az->x1, az->y1, az->x2, az->y2);
} else if(az->type==AZONE_REGION) {
region_draw_azone(az);
if(az->ar) {
/* only display tab or icons when the region is hidden */
if (az->ar->flag & (RGN_FLAG_HIDDEN|RGN_FLAG_TOO_SMALL)) {
if(G.rt==2)
region_draw_azone_tria(az);
else if(G.rt==1)
region_draw_azone_tab(az);
else
region_draw_azone_icon(az);
}
}
}
az->do_draw= 0;
@ -579,6 +659,96 @@ static void region_azone_icon(ScrArea *sa, AZone *az, ARegion *ar)
}
}
#define AZONEPAD_TABW 18
#define AZONEPAD_TABH 7
/* region already made zero sized, in shape of edge */
static void region_azone_tab(ScrArea *sa, AZone *az, ARegion *ar)
{
AZone *azt;
int tot= 0, add;
for(azt= sa->actionzones.first; azt; azt= azt->next) {
if(azt->edge == az->edge) tot++;
}
switch(az->edge) {
case AE_TOP_TO_BOTTOMRIGHT:
if(ar->winrct.ymax == sa->totrct.ymin) add= 1; else add= 0;
az->x1= ar->winrct.xmax - 2*AZONEPAD_TABW;
az->y1= ar->winrct.ymax - add;
az->x2= ar->winrct.xmax - AZONEPAD_TABW;
az->y2= ar->winrct.ymax - add + AZONEPAD_TABH;
break;
case AE_BOTTOM_TO_TOPLEFT:
az->x1= ar->winrct.xmin + AZONEPAD_TABW;
az->y1= ar->winrct.ymin - AZONEPAD_TABH;
az->x2= ar->winrct.xmin + 2*AZONEPAD_TABW;
az->y2= ar->winrct.ymin;
break;
case AE_LEFT_TO_TOPRIGHT:
az->x1= ar->winrct.xmin + 1 - AZONEPAD_TABH;
az->y1= ar->winrct.ymax - 2*AZONEPAD_TABW;
az->x2= ar->winrct.xmin + 1;
az->y2= ar->winrct.ymax - AZONEPAD_TABW;
break;
case AE_RIGHT_TO_TOPLEFT:
az->x1= ar->winrct.xmax - 1;
az->y1= ar->winrct.ymax - 2*AZONEPAD_TABW;
az->x2= ar->winrct.xmax - 1 + AZONEPAD_TABH;
az->y2= ar->winrct.ymax - AZONEPAD_TABW;
break;
}
/* rect needed for mouse pointer test */
BLI_init_rcti(&az->rect, az->x1, az->x2, az->y1, az->y2);
}
#define AZONEPAD_TRIAW 16
#define AZONEPAD_TRIAH 9
/* region already made zero sized, in shape of edge */
static void region_azone_tria(ScrArea *sa, AZone *az, ARegion *ar)
{
AZone *azt;
int tot= 0, add;
for(azt= sa->actionzones.first; azt; azt= azt->next) {
if(azt->edge == az->edge) tot++;
}
switch(az->edge) {
case AE_TOP_TO_BOTTOMRIGHT:
if(ar->winrct.ymax == sa->totrct.ymin) add= 1; else add= 0;
az->x1= ar->winrct.xmax - 2*AZONEPAD_TRIAW;
az->y1= ar->winrct.ymax - add;
az->x2= ar->winrct.xmax - AZONEPAD_TRIAW;
az->y2= ar->winrct.ymax - add + AZONEPAD_TRIAH;
break;
case AE_BOTTOM_TO_TOPLEFT:
az->x1= ar->winrct.xmin + AZONEPAD_TRIAW;
az->y1= ar->winrct.ymin - AZONEPAD_TRIAH;
az->x2= ar->winrct.xmin + 2*AZONEPAD_TRIAW;
az->y2= ar->winrct.ymin;
break;
case AE_LEFT_TO_TOPRIGHT:
az->x1= ar->winrct.xmin + 1 - AZONEPAD_TRIAH;
az->y1= ar->winrct.ymax - 2*AZONEPAD_TRIAW;
az->x2= ar->winrct.xmin + 1;
az->y2= ar->winrct.ymax - AZONEPAD_TRIAW;
break;
case AE_RIGHT_TO_TOPLEFT:
az->x1= ar->winrct.xmax - 1;
az->y1= ar->winrct.ymax - 2*AZONEPAD_TRIAW;
az->x2= ar->winrct.xmax - 1 + AZONEPAD_TRIAH;
az->y2= ar->winrct.ymax - AZONEPAD_TRIAW;
break;
}
/* rect needed for mouse pointer test */
BLI_init_rcti(&az->rect, az->x1, az->x2, az->y1, az->y2);
}
static void region_azone_initialize(ScrArea *sa, ARegion *ar, AZEdge edge)
{
AZone *az;
@ -589,8 +759,13 @@ static void region_azone_initialize(ScrArea *sa, ARegion *ar, AZEdge edge)
az->ar= ar;
az->edge= edge;
if (ar->flag & RGN_FLAG_HIDDEN) {
region_azone_icon(sa, az, ar);
if (ar->flag & (RGN_FLAG_HIDDEN|RGN_FLAG_TOO_SMALL)) {
if(G.rt==2)
region_azone_tria(sa, az, ar);
else if(G.rt==1)
region_azone_tab(sa, az, ar);
else
region_azone_icon(sa, az, ar);
} else {
region_azone_edge(az, ar);
}
@ -790,15 +965,6 @@ static void region_rect_recursive(ScrArea *sa, ARegion *ar, rcti *remainder, int
ar->winx= ar->winrct.xmax - ar->winrct.xmin + 1;
ar->winy= ar->winrct.ymax - ar->winrct.ymin + 1;
/* restore test exception */
if(ar->alignment & RGN_SPLIT_PREV) {
if(ar->prev) {
remainder= remainder_prev;
ar->prev->winx= ar->prev->winrct.xmax - ar->prev->winrct.xmin + 1;
ar->prev->winy= ar->prev->winrct.ymax - ar->prev->winrct.ymin + 1;
}
}
/* set winrect for azones */
if(ar->flag & (RGN_FLAG_HIDDEN|RGN_FLAG_TOO_SMALL)) {
ar->winrct= *remainder;
@ -814,12 +980,22 @@ static void region_rect_recursive(ScrArea *sa, ARegion *ar, rcti *remainder, int
else /* prevent winrct to be valid */
ar->winrct.xmax= ar->winrct.xmin;
}
/* restore prev-split exception */
if(ar->alignment & RGN_SPLIT_PREV) {
if(ar->prev) {
remainder= remainder_prev;
ar->prev->winx= ar->prev->winrct.xmax - ar->prev->winrct.xmin + 1;
ar->prev->winy= ar->prev->winrct.ymax - ar->prev->winrct.ymin + 1;
}
}
/* in end, add azones, where appropriate */
if(ar->regiontype == RGN_TYPE_HEADER && ar->winy + 6 > sa->winy) {
/* The logic for this is: when the header takes up the full area,
* disallow hiding it to view the main window.
*
* Without this, uou can drag down the file selectors header and hide it
* Without this, you can drag down the file selectors header and hide it
* by accident very easily (highly annoying!), the value 6 is arbitrary
* but accounts for small common rounding problems when scaling the UI,
* must be minimum '4' */
@ -833,7 +1009,7 @@ static void region_rect_recursive(ScrArea *sa, ARegion *ar, rcti *remainder, int
static void area_calc_totrct(ScrArea *sa, int sizex, int sizey)
{
short rt= CLAMPIS(G.rt, 0, 16);
short rt= 0; // CLAMPIS(G.rt, 0, 16);
if(sa->v1->vec.x>0) sa->totrct.xmin= sa->v1->vec.x+1+rt;
else sa->totrct.xmin= sa->v1->vec.x;

@ -911,7 +911,7 @@ static void drawscredge_area(ScrArea *sa, int sizex, int sizey, int center)
short y2= sa->v3->vec.y;
short a, rt;
rt= CLAMPIS(G.rt, 0, 16);
rt= 0; // CLAMPIS(G.rt, 0, 16);
if(center==0) {
cpack(0x505050);

@ -2004,19 +2004,16 @@ static int node_duplicate_exec(bContext *C, wmOperator *UNUSED(op))
{
SpaceNode *snode= CTX_wm_space_node(C);
bNodeTree *ntree= snode->edittree;
bNode *node, *newnode, *last;
bNode *node, *newnode, *lastnode;
bNodeLink *link, *newlink, *lastlink;
ED_preview_kill_jobs(C);
last = ntree->nodes.last;
lastnode = ntree->nodes.last;
for(node= ntree->nodes.first; node; node= node->next) {
if(node->flag & SELECT) {
newnode = nodeCopyNode(ntree, node);
/* deselect old node, select the copy instead */
node->flag &= ~(NODE_SELECT|NODE_ACTIVE);
newnode->flag |= NODE_SELECT;
if(newnode->id) {
/* simple id user adjustment, node internal functions dont touch this
* but operators and readfile.c do. */
@ -2027,7 +2024,53 @@ static int node_duplicate_exec(bContext *C, wmOperator *UNUSED(op))
}
/* make sure we don't copy new nodes again! */
if (node==last)
if (node==lastnode)
break;
}
/* copy links between selected nodes
* NB: this depends on correct node->new_node and sock->new_sock pointers from above copy!
*/
lastlink = ntree->links.last;
for (link=ntree->links.first; link; link=link->next) {
/* this creates new links between copied nodes,
* as well as input links from unselected (when fromnode==NULL) !
*/
if (link->tonode && (link->tonode->flag & NODE_SELECT)) {
newlink = MEM_callocN(sizeof(bNodeLink), "bNodeLink");
newlink->flag = link->flag;
newlink->tonode = link->tonode->new_node;
newlink->tosock = link->tosock->new_sock;
if (link->fromnode && (link->fromnode->flag & NODE_SELECT)) {
newlink->fromnode = link->fromnode->new_node;
newlink->fromsock = link->fromsock->new_sock;
}
else {
/* input node not copied, this keeps the original input linked */
newlink->fromnode = link->fromnode;
newlink->fromsock = link->fromsock;
}
BLI_addtail(&ntree->links, newlink);
}
/* make sure we don't copy new links again! */
if (link==lastlink)
break;
}
/* deselect old nodes, select the copies instead */
for(node= ntree->nodes.first; node; node= node->next) {
if(node->flag & SELECT) {
/* has been set during copy above */
newnode = node->new_node;
node->flag &= ~(NODE_SELECT|NODE_ACTIVE);
newnode->flag |= NODE_SELECT;
}
/* make sure we don't copy new nodes again! */
if (node==lastnode)
break;
}

@ -2839,7 +2839,7 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro
}
/* editable check */
if(RNA_property_editable(&itemptr, iprop)) {
if(!set || RNA_property_editable(&itemptr, iprop)) {
if(a+itemlen > in.len) {
BKE_reportf(reports, RPT_ERROR, "Array length mismatch (got %d, expected more).", in.len);
err= 1;

@ -172,6 +172,7 @@ static void displaceModifier_do(
MDeformVert *dvert = NULL;
int defgrp_index;
float (*tex_co)[3];
float weight= 1.0f; /* init value unused but some compilers may complain */
if(!dmd->texture) return;
if(dmd->strength == 0.0f) return;
@ -189,17 +190,10 @@ static void displaceModifier_do(
for(i = 0; i < numVerts; ++i) {
TexResult texres;
float delta = 0, strength = dmd->strength;
MDeformWeight *def_weight = NULL;
if(dvert) {
int j;
for(j = 0; j < dvert[i].totweight; ++j) {
if(dvert[i].dw[j].def_nr == defgrp_index) {
def_weight = &dvert[i].dw[j];
break;
}
}
if(!def_weight || def_weight->weight==0.0f) continue;
weight= defvert_find_weight(dvert + i, defgrp_index);
if(weight == 0.0f) continue;
}
texres.nor = NULL;
@ -207,7 +201,7 @@ static void displaceModifier_do(
delta = texres.tin - dmd->midlevel;
if(def_weight) strength *= def_weight->weight;
if(dvert) strength *= weight;
delta *= strength;
CLAMP(delta, -10000, 10000);

@ -266,7 +266,7 @@ void RE_zbuf_accumulate_vecblur(struct NodeBlurData *nbd, int xsize, int ysize,
#define RE_BAKE_ALPHA 11
#define RE_BAKE_EMIT 12
void RE_Database_Baking(struct Render *re, struct Main *bmain, struct Scene *scene, unsigned int lay, int type, struct Object *actob);
void RE_Database_Baking(struct Render *re, struct Main *bmain, struct Scene *scene, unsigned int lay, const int type, struct Object *actob);
void RE_DataBase_GetView(struct Render *re, float mat[][4]);
void RE_GetCameraWindow(struct Render *re, struct Object *camera, int frame, float mat[][4]);

@ -5680,13 +5680,14 @@ void RE_Database_FromScene_Vectors(Render *re, Main *bmain, Scene *sce, unsigned
RE_BAKE_DISPLACEMENT:for baking, no lamps, only selected objects
RE_BAKE_SHADOW: for baking, only shadows, but all objects
*/
void RE_Database_Baking(Render *re, Main *bmain, Scene *scene, unsigned int lay, int type, Object *actob)
void RE_Database_Baking(Render *re, Main *bmain, Scene *scene, unsigned int lay, const int type, Object *actob)
{
Object *camera;
float mat[4][4];
float amb[3];
int onlyselected, nolamps;
const short onlyselected= !ELEM3(type, RE_BAKE_LIGHT, RE_BAKE_ALL, RE_BAKE_SHADOW);
const short nolamps= ELEM3(type, RE_BAKE_NORMALS, RE_BAKE_TEXTURE, RE_BAKE_DISPLACEMENT);
re->main= bmain;
re->scene= scene;
re->lay= lay;
@ -5736,7 +5737,15 @@ void RE_Database_Baking(Render *re, Main *bmain, Scene *scene, unsigned int lay,
unit_m4(mat);
RE_SetView(re, mat);
}
copy_m3_m4(re->imat, re->viewinv);
/* TODO: deep shadow maps + baking + strands */
/* strands use the window matrix and view size, there is to correct
* window matrix but at least avoids malloc and crash loop [#27807] */
unit_m4(re->winmat);
re->winx= re->winy= 256;
/* done setting dummy values */
init_render_world(re); /* do first, because of ambient. also requires re->osa set correct */
if(re->r.mode & R_RAYTRACE) {
init_render_qmcsampler(re);
@ -5755,9 +5764,6 @@ void RE_Database_Baking(Render *re, Main *bmain, Scene *scene, unsigned int lay,
set_node_shader_lamp_loop(shade_material_loop);
/* MAKE RENDER DATA */
nolamps= !ELEM3(type, RE_BAKE_LIGHT, RE_BAKE_ALL, RE_BAKE_SHADOW);
onlyselected= ELEM3(type, RE_BAKE_NORMALS, RE_BAKE_TEXTURE, RE_BAKE_DISPLACEMENT);
database_init_objects(re, lay, nolamps, onlyselected, actob, 0);
set_material_lightgroups(re);

@ -231,7 +231,17 @@ else()
set(TARGETDIR ${EXECUTABLE_OUTPUT_PATH})
endif()
# install target
# -----------------------------------------------------------------------------
# Install Targets
set(BLENDER_TEXT_FILES
${CMAKE_SOURCE_DIR}/release/text/GPL-license.txt
${CMAKE_SOURCE_DIR}/release/text/Python-license.txt
${CMAKE_SOURCE_DIR}/release/text/copyright.txt
${CMAKE_SOURCE_DIR}/release/text/readme.html
)
if(UNIX AND NOT APPLE)
if(WITH_INSTALL_PORTABLE)
@ -274,9 +284,8 @@ if(UNIX AND NOT APPLE)
)
install(
DIRECTORY ${CMAKE_SOURCE_DIR}/release/text
FILES ${BLENDER_TEXT_FILES}
DESTINATION ${TARGETDIR}
PATTERN ".svn" EXCLUDE
)
else()
@ -332,9 +341,8 @@ if(UNIX AND NOT APPLE)
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1
)
install(
DIRECTORY ${CMAKE_SOURCE_DIR}/release/text
FILES ${BLENDER_TEXT_FILES}
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/doc/blender
PATTERN ".svn" EXCLUDE
)
endif()
@ -409,9 +417,8 @@ elseif(WIN32)
)
install( # same as linux!, deduplicate
DIRECTORY ${CMAKE_SOURCE_DIR}/release/text
DIRECTORY ${BLENDER_TEXT_FILES}
DESTINATION ${TARGETDIR}
PATTERN ".svn" EXCLUDE
)
install( # same as linux!, deduplicate
@ -630,9 +637,9 @@ elseif(APPLE)
endmacro()
# install release and app files
install_dir(
${CMAKE_SOURCE_DIR}/release/text/
\${TARGETDIR}
install(
FILES ${BLENDER_TEXT_FILES}
DESTINATION ${TARGETDIR}
)
install(
@ -697,6 +704,12 @@ elseif(APPLE)
endif()
endif()
unset(BLENDER_TEXT_FILES)
# -----------------------------------------------------------------------------
# Setup link libs
add_dependencies(blender makesdna)
get_property(BLENDER_LINK_LIBS GLOBAL PROPERTY BLENDER_LINK_LIBS)

@ -172,21 +172,21 @@ add_test(import_stl_knot_max_simplified ${TEST_BLENDER_EXE}
add_test(import_x3d_cube ${TEST_BLENDER_EXE}
--python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
--run={'FINISHED'}&bpy.ops.import_scene.x3d\(filepath='${TEST_SRC_DIR}/io_tests/x3d/color_cube.x3d'\)
--md5=2ed64325dd3d62be6ce43c64219376ec --md5_method=SCENE
--md5=3fae9be004199c145941cd3f9f80ad7b --md5_method=SCENE
--write-blend=${TEST_OUT_DIR}/import_x3d_cube.blend
)
add_test(import_x3d_teapot ${TEST_BLENDER_EXE}
--python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
--run={'FINISHED'}&bpy.ops.import_scene.x3d\(filepath='${TEST_SRC_DIR}/io_tests/x3d/teapot.x3d'\)
--md5=8b8b386900b8e3d2c036a38c625f4079 --md5_method=SCENE
--md5=8ee196c71947dce4199d55698501691e --md5_method=SCENE
--write-blend=${TEST_OUT_DIR}/import_x3d_teapot.blend
)
add_test(import_x3d_suzanne_material ${TEST_BLENDER_EXE}
--python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
--run={'FINISHED'}&bpy.ops.import_scene.x3d\(filepath='${TEST_SRC_DIR}/io_tests/x3d/suzanne_material.x3d'\)
--md5=999129ba835f0ccb98c4bb299f6c2fef --md5_method=SCENE
--md5=3edea1353257d8b5a5f071942f417be6 --md5_method=SCENE
--write-blend=${TEST_OUT_DIR}/import_x3d_suzanne_material.blend
)
@ -196,7 +196,7 @@ add_test(export_x3d_cube ${TEST_BLENDER_EXE}
--python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
--run={'FINISHED'}&bpy.ops.export_scene.x3d\(filepath='${TEST_OUT_DIR}/export_x3d_cube.x3d',use_selection=False\)
--md5_source=${TEST_OUT_DIR}/export_x3d_cube.x3d
--md5=30d2b056c004144cd4a0d172484a66f3 --md5_method=FILE
--md5=6ae36be272d6f84c697e84a8b6463273 --md5_method=FILE
)
add_test(export_x3d_nurbs ${TEST_BLENDER_EXE}
@ -204,7 +204,7 @@ add_test(export_x3d_nurbs ${TEST_BLENDER_EXE}
--python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
--run={'FINISHED'}&bpy.ops.export_scene.x3d\(filepath='${TEST_OUT_DIR}/export_x3d_nurbs.x3d',use_selection=False\)
--md5_source=${TEST_OUT_DIR}/export_x3d_nurbs.x3d
--md5=7c15afe7b0cf007b842a925508b7d966 --md5_method=FILE
--md5=2d5bcf43cf7b6fbbef1c8cc566968fe5 --md5_method=FILE
)
add_test(export_x3d_all_objects ${TEST_BLENDER_EXE}
@ -212,7 +212,7 @@ add_test(export_x3d_all_objects ${TEST_BLENDER_EXE}
--python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
--run={'FINISHED'}&bpy.ops.export_scene.x3d\(filepath='${TEST_OUT_DIR}/export_x3d_all_objects.x3d',use_selection=False\)
--md5_source=${TEST_OUT_DIR}/export_x3d_all_objects.x3d
--md5=d7d6574e833f3f051b65ef4577485fa9 --md5_method=FILE
--md5=bba48ca191e8891adb27c59ed4ce4735 --md5_method=FILE
)