svn merge -r41371:41420 ^/trunk/blender

This commit is contained in:
Campbell Barton
2011-11-01 02:01:09 +00:00
26 changed files with 174 additions and 120 deletions

View File

@@ -302,6 +302,9 @@ set(PLATFORM_CFLAGS)
set(C_WARNINGS)
set(CXX_WARNINGS)
# for gcc -Wno-blah-blah
set(CC_REMOVE_STRICT_FLAGS)
# libraries to link the binary with passed to target_link_libraries()
# known as LLIBS to scons
set(PLATFORM_LINKLIBS "")
@@ -1250,6 +1253,11 @@ if(CMAKE_COMPILER_IS_GNUCC)
# # this causes too many warnings, disable
# ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNDEFINED -Wundef)
# flags to undo strict flags
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_DEPRECATED_DECLARATIONS -Wno-deprecated-declarations)
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_PARAMETER -Wno-unused-parameter)
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_BUT_SET_VARIABLE -Wno-unused-but-set-variable)
elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ALL -Wall)

View File

@@ -413,8 +413,7 @@ macro(remove_strict_flags)
remove_cc_flag("-Werror")
# negate flags implied by '-Wall'
add_cc_flag("-Wno-unused-parameter")
add_cc_flag("-Wno-unused-but-set-variable")
add_cc_flag("${CC_REMOVE_STRICT_FLAGS}")
endif()
if(MSVC)
@@ -434,7 +433,7 @@ macro(remove_strict_flags_file
if(CMAKE_COMPILER_IS_GNUCC)
set_source_files_properties(${_SOURCE}
PROPERTIES
COMPILE_FLAGS "-Wno-deprecated-declarations"
COMPILE_FLAGS "${CC_REMOVE_STRICT_FLAGS}"
)
endif()

View File

@@ -336,7 +336,7 @@ else:
# some flags shuffling for different OS versions
if MAC_MIN_VERS == '10.3':
CCFLAGS = ['-fuse-cxa-atexit'] + CFLAGS
CCFLAGS = ['-fuse-cxa-atexit'] + CCFLAGS
PLATFORM_LINKFLAGS = ['-fuse-cxa-atexit'] + PLATFORM_LINKFLAGS
LLIBS.append('crt3.o')

View File

@@ -578,7 +578,7 @@ GHOST_SystemCocoa::GHOST_SystemCocoa()
if (strstr(rstring,"MacBookAir") ||
(strstr(rstring,"MacBook") && (rstring[strlen(rstring)-3]>='5') && (rstring[strlen(rstring)-3]<='9')))
m_hasMultiTouchTrackpad = true;
else m_hasMultiTouchTrackpad = true;
else m_hasMultiTouchTrackpad = true; // experimental, changes only MagicMouse behaviour (zoom->pan) but enables MagicTrackpad for all Macs
free( rstring );
rstring = NULL;
@@ -1610,7 +1610,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
GHOST_TInt32 x, y;
window->clientToScreenIntern(mousePos.x, mousePos.y, x, y);
pushEvent(new GHOST_EventTrackpad([event timestamp]*1000, window, GHOST_kTrackpadEventMagnify, x, y,
[event magnification]*250.0 + 0.1, 0));
[event magnification]*125.0 + 0.1, 0));
}
break;

View File

@@ -1371,9 +1371,9 @@ class WM_OT_keyitem_add(Operator):
km = context.keymap
if km.is_modal:
km.keymap_items.new_modal("", 'A', 'PRESS') #~ kmi
km.keymap_items.new_modal("", 'A', 'PRESS')
else:
km.keymap_items.new("none", 'A', 'PRESS') #~ kmi
km.keymap_items.new("none", 'A', 'PRESS')
# clear filter and expand keymap so we can see the newly added item
if context.space_data.filter_text != "":

View File

@@ -711,19 +711,14 @@ class VIEW3D_PT_tools_brush_texture(PaintPanel, Panel):
if context.sculpt_object:
#XXX duplicated from properties_texture.py
col.separator()
col.label(text="Brush Mapping:")
row = col.row(align=True)
row.prop(tex_slot, "map_mode", expand=True)
col.row().prop(tex_slot, "map_mode", expand=True)
col.separator()
col = layout.column()
col.active = tex_slot.map_mode in {'FIXED'}
col.label(text="Angle:")
col = layout.column()
if not brush.use_anchor and brush.sculpt_tool not in {'GRAB', 'SNAKE_HOOK', 'THUMB', 'ROTATE'} and tex_slot.map_mode in {'FIXED'}:
col.prop(brush, "texture_angle_source_random", text="")
else:
@@ -740,47 +735,33 @@ class VIEW3D_PT_tools_brush_texture(PaintPanel, Panel):
#col.prop(brush, "use_rake", toggle=True, icon='PARTICLEMODE', text="")
col = layout.column()
col.prop(tex_slot, "angle", text="")
col.active = tex_slot.map_mode in {'FIXED', 'TILED'}
col.prop(tex_slot, "angle", text="")
#col = layout.column()
#col.prop(brush, "use_random_rotation")
#col.active = (not brush.use_rake) and (not brush.use_anchor) and (brush.sculpt_tool not in {'GRAB', 'SNAKE_HOOK', 'THUMB', 'ROTATE'}) and tex_slot.map_mode in {'FIXED'}
split = layout.split()
split.prop(tex_slot, "offset")
split.prop(tex_slot, "scale")
col = split.column()
col.prop(tex_slot, "offset")
col = split.column()
col.prop(tex_slot, "scale")
col = layout.column()
row = col.row(align=True)
row.label(text="Sample Bias:")
row = col.row(align=True)
row.prop(brush, "texture_sample_bias", slider=True, text="")
row = col.row(align=True)
row.label(text="Overlay:")
row.active = tex_slot.map_mode in {'FIXED', 'TILED'}
row = col.row(align=True)
col = row.column()
if brush.use_texture_overlay:
col.prop(brush, "use_texture_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF')
else:
col.prop(brush, "use_texture_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON')
col = layout.column(align=True)
col.label(text="Sample Bias:")
col.prop(brush, "texture_sample_bias", slider=True, text="")
col = layout.column(align=True)
col.active = tex_slot.map_mode in {'FIXED', 'TILED'}
col.label(text="Overlay:")
col = row.column()
col.prop(brush, "texture_overlay_alpha", text="Alpha")
col.active = tex_slot.map_mode in {'FIXED', 'TILED'} and brush.use_texture_overlay
row = col.row()
if brush.use_texture_overlay:
row.prop(brush, "use_texture_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF')
else:
row.prop(brush, "use_texture_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON')
sub = row.row()
sub.active = tex_slot.map_mode in {'FIXED', 'TILED'} and brush.use_texture_overlay
sub.prop(brush, "texture_overlay_alpha", text="Alpha")
class VIEW3D_PT_tools_brush_tool(PaintPanel, Panel):
@@ -985,18 +966,14 @@ class VIEW3D_PT_sculpt_symmetry(PaintPanel, Panel):
sculpt = context.tool_settings.sculpt
split = layout.split()
col = split.column()
col = layout.column(align=True)
col.label(text="Mirror:")
col.prop(sculpt, "use_symmetry_x", text="X")
col.prop(sculpt, "use_symmetry_y", text="Y")
col.prop(sculpt, "use_symmetry_z", text="Z")
split.prop(sculpt, "radial_symmetry", text="Radial")
layout.separator()
row = col.row()
row.prop(sculpt, "use_symmetry_x", text="X", toggle=True)
row.prop(sculpt, "use_symmetry_y", text="Y", toggle=True)
row.prop(sculpt, "use_symmetry_z", text="Z", toggle=True)
layout.column().prop(sculpt, "radial_symmetry", text="Radial")
layout.prop(sculpt, "use_symmetry_feather", text="Feather")

View File

@@ -107,8 +107,8 @@ void defvert_sync (MDeformVert *dvert_r, const MDeformVert *dvert, int use_verif
MDeformWeight *dw;
for(i=0, dw=dvert->dw; i < dvert->totweight; i++, dw++) {
MDeformWeight *dw_r;
if(use_verify) dw_r= defvert_find_index(dvert_r, dw->def_nr);
else dw_r= defvert_verify_index(dvert_r, dw->def_nr);
if(use_verify) dw_r= defvert_verify_index(dvert_r, dw->def_nr);
else dw_r= defvert_find_index(dvert_r, dw->def_nr);
if(dw_r) {
dw_r->weight= dw->weight;
@@ -126,8 +126,8 @@ void defvert_sync_mapped (MDeformVert *dvert_r, const MDeformVert *dvert, const
for (i=0, dw=dvert->dw; i < dvert->totweight; i++, dw++) {
if (dw->def_nr < flip_map_len) {
MDeformWeight *dw_r;
if(use_verify) dw_r= defvert_find_index(dvert_r, flip_map[dw->def_nr]);
else dw_r= defvert_verify_index(dvert_r, flip_map[dw->def_nr]);
if(use_verify) dw_r= defvert_verify_index(dvert_r, flip_map[dw->def_nr]);
else dw_r= defvert_find_index(dvert_r, flip_map[dw->def_nr]);
if(dw_r) {
dw_r->weight= dw->weight;
@@ -490,25 +490,25 @@ MDeformWeight *defvert_verify_index(MDeformVert *dv, const int defgroup)
MDeformWeight *newdw;
/* do this check always, this function is used to check for it */
if(!dv || defgroup<0)
if(!dv || defgroup < 0)
return NULL;
newdw = defvert_find_index(dv, defgroup);
newdw= defvert_find_index(dv, defgroup);
if(newdw)
return newdw;
newdw = BLI_cellalloc_calloc(sizeof(MDeformWeight)*(dv->totweight+1), "deformWeight");
newdw= BLI_cellalloc_calloc(sizeof(MDeformWeight)*(dv->totweight+1), "deformWeight");
if(dv->dw) {
memcpy(newdw, dv->dw, sizeof(MDeformWeight)*dv->totweight);
BLI_cellalloc_free(dv->dw);
}
dv->dw=newdw;
dv->dw[dv->totweight].weight=0.0f;
dv->dw[dv->totweight].def_nr=defgroup;
dv->dw= newdw;
newdw += dv->totweight;
newdw->weight= 0.0f;
newdw->def_nr= defgroup;
/* Group index */
dv->totweight++;
return dv->dw+(dv->totweight-1);
return newdw;
}

View File

@@ -981,7 +981,7 @@ int BKE_add_image_extension(char *string, int imtype)
|| (G.have_quicktime && BLI_testextensie_array(string, imb_ext_image_qt))) {
return BLI_replace_extension(string, FILE_MAX, extension);
} else {
strcat(string, extension);
return BLI_ensure_extension(string, FILE_MAX, extension);
return TRUE;
}

View File

@@ -541,7 +541,7 @@ Mesh *copy_mesh(Mesh *me)
id_lib_extern((ID*)tface->tpage);
}
}
for(i=0; i<me->pdata.totlayer; i++) {
if(me->pdata.layers[i].type == CD_MTEXPOLY) {
txface= (MTexPoly*)me->pdata.layers[i].data;
@@ -2004,7 +2004,7 @@ UvVertMap *make_uv_vert_map(struct MPoly *mpoly, struct MLoop *mloop, struct MLo
if(totuv==0)
return NULL;
vmap= (UvVertMap*)MEM_callocN(sizeof(*vmap), "UvVertMap");
if (!vmap)
return NULL;

View File

@@ -102,6 +102,7 @@ int BLI_testextensie(const char *str, const char *ext);
int BLI_testextensie_array(const char *str, const char **ext_array);
int BLI_testextensie_glob(const char *str, const char *ext_fnmatch);
int BLI_replace_extension(char *path, size_t maxlen, const char *ext);
int BLI_ensure_extension(char *path, size_t maxlen, const char *ext);
void BLI_uniquename(struct ListBase *list, void *vlink, const char defname[], char delim, short name_offs, short len);
int BLI_uniquename_cb(int (*unique_check)(void *, const char *), void *arg, const char defname[], char delim, char *name, short name_len);
void BLI_newname(char * name, int add);

View File

@@ -70,7 +70,8 @@ int BLI_system_thread_count(void); /* gets the number of threads the system can
#define LOCK_CUSTOM1 3
#define LOCK_RCACHE 4
#define LOCK_OPENGL 5
#define LOCK_SCANFILL 6
#define LOCK_NODES 6
#define LOCK_SCANFILL 7
void BLI_lock_thread(int type);
void BLI_unlock_thread(int type);

View File

@@ -1398,22 +1398,51 @@ int BLI_testextensie_glob(const char *str, const char *ext_fnmatch)
int BLI_replace_extension(char *path, size_t maxlen, const char *ext)
{
size_t path_len= strlen(path);
size_t ext_len= strlen(ext);
size_t a;
for(a=strlen(path); a>0; a--) {
if(path[a-1] == '.' || path[a-1] == '/' || path[a-1] == '\\') {
a--;
for(a= path_len - 1; a >= 0; a--) {
if (ELEM3(path[a], '.', '/', '\\')) {
break;
}
}
if(path[a] != '.')
a= strlen(path);
if(a + strlen(ext) >= maxlen)
if(a + ext_len >= maxlen)
return 0;
strcpy(path+a, ext);
memcpy(path+a, ext, ext_len + 1);
return 1;
}
/* strip's trailing '.'s and adds the extension only when needed */
int BLI_ensure_extension(char *path, size_t maxlen, const char *ext)
{
size_t path_len= strlen(path);
size_t ext_len= strlen(ext);
size_t a;
/* first check the extension is alread there */
if ( (ext_len <= path_len) &&
(strcmp(path + (path_len - ext_len), ext) == 0))
{
return 1;
}
for(a= path_len - 1; a >= 0; a--) {
if (path[a] == '.') {
path[a]= '\0';
}
else {
break;
}
}
a++;
if(a + ext_len >= maxlen)
return 0;
memcpy(path+a, ext, ext_len + 1);
return 1;
}
@@ -1845,7 +1874,7 @@ void BLI_where_is_temp(char *fullname, const size_t maxlen, char *userdir)
/* add a trailing slash if needed */
BLI_add_slash(fullname);
#ifdef WIN32
if(userdir != fullname) {
if(userdir && userdir != fullname) {
BLI_strncpy(userdir, fullname, maxlen); /* also set user pref to show %TEMP%. /tmp/ is just plain confusing for Windows users. */
}
#endif

View File

@@ -113,6 +113,7 @@ static pthread_mutex_t _viewer_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_mutex_t _custom1_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_mutex_t _rcache_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_mutex_t _opengl_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_mutex_t _nodes_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_mutex_t _scanfill_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_t mainid;
static int thread_levels= 0; /* threads can be invoked inside threads */
@@ -348,6 +349,8 @@ void BLI_lock_thread(int type)
pthread_mutex_lock(&_rcache_lock);
else if (type==LOCK_OPENGL)
pthread_mutex_lock(&_opengl_lock);
else if (type==LOCK_NODES)
pthread_mutex_lock(&_nodes_lock);
else if (type == LOCK_SCANFILL)
pthread_mutex_lock(&_scanfill_lock);
}
@@ -366,6 +369,8 @@ void BLI_unlock_thread(int type)
pthread_mutex_unlock(&_rcache_lock);
else if(type==LOCK_OPENGL)
pthread_mutex_unlock(&_opengl_lock);
else if(type==LOCK_NODES)
pthread_mutex_unlock(&_nodes_lock);
else if(type == LOCK_SCANFILL)
pthread_mutex_unlock(&_scanfill_lock);
}

View File

@@ -962,6 +962,7 @@ void uiDrawBlock(const bContext *C, uiBlock *block)
ARegion *ar;
uiBut *but;
rcti rect;
int multisample_enabled;
/* get menu region or area region */
ar= CTX_wm_menu(C);
@@ -971,6 +972,11 @@ void uiDrawBlock(const bContext *C, uiBlock *block)
if(!block->endblock)
uiEndBlock(C, block);
/* disable AA, makes widgets too blurry */
multisample_enabled= glIsEnabled(GL_MULTISAMPLE_ARB);
if(multisample_enabled)
glDisable(GL_MULTISAMPLE_ARB);
/* we set this only once */
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
@@ -1015,6 +1021,9 @@ void uiDrawBlock(const bContext *C, uiBlock *block)
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
if(multisample_enabled)
glEnable(GL_MULTISAMPLE_ARB);
ui_draw_links(block);
}

View File

@@ -360,7 +360,6 @@ void paintface_select_linked(bContext *UNUSED(C), Object *ob, int UNUSED(mval[2]
paintface_flush_flags(ob);
}
/* note: caller needs to run paintface_flush_flags(ob) after this */
void paintface_deselect_all_visible(Object *ob, int action, short flush_flags)
{
Mesh *me;

View File

@@ -1226,6 +1226,7 @@ static void backdrawview3d(Scene *scene, ARegion *ar, View3D *v3d)
{
RegionView3D *rv3d= ar->regiondata;
struct Base *base = scene->basact;
int multisample_enabled;
rcti winrct;
BLI_assert(ar->regiontype == RGN_TYPE_WINDOW);
@@ -1252,8 +1253,13 @@ static void backdrawview3d(Scene *scene, ARegion *ar, View3D *v3d)
if(v3d->drawtype > OB_WIRE) v3d->zbuf= TRUE;
/* dithering and AA break color coding, so disable */
glDisable(GL_DITHER);
multisample_enabled= glIsEnabled(GL_MULTISAMPLE_ARB);
if(multisample_enabled)
glDisable(GL_MULTISAMPLE_ARB);
region_scissor_winrct(ar, &winrct);
glScissor(winrct.xmin, winrct.ymin, winrct.xmax - winrct.xmin, winrct.ymax - winrct.ymin);
@@ -1272,9 +1278,8 @@ static void backdrawview3d(Scene *scene, ARegion *ar, View3D *v3d)
G.f |= G_BACKBUFSEL;
if(base && (base->lay & v3d->lay)) {
if(base && (base->lay & v3d->lay))
draw_object_backbufsel(scene, v3d, rv3d, base->object);
}
v3d->flag &= ~V3D_INVALID_BACKBUF;
ar->swap= 0; /* mark invalid backbuf for wm draw */
@@ -1283,6 +1288,8 @@ static void backdrawview3d(Scene *scene, ARegion *ar, View3D *v3d)
v3d->zbuf= FALSE;
glDisable(GL_DEPTH_TEST);
glEnable(GL_DITHER);
if(multisample_enabled)
glEnable(GL_MULTISAMPLE_ARB);
if(rv3d->rflag & RV3D_CLIPPING)
view3d_clr_clipping();

View File

@@ -2946,6 +2946,7 @@ static BGpic *background_image_add(bContext *C)
bgpic->iuser.fie_ima= 2;
bgpic->iuser.ok= 1;
bgpic->view= 0; /* 0 for all */
bgpic->flag |= V3D_BGPIC_EXPANDED;
BLI_addtail(&v3d->bgpicbase, bgpic);

View File

@@ -410,7 +410,7 @@ void RNA_api_ui_layout(StructRNA *srna)
RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_string(func, "prop_list", "", 0, "",
"Identifier of a string property in each data member, specifying which "
"of its properties should have a widget displayed in its row.");
"of its properties should have a widget displayed in its row");
RNA_def_int(func, "rows", 5, 0, INT_MAX, "", "Number of rows to display", 0, INT_MAX);
RNA_def_int(func, "maxrows", 5, 0, INT_MAX, "", "Maximum number of rows to display", 0, INT_MAX);
RNA_def_enum(func, "type", list_type_items, 0, "Type", "Type of list to use");

View File

@@ -611,9 +611,11 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
if (ed->v2 == mloop[mpoly[fidx].loopstart+k1].v) {
k2 = (k1 + mp->totloop - 1)%mp->totloop;
SWAP(int, k1, k2);
} else if (ed->v1 == mloop[mpoly[fidx].loopstart+k1].v) {
}
else if (ed->v1 == mloop[mpoly[fidx].loopstart+k1].v) {
k2 = (k1+1)%mp->totloop;
} else {
}
else {
fprintf(stderr, "%s: solidify bad edge/vert\n", __func__);
k2 = k1;
}
@@ -664,7 +666,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
}
if(crease_outer) {
/* crease += crease_outer; without wrapping */
unsigned char *cr= (unsigned char *)&(medge[eidx].crease);
unsigned char *cr= (unsigned char *)&(ed->crease);
int tcr= *cr + crease_outer;
*cr= tcr > 255 ? 255 : tcr;
}
@@ -684,7 +686,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
#endif
if (origindex) {
origindex[numFaces * 2 + i]= ORIGINDEX_NONE;
origindex[numFaces * 2 + i]= fidx;
}
}
@@ -722,7 +724,8 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
/* must recalculate normals with vgroups since they can displace unevenly [#26888] */
if(dvert) {
CDDM_calc_normals(result);
} else {
}
else {
CDDM_recalc_tesselation(result, 1);
}

View File

@@ -33,9 +33,9 @@
/* **************** MIX RGB ******************** */
static bNodeSocketTemplate cmp_node_mix_rgb_in[]= {
{ SOCK_FLOAT, 1, "Fac", 0.5f, 0.0f, 0.0f, 0.0f, 0.0f, 5.0f, PROP_FACTOR},
{ SOCK_RGBA, 1, "Image", 0.8f, 0.8f, 0.8f, 1.0f},
{ SOCK_RGBA, 1, "Image", 0.8f, 0.8f, 0.8f, 1.0f},
{ SOCK_FLOAT, 1, "Fac", 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 5.0f, PROP_FACTOR},
{ SOCK_RGBA, 1, "Image", 1.0f, 1.0f, 1.0f, 1.0f},
{ SOCK_RGBA, 1, "Image", 1.0f, 1.0f, 1.0f, 1.0f},
{ -1, 0, "" }
};
static bNodeSocketTemplate cmp_node_mix_rgb_out[]= {

View File

@@ -212,8 +212,15 @@ void ntreeShaderExecTree(bNodeTree *ntree, ShadeInput *shi, ShadeResult *shr)
/* each material node has own local shaderesult, with optional copying */
memset(shr, 0, sizeof(ShadeResult));
if (!exec)
exec = ntree->execdata = ntreeShaderBeginExecTree(ntree, 1);
/* ensure execdata is only initialized once */
if (!exec) {
BLI_lock_thread(LOCK_NODES);
if(!ntree->execdata)
ntree->execdata = ntreeShaderBeginExecTree(ntree, 1);
BLI_unlock_thread(LOCK_NODES);
exec = ntree->execdata;
}
nts= ntreeGetThreadStack(exec, shi->thread);
ntreeExecThreadNodes(exec, nts, &scd, shi->thread);

View File

@@ -232,8 +232,15 @@ int ntreeTexExecTree(
data.mtex= mtex;
data.shi= shi;
if (!exec)
exec = ntreeTexBeginExecTree(nodes, 1);
/* ensure execdata is only initialized once */
if (!exec) {
BLI_lock_thread(LOCK_NODES);
if(!nodes->execdata)
ntreeTexBeginExecTree(nodes, 1);
BLI_unlock_thread(LOCK_NODES);
exec= nodes->execdata;
}
nts= ntreeGetThreadStack(exec, thread);
ntreeExecThreadNodes(exec, nts, &data, thread);

View File

@@ -54,8 +54,14 @@ static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor
float co[3], dxt[3], dyt[3];
copy_v3_v3(co, p->co);
copy_v3_v3(dxt, p->dxt);
copy_v3_v3(dyt, p->dyt);
if (p->osatex) {
copy_v3_v3(dxt, p->dxt);
copy_v3_v3(dyt, p->dyt);
}
else {
zero_v3(dxt);
zero_v3(dyt);
}
if(node->custom2 || node->need_exec==0) {
/* this node refers to its own texture tree! */

View File

@@ -20,7 +20,10 @@
*
* The Original Code was in: source/blender/bpython/include/BPY_extern.h
*
* Contributor(s): Michel Selten, Willian P. Germano, Chris Keith
* Contributor(s): Michel Selten,
* Willian P. Germano,
* Chris Keith,
* Campbell Barton
*
* ***** END GPL LICENSE BLOCK *****
*/
@@ -39,14 +42,10 @@ struct ID; /* DNA_ID.h */
struct Object; /* DNA_object_types.h */
struct ChannelDriver; /* DNA_anim_types.h */
struct ListBase; /* DNA_listBase.h */
struct SpaceText; /* DNA_space_types.h */
struct ScrArea; /* DNA_screen_types.h */
struct bScreen; /* DNA_screen_types.h */
struct bConstraint; /* DNA_constraint_types.h */
struct bPythonConstraint; /* DNA_constraint_types.h */
struct bConstraintOb; /* DNA_constraint_types.h */
struct bConstraintTarget; /* DNA_constraint_types.h*/
struct BPyMenu;
struct bContext;
struct bContextDataResult;
struct ReportList;
@@ -61,16 +60,9 @@ void BPY_pyconstraint_target(struct bPythonConstraint *con, struct bConstraintTa
void BPY_pyconstraint_update(struct Object *owner, struct bConstraint *con);
int BPY_is_pyconstraint(struct Text *text);
// void BPY_free_pyconstraint_links(struct Text *text);
//
void BPY_python_start(int argc, const char **argv);
void BPY_python_end(void);
// void init_syspath(int first_time);
// void syspath_append(char *dir);
// void BPY_rebuild_syspath(void);
// int BPY_path_update(void);
//
// int BPY_Err_getLinenumber(void);
// const char *BPY_Err_getFilename(void);
/* 2.5 UI Scripts */
int BPY_filepath_exec(struct bContext *C, const char *filepath, struct ReportList *reports);

View File

@@ -65,9 +65,9 @@ PyObject *BPy_IDGroup_WrapData( ID *id, IDProperty *prop )
switch ( prop->type ) {
case IDP_STRING:
#ifdef USE_STRING_COERCE
return PyC_UnicodeFromByteAndSize(IDP_Array(prop), prop->len);
return PyC_UnicodeFromByteAndSize(IDP_Array(prop), prop->len - 1);
#else
return PyUnicode_FromStringAndSize(IDP_Array(prop), prop->len);
return PyUnicode_FromStringAndSize(IDP_Array(prop), prop->len - 1);
#endif
case IDP_INT:
return PyLong_FromLong( (long)prop->data.val );
@@ -483,9 +483,9 @@ static PyObject *BPy_IDGroup_MapDataToPy(IDProperty *prop)
switch (prop->type) {
case IDP_STRING:
#ifdef USE_STRING_COERCE
return PyC_UnicodeFromByteAndSize(IDP_Array(prop), prop->len);
return PyC_UnicodeFromByteAndSize(IDP_Array(prop), prop->len - 1);
#else
return PyUnicode_FromStringAndSize(IDP_Array(prop), prop->len);
return PyUnicode_FromStringAndSize(IDP_Array(prop), prop->len - 1);
#endif
break;
case IDP_FLOAT:
@@ -625,11 +625,11 @@ static PyObject *BPy_IDGroup_IterItems(BPy_IDProperty *self)
}
/* utility function */
static void BPy_IDGroup_CorrectListLen(IDProperty *prop, PyObject *seq, int len)
static void BPy_IDGroup_CorrectListLen(IDProperty *prop, PyObject *seq, int len, const char *func)
{
int j;
printf("ID Property Error found and corrected in BPy_IDGroup_GetKeys/Values/Items!\n");
printf("%s: ID Property Error found and corrected!\n", func);
/*fill rest of list with valid references to None*/
for (j=len; j<prop->len; j++) {
@@ -654,7 +654,7 @@ PyObject *BPy_Wrap_GetKeys(IDProperty *prop)
for (; loop; loop=loop->next, i++) {}
if (i != prop->len) { /* if the loop didnt finish, we know the length is wrong */
BPy_IDGroup_CorrectListLen(prop, seq, i);
BPy_IDGroup_CorrectListLen(prop, seq, i, __func__);
Py_DECREF(seq); /*free the list*/
/*call self again*/
return BPy_Wrap_GetKeys(prop);
@@ -674,7 +674,7 @@ PyObject *BPy_Wrap_GetValues(ID *id, IDProperty *prop)
}
if (i != prop->len) {
BPy_IDGroup_CorrectListLen(prop, seq, i);
BPy_IDGroup_CorrectListLen(prop, seq, i, __func__);
Py_DECREF(seq); /*free the list*/
/*call self again*/
return BPy_Wrap_GetValues(id, prop);
@@ -697,7 +697,7 @@ PyObject *BPy_Wrap_GetItems(ID *id, IDProperty *prop)
}
if (i != prop->len) {
BPy_IDGroup_CorrectListLen(prop, seq, i);
BPy_IDGroup_CorrectListLen(prop, seq, i, __func__);
Py_DECREF(seq); /*free the list*/
/*call self again*/
return BPy_Wrap_GetItems(id, prop);

View File

@@ -1949,7 +1949,10 @@ static int blend_save_check(bContext *UNUSED(C), wmOperator *op)
{
char filepath[FILE_MAX];
RNA_string_get(op->ptr, "filepath", filepath);
if(BLI_replace_extension(filepath, sizeof(filepath), ".blend")) {
if(!BLO_has_bfile_extension(filepath)) {
/* some users would prefer BLI_replace_extension(),
* we keep getting knit-picking bug reports about this - campbell */
BLI_ensure_extension(filepath, FILE_MAX, ".blend");
RNA_string_set(op->ptr, "filepath", filepath);
return TRUE;
}