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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2011-01-23 02:38:28 +0300
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2011-01-23 02:38:28 +0300
commit50ced6b0176db8cf4d2393005be7f371ab9716de (patch)
tree0788a93e86b4b28c9338c74826aaab93547dbccb /source/blender
parentc7a122aa27662a2fb528663ddd3dd652cdda2010 (diff)
parentf39c794c7c3eca9c73ea0bdab084e6c191343965 (diff)
Merged changes in the trunk up to revision 34459.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/BKE_global.h7
-rw-r--r--source/blender/blenkernel/BKE_particle.h2
-rw-r--r--source/blender/blenkernel/BKE_pointcache.h2
-rw-r--r--source/blender/blenkernel/intern/DerivedMesh.c2
-rw-r--r--source/blender/blenkernel/intern/blender.c4
-rw-r--r--source/blender/blenkernel/intern/fcurve.c2
-rw-r--r--source/blender/blenkernel/intern/implicit.c5
-rw-r--r--source/blender/blenkernel/intern/ipo.c2
-rw-r--r--source/blender/blenkernel/intern/mball.c11
-rw-r--r--source/blender/blenkernel/intern/nla.c12
-rw-r--r--source/blender/blenkernel/intern/node.c64
-rw-r--r--source/blender/blenkernel/intern/object.c2
-rw-r--r--source/blender/blenkernel/intern/particle.c4
-rw-r--r--source/blender/blenkernel/intern/particle_system.c13
-rw-r--r--source/blender/blenkernel/intern/report.c8
-rw-r--r--source/blender/blenkernel/intern/softbody.c2
-rw-r--r--source/blender/blenlib/BLI_bpath.h4
-rw-r--r--source/blender/blenlib/intern/boxpack2d.c14
-rw-r--r--source/blender/blenlib/intern/bpath.c68
-rw-r--r--source/blender/blenlib/intern/math_geom.c28
-rw-r--r--source/blender/blenloader/intern/readfile.c25
-rw-r--r--source/blender/blenloader/intern/writefile.c33
-rw-r--r--source/blender/editors/animation/keyframing.c2
-rw-r--r--source/blender/editors/animation/keyingsets.c2
-rw-r--r--source/blender/editors/armature/editarmature.c11
-rw-r--r--source/blender/editors/curve/editcurve.c23
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c45
-rw-r--r--source/blender/editors/include/ED_view3d.h2
-rw-r--r--source/blender/editors/include/UI_interface.h1
-rw-r--r--source/blender/editors/interface/interface.c5
-rw-r--r--source/blender/editors/interface/interface_handlers.c4
-rw-r--r--source/blender/editors/interface/interface_icons.c63
-rw-r--r--source/blender/editors/interface/interface_intern.h1
-rw-r--r--source/blender/editors/interface/interface_layout.c10
-rw-r--r--source/blender/editors/interface/interface_regions.c2
-rw-r--r--source/blender/editors/interface/interface_widgets.c56
-rw-r--r--source/blender/editors/interface/resources.c2
-rw-r--r--source/blender/editors/mesh/editmesh_lib.c2
-rw-r--r--source/blender/editors/object/object_add.c4
-rw-r--r--source/blender/editors/object/object_constraint.c8
-rw-r--r--source/blender/editors/object/object_relations.c10
-rw-r--r--source/blender/editors/object/object_vgroup.c123
-rw-r--r--source/blender/editors/physics/particle_edit.c3
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c11
-rw-r--r--source/blender/editors/space_action/action_select.c24
-rw-r--r--source/blender/editors/space_file/file_draw.c3
-rw-r--r--source/blender/editors/space_graph/graph_edit.c1
-rw-r--r--source/blender/editors/space_graph/graph_ops.c1
-rw-r--r--source/blender/editors/space_image/image_draw.c19
-rw-r--r--source/blender/editors/space_image/image_ops.c5
-rw-r--r--source/blender/editors/space_logic/logic_window.c3
-rw-r--r--source/blender/editors/space_nla/nla_channels.c3
-rw-r--r--source/blender/editors/space_nla/nla_edit.c164
-rw-r--r--source/blender/editors/space_nla/nla_intern.h1
-rw-r--r--source/blender/editors/space_nla/nla_ops.c4
-rw-r--r--source/blender/editors/space_nla/nla_select.c1
-rw-r--r--source/blender/editors/space_node/node_edit.c30
-rw-r--r--source/blender/editors/space_node/node_select.c1
-rw-r--r--source/blender/editors/space_outliner/outliner.c31
-rw-r--r--source/blender/editors/space_outliner/space_outliner.c1
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c2
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c4
-rw-r--r--source/blender/editors/space_view3d/view3d_select.c26
-rw-r--r--source/blender/editors/space_view3d/view3d_toolbar.c3
-rw-r--r--source/blender/editors/space_view3d/view3d_view.c12
-rw-r--r--source/blender/editors/transform/transform_conversions.c83
-rw-r--r--source/blender/editors/uvedit/uvedit_ops.c4
-rw-r--r--source/blender/editors/uvedit/uvedit_unwrap_ops.c2
-rw-r--r--source/blender/imbuf/IMB_imbuf_types.h7
-rw-r--r--source/blender/imbuf/intern/allocimbuf.c3
-rw-r--r--source/blender/imbuf/intern/divers.c2
-rw-r--r--source/blender/imbuf/intern/jp2.c6
-rw-r--r--source/blender/makesdna/DNA_ID.h3
-rw-r--r--source/blender/makesdna/DNA_action_types.h4
-rw-r--r--source/blender/makesdna/DNA_brush_types.h3
-rw-r--r--source/blender/makesdna/DNA_ipo_types.h4
-rw-r--r--source/blender/makesdna/DNA_lamp_types.h2
-rw-r--r--source/blender/makesdna/DNA_object_force.h2
-rw-r--r--source/blender/makesdna/DNA_object_types.h12
-rw-r--r--source/blender/makesdna/DNA_particle_types.h2
-rw-r--r--source/blender/makesdna/DNA_scene_types.h10
-rw-r--r--source/blender/makesdna/DNA_space_types.h6
-rw-r--r--source/blender/makesdna/DNA_view3d_types.h4
-rw-r--r--source/blender/makesdna/DNA_windowmanager_types.h5
-rw-r--r--source/blender/makesrna/intern/makesrna.c6
-rw-r--r--source/blender/makesrna/intern/rna_access.c4
-rw-r--r--source/blender/makesrna/intern/rna_actuator.c2
-rw-r--r--source/blender/makesrna/intern/rna_animation.c5
-rw-r--r--source/blender/makesrna/intern/rna_curve.c4
-rw-r--r--source/blender/makesrna/intern/rna_define.c8
-rw-r--r--source/blender/makesrna/intern/rna_fcurve.c24
-rw-r--r--source/blender/makesrna/intern/rna_internal.h10
-rw-r--r--source/blender/makesrna/intern/rna_internal_types.h9
-rw-r--r--source/blender/makesrna/intern/rna_material.c21
-rw-r--r--source/blender/makesrna/intern/rna_nla.c34
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c11
-rw-r--r--source/blender/makesrna/intern/rna_particle.c14
-rw-r--r--source/blender/makesrna/intern/rna_sculpt_paint.c28
-rw-r--r--source/blender/makesrna/intern/rna_sensor.c24
-rw-r--r--source/blender/modifiers/intern/MOD_mask.c2
-rw-r--r--source/blender/modifiers/intern/MOD_screw.c2
-rw-r--r--source/blender/modifiers/intern/MOD_solidify.c2
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_brightness.c15
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_texture.c4
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_image.c8
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_output.c4
-rw-r--r--source/blender/nodes/intern/TEX_util.c4
-rw-r--r--source/blender/python/generic/bgl.c37
-rw-r--r--source/blender/python/generic/mathutils.c35
-rw-r--r--source/blender/python/generic/mathutils_color.c4
-rw-r--r--source/blender/python/generic/mathutils_euler.c4
-rw-r--r--source/blender/python/generic/mathutils_geometry.c2
-rw-r--r--source/blender/python/generic/mathutils_matrix.c99
-rw-r--r--source/blender/python/generic/mathutils_quat.c6
-rw-r--r--source/blender/python/generic/mathutils_vector.c4
-rw-r--r--source/blender/python/intern/bpy.c2
-rw-r--r--source/blender/python/intern/bpy_driver.c2
-rw-r--r--source/blender/python/intern/bpy_interface.c3
-rw-r--r--source/blender/python/intern/bpy_props.c34
-rw-r--r--source/blender/python/intern/bpy_rna.c42
-rw-r--r--source/blender/render/intern/source/rayobject_octree.c7
-rw-r--r--source/blender/render/intern/source/texture.c2
-rw-r--r--source/blender/windowmanager/WM_api.h3
-rw-r--r--source/blender/windowmanager/intern/wm_cursors.c5
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c13
-rw-r--r--source/blender/windowmanager/intern/wm_files.c16
-rw-r--r--source/blender/windowmanager/intern/wm_init_exit.c5
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c18
128 files changed, 1157 insertions, 638 deletions
diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h
index 65567262441..d222fe8d296 100644
--- a/source/blender/blenkernel/BKE_global.h
+++ b/source/blender/blenkernel/BKE_global.h
@@ -61,7 +61,8 @@ typedef struct Global {
struct ListBase recent_files;
short afbreek, moving, file_loaded;
- short background;
+ char background;
+ char factory_startup;
short winpos, displaymode; /* used to be in Render */
short rendering; /* to indicate render is busy, prevent renderwindow events etc */
@@ -91,10 +92,6 @@ typedef struct Global {
/* ndof device found ? */
int ndofdevice;
-
- /* confusing... G.f and G.flags */
- int flags;
-
} Global;
/* **************** GLOBAL ********************* */
diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h
index f072a942216..3f7523d5264 100644
--- a/source/blender/blenkernel/BKE_particle.h
+++ b/source/blender/blenkernel/BKE_particle.h
@@ -312,7 +312,7 @@ void reset_particle(struct ParticleSimulationData *sim, struct ParticleData *pa,
/* psys_reset */
#define PSYS_RESET_ALL 1
#define PSYS_RESET_DEPSGRAPH 2
-#define PSYS_RESET_CHILDREN 3
+/* #define PSYS_RESET_CHILDREN 3 */ /*UNUSED*/
#define PSYS_RESET_CACHE_MISS 4
/* index_dmcache */
diff --git a/source/blender/blenkernel/BKE_pointcache.h b/source/blender/blenkernel/BKE_pointcache.h
index c8e967e8a9a..e4623a31807 100644
--- a/source/blender/blenkernel/BKE_pointcache.h
+++ b/source/blender/blenkernel/BKE_pointcache.h
@@ -45,7 +45,7 @@
#define PTCACHE_RESET_DEPSGRAPH 0
#define PTCACHE_RESET_BAKED 1
#define PTCACHE_RESET_OUTDATED 2
-#define PTCACHE_RESET_FREE 3
+/* #define PTCACHE_RESET_FREE 3 */ /*UNUSED*/
/* Add the blendfile name after blendcache_ */
#define PTCACHE_EXT ".bphys"
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index bee0b476f9f..c733a560620 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -2237,7 +2237,7 @@ static void mesh_build_data(Scene *scene, Object *ob, CustomDataMask dataMask)
{
Object *obact = scene->basact?scene->basact->object:NULL;
int editing = paint_facesel_test(ob);
- /* weight paint and face select need original indicies because of selection buffer drawing */
+ /* weight paint and face select need original indices because of selection buffer drawing */
int needMapping = (ob==obact) && (editing || (ob->mode & (OB_MODE_WEIGHT_PAINT|OB_MODE_VERTEX_PAINT)));
clear_mesh_caches(ob);
diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c
index 56869e503dd..6e08df0f465 100644
--- a/source/blender/blenkernel/intern/blender.c
+++ b/source/blender/blenkernel/intern/blender.c
@@ -160,7 +160,7 @@ static void clean_paths(Main *main)
char filepath_expanded[1024];
Scene *scene;
- for(BLI_bpathIterator_init(&bpi, main, main->name); !BLI_bpathIterator_isDone(bpi); BLI_bpathIterator_step(bpi)) {
+ for(BLI_bpathIterator_init(&bpi, main, main->name, BPATH_USE_PACKED); !BLI_bpathIterator_isDone(bpi); BLI_bpathIterator_step(bpi)) {
BLI_bpathIterator_getPath(bpi, filepath_expanded);
BLI_clean(filepath_expanded);
@@ -299,8 +299,6 @@ static void setup_app_data(bContext *C, BlendFileData *bfd, const char *filename
/* these are the same at times, should never copy to the same location */
if(G.main->name != filename)
BLI_strncpy(G.main->name, filename, FILE_MAX);
-
- BLI_strncpy(G.main->name, filename, FILE_MAX); /* is guaranteed current file */
/* baseflags, groups, make depsgraph, etc */
set_scene_bg(G.main, CTX_data_scene(C));
diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c
index 87dff0a58b6..ef1ac582c1e 100644
--- a/source/blender/blenkernel/intern/fcurve.c
+++ b/source/blender/blenkernel/intern/fcurve.c
@@ -221,7 +221,7 @@ FCurve *list_find_fcurve (ListBase *list, const char rna_path[], const int array
for (fcu= list->first; fcu; fcu= fcu->next) {
/* simple string-compare (this assumes that they have the same root...) */
if (fcu->rna_path && !strcmp(fcu->rna_path, rna_path)) {
- /* now check indicies */
+ /* now check indices */
if (fcu->array_index == array_index)
return fcu;
}
diff --git a/source/blender/blenkernel/intern/implicit.c b/source/blender/blenkernel/intern/implicit.c
index fc9c41070dc..8004f23c22a 100644
--- a/source/blender/blenkernel/intern/implicit.c
+++ b/source/blender/blenkernel/intern/implicit.c
@@ -1317,8 +1317,9 @@ DO_INLINE void cloth_calc_spring_force(ClothModifierData *clmd, ClothSpring *s,
VECSUB(extent, X[s->ij], tvect);
- dot = INPR(extent, extent);
- length = sqrt(dot);
+ // SEE MSG BELOW (these are UNUSED)
+ // dot = INPR(extent, extent);
+ // length = sqrt(dot);
k = clmd->sim_parms->goalspring;
diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c
index b4dd81ce356..db995fd4f1d 100644
--- a/source/blender/blenkernel/intern/ipo.c
+++ b/source/blender/blenkernel/intern/ipo.c
@@ -315,7 +315,7 @@ static const char *constraint_adrcodes_to_paths (int adrcode, int *array_index)
/* ShapeKey types
* NOTE: as we don't have access to the keyblock where the data comes from (for now),
- * we'll just use numerical indicies for now...
+ * we'll just use numerical indices for now...
*/
static char *shapekey_adrcodes_to_paths (int adrcode, int *UNUSED(array_index))
{
diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c
index 6e48b922424..a22fc165de7 100644
--- a/source/blender/blenkernel/intern/mball.c
+++ b/source/blender/blenkernel/intern/mball.c
@@ -1422,7 +1422,7 @@ void find_first_points(PROCESS *mbproc, MetaBall *mb, int a)
int i, j, k, c_i, c_j, c_k;
int index[3]={1,0,-1};
float f =0.0f;
- float in_v, out_v;
+ float in_v /*, out_v*/;
MB_POINT workp;
float tmp_v, workp_v, max_len, len, dx, dy, dz, nx, ny, nz, MAXN;
@@ -1483,7 +1483,7 @@ void find_first_points(PROCESS *mbproc, MetaBall *mb, int a)
calc_mballco(ml, (float *)&out);
- out_v = mbproc->function(out.x, out.y, out.z);
+ /*out_v = mbproc->function(out.x, out.y, out.z);*/ /*UNUSED*/
/* find "first points" on Implicit Surface of MetaElemnt ml */
workp.x = in.x;
@@ -1582,8 +1582,8 @@ float init_meta(Scene *scene, Object *ob) /* return totsize */
Object *bob;
MetaBall *mb;
MetaElem *ml;
- float size, totsize, (*mat)[4] = NULL, (*imat)[4] = NULL, obinv[4][4], obmat[4][4], vec[3];
- float temp1[4][4], temp2[4][4], temp3[4][4]; //max=0.0;
+ float size, totsize, obinv[4][4], obmat[4][4], vec[3];
+ //float max=0.0;
int a, obnr, zero_size=0;
char obname[32];
@@ -1602,7 +1602,6 @@ float init_meta(Scene *scene, Object *ob) /* return totsize */
ml= NULL;
if(bob==ob && (base->flag & OB_FROMDUPLI)==0) {
- mat= imat= 0;
mb= ob->data;
if(mb->editelems) ml= mb->editelems->first;
@@ -1649,6 +1648,8 @@ float init_meta(Scene *scene, Object *ob) /* return totsize */
while(ml) {
if(!(ml->flag & MB_HIDE)) {
int i;
+ float temp1[4][4], temp2[4][4], temp3[4][4];
+ float (*mat)[4] = NULL, (*imat)[4] = NULL;
float max_x, max_y, max_z, min_x, min_y, min_z;
max_x = max_y = max_z = -3.4e38;
diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c
index 595614ef1e7..6db03909aa3 100644
--- a/source/blender/blenkernel/intern/nla.c
+++ b/source/blender/blenkernel/intern/nla.c
@@ -78,7 +78,7 @@ void free_nlastrip (ListBase *strips, NlaStrip *strip)
/* remove reference to action */
if (strip->act)
- strip->act->id.us--;
+ id_us_min(&strip->act->id);
/* free remapping info */
//if (strip->remap)
@@ -160,7 +160,7 @@ NlaStrip *copy_nlastrip (NlaStrip *strip)
/* increase user-count of action */
if (strip_d->act)
- strip_d->act->id.us++;
+ id_us_plus(&strip_d->act->id);
/* copy F-Curves and modifiers */
copy_fcurves(&strip_d->fcurves, &strip->fcurves);
@@ -514,7 +514,7 @@ short BKE_nlastrips_has_space (ListBase *strips, float start, float end)
/* if start frame of strip is past the target end-frame, that means that
* we've gone past the window we need to check for, so things are fine
*/
- if (strip->start > end)
+ if (strip->start >= end)
return 1;
/* if the end of the strip is greater than either of the boundaries, the range
@@ -591,7 +591,7 @@ short BKE_nlastrips_add_strip (ListBase *strips, NlaStrip *strip)
/* find the right place to add the strip to the nominated track */
for (ns= strips->first; ns; ns= ns->next) {
/* if current strip occurs after the new strip, add it before */
- if (ns->start > strip->end) {
+ if (ns->start >= strip->end) {
BLI_insertlinkbefore(strips, ns, strip);
not_added= 0;
break;
@@ -683,7 +683,7 @@ void BKE_nlastrips_clear_metastrip (ListBase *strips, NlaStrip *strip)
}
/* free the meta-strip now */
- BLI_freelinkN(strips, strip);
+ free_nlastrip(strips, strip);
}
/* Remove meta-strips (i.e. flatten the list of strips) from the top-level of the list of strips
@@ -1438,7 +1438,7 @@ void BKE_nla_action_pushdown (AnimData *adt)
/* do other necessary work on strip */
if (strip) {
/* clear reference to action now that we've pushed it onto the stack */
- adt->action->id.us--;
+ id_us_min(&adt->action->id);
adt->action= NULL;
/* if the strip is the first one in the track it lives in, check if there
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index c4d54cd6296..a6f03c0c3ec 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -615,6 +615,12 @@ bNode *nodeMakeGroupFromSelected(bNodeTree *ntree)
/* should become callbackable... */
void nodeVerifyGroup(bNodeTree *ngroup)
{
+ /* XXX nodeVerifyGroup is sometimes called for non-group trees.
+ * This is not the best way to check if a tree is a group,
+ * trees should get their own flag for this!
+ */
+ if (!ngroup->owntype)
+ return;
/* group changed, so we rebuild the type definition */
ntreeMakeOwnType(ngroup);
@@ -1082,15 +1088,61 @@ bNode *nodeCopyNode(struct bNodeTree *ntree, struct bNode *node, int internal)
return nnode;
}
+/* fromsock and tosock can be NULL */
+/* also used via rna api, so we check for proper input output direction */
bNodeLink *nodeAddLink(bNodeTree *ntree, bNode *fromnode, bNodeSocket *fromsock, bNode *tonode, bNodeSocket *tosock)
{
- bNodeLink *link= MEM_callocN(sizeof(bNodeLink), "link");
+ bNodeSocket *sock;
+ bNodeLink *link= NULL;
+ int from= 0, to= 0;
+
+ if(fromsock) {
+ /* test valid input */
+ for(sock= fromnode->outputs.first; sock; sock= sock->next)
+ if(sock==fromsock)
+ break;
+ if(sock)
+ from= 1; /* OK */
+ else {
+ for(sock= fromnode->inputs.first; sock; sock= sock->next)
+ if(sock==fromsock)
+ break;
+ if(sock)
+ from= -1; /* OK but flip */
+ }
+ }
+ if(tosock) {
+ for(sock= tonode->inputs.first; sock; sock= sock->next)
+ if(sock==tosock)
+ break;
+ if(sock)
+ to= 1; /* OK */
+ else {
+ for(sock= tonode->outputs.first; sock; sock= sock->next)
+ if(sock==tosock)
+ break;
+ if(sock)
+ to= -1; /* OK but flip */
+ }
+ }
- BLI_addtail(&ntree->links, link);
- link->fromnode= fromnode;
- link->fromsock= fromsock;
- link->tonode= tonode;
- link->tosock= tosock;
+ /* this allows NULL sockets to work */
+ if(from >= 0 && to >= 0) {
+ link= MEM_callocN(sizeof(bNodeLink), "link");
+ BLI_addtail(&ntree->links, link);
+ link->fromnode= fromnode;
+ link->fromsock= fromsock;
+ link->tonode= tonode;
+ link->tosock= tosock;
+ }
+ else if(from <= 0 && to <= 0) {
+ link= MEM_callocN(sizeof(bNodeLink), "link");
+ BLI_addtail(&ntree->links, link);
+ link->fromnode= tonode;
+ link->fromsock= tosock;
+ link->tonode= fromnode;
+ link->tosock= fromsock;
+ }
return link;
}
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index b71338aaa70..4c436e8411f 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -1684,7 +1684,7 @@ void object_rot_to_mat3(Object *ob, float mat[][3])
normalize_qt_qt(tquat, ob->quat);
quat_to_mat3(rmat, tquat);
- normalize_qt_qt(tquat, ob->quat);
+ normalize_qt_qt(tquat, ob->dquat);
quat_to_mat3(dmat, tquat);
}
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index 5526edf0a8c..87c39abd561 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -2743,7 +2743,7 @@ void psys_cache_child_paths(ParticleSimulationData *sim, float cfra, int editupd
{
ParticleThread *pthreads;
ParticleThreadContext *ctx;
- ParticleCacheKey **cache;
+ /*ParticleCacheKey **cache;*/ /*UNUSED*/
ListBase threads;
int i, totchild, totparent, totthread;
@@ -2762,7 +2762,7 @@ void psys_cache_child_paths(ParticleSimulationData *sim, float cfra, int editupd
totparent= ctx->totparent;
if(editupdate && sim->psys->childcache && totchild == sim->psys->totchildcache) {
- cache = sim->psys->childcache;
+ /*cache = sim->psys->childcache;*/ /*UNUSED*/
}
else {
/* clear out old and create new empty path cache */
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index 06056e0ecc9..62bfde601f6 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -3403,7 +3403,7 @@ static void dynamics_step(ParticleSimulationData *sim, float cfra)
PARTICLE_P;
float timestep;
/* current time */
- float ctime;
+ /* float ctime; */ /*UNUSED*/
/* frame & time changes */
float dfra, dtime;
float birthtime, dietime;
@@ -3412,7 +3412,7 @@ static void dynamics_step(ParticleSimulationData *sim, float cfra)
dfra= cfra - psys->cfra;
timestep = psys_get_timestep(sim);
- ctime= cfra*timestep;
+ /*ctime= cfra*timestep;*/ /*UNUSED*/
dtime= dfra*timestep;
if(dfra<0.0){
@@ -3854,14 +3854,15 @@ static void system_step(ParticleSimulationData *sim, float cfra)
return;
}
+ /* Cache is supposed to be baked, but no data was found so bail out */
+ else if(cache->flag & PTCACHE_BAKED) {
+ psys_reset(psys, PSYS_RESET_CACHE_MISS);
+ return;
+ }
else if(cache_result == PTCACHE_READ_OLD) {
psys->cfra = (float)cache->simframe;
cached_step(sim, psys->cfra);
}
- else if(cfra != startframe && ( /*sim->ob->id.lib ||*/ (cache->flag & PTCACHE_BAKED))) { /* 2.4x disabled lib, but this can be used in some cases, testing further - campbell */
- psys_reset(psys, PSYS_RESET_CACHE_MISS);
- return;
- }
/* if on second frame, write cache for first frame */
if(psys->cfra == startframe && (cache->flag & PTCACHE_OUTDATED || cache->last_exact==0))
diff --git a/source/blender/blenkernel/intern/report.c b/source/blender/blenkernel/intern/report.c
index a22b36b9524..e623c095ac7 100644
--- a/source/blender/blenkernel/intern/report.c
+++ b/source/blender/blenkernel/intern/report.c
@@ -96,11 +96,9 @@ void BKE_report(ReportList *reports, ReportType type, const char *message)
Report *report;
int len;
- /* exception, print and return in background, no reason to store a list */
- if(G.background)
- reports= NULL;
-
- if(!reports || ((reports->flag & RPT_PRINT) && (type >= reports->printlevel))) {
+ /* in background mode always print otherwise there are cases the errors wont be displayed,
+ * but still add to the report list since this is used for python exception handling */
+ if(G.background || !reports || ((reports->flag & RPT_PRINT) && (type >= reports->printlevel))) {
printf("%s: %s\n", report_type_str(type), message);
fflush(stdout); /* this ensures the message is printed before a crash */
}
diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c
index e38f1bb545c..3ba18fee615 100644
--- a/source/blender/blenkernel/intern/softbody.c
+++ b/source/blender/blenkernel/intern/softbody.c
@@ -4151,7 +4151,7 @@ void sbObjectStep(Scene *scene, Object *ob, float cfra, float (*vertexCos)[3], i
else if(cache_result==PTCACHE_READ_OLD) {
; /* do nothing */
}
- else if(ob->id.lib || (cache->flag & PTCACHE_BAKED)) {
+ else if(/*ob->id.lib || */(cache->flag & PTCACHE_BAKED)) { /* "library linking & pointcaches" has to be solved properly at some point */
/* if baked and nothing in cache, do nothing */
BKE_ptcache_invalidate(cache);
return;
diff --git a/source/blender/blenlib/BLI_bpath.h b/source/blender/blenlib/BLI_bpath.h
index ff0050649ed..8c351d6020d 100644
--- a/source/blender/blenlib/BLI_bpath.h
+++ b/source/blender/blenlib/BLI_bpath.h
@@ -36,7 +36,7 @@ struct BPathIterator;
struct ReportList;
struct Main;
-void BLI_bpathIterator_init (struct BPathIterator **bpi, struct Main *bmain, const char *basedir);
+void BLI_bpathIterator_init (struct BPathIterator **bpi, struct Main *bmain, const char *basedir, const int flag);
void BLI_bpathIterator_free (struct BPathIterator *bpi);
const char* BLI_bpathIterator_getLib (struct BPathIterator *bpi);
const char* BLI_bpathIterator_getName (struct BPathIterator *bpi);
@@ -57,4 +57,6 @@ void makeFilesRelative(struct Main *bmain, const char *basedir, struct ReportLis
void makeFilesAbsolute(struct Main *bmain, const char *basedir, struct ReportList *reports);
void findMissingFiles(struct Main *bmain, const char *str);
+#define BPATH_USE_PACKED 1
+
#endif // BLI_BPATH_H
diff --git a/source/blender/blenlib/intern/boxpack2d.c b/source/blender/blenlib/intern/boxpack2d.c
index 7e93765ca72..b20a42f5cf8 100644
--- a/source/blender/blenlib/intern/boxpack2d.c
+++ b/source/blender/blenlib/intern/boxpack2d.c
@@ -155,7 +155,7 @@ void boxPack2D(boxPack *boxarray, int len, float *tot_width, float *tot_height)
int box_index, verts_pack_len, i, j, k, isect;
int quad_flags[4]= {BLF,TRF,TLF,BRF}; /* use for looping */
boxPack *box, *box_test; /*current box and another for intersection tests*/
- int *vertex_pack_indicies; /*an array of indices used for sorting verts*/
+ int *vertex_pack_indices; /*an array of indices used for sorting verts*/
if (!len) {
*tot_width = 0.0f;
@@ -168,7 +168,7 @@ void boxPack2D(boxPack *boxarray, int len, float *tot_width, float *tot_height)
/* add verts to the boxes, these are only used internally */
vert = vertarray = MEM_mallocN( len*4*sizeof(boxVert), "boxPack Verts");
- vertex_pack_indicies = MEM_mallocN( len*3*sizeof(int), "boxPack Indices");
+ vertex_pack_indices = MEM_mallocN( len*3*sizeof(int), "boxPack Indices");
for (box=boxarray, box_index=0, i=0; box_index < len; box_index++, box++) {
@@ -225,7 +225,7 @@ void boxPack2D(boxPack *boxarray, int len, float *tot_width, float *tot_height)
box->x = box->y = 0.0f;
for (i=0; i<3; i++)
- vertex_pack_indicies[i] = box->v[i+1]->index;
+ vertex_pack_indices[i] = box->v[i+1]->index;
verts_pack_len = 3;
box++; /* next box, needed for the loop below */
/* ...done packing the first box */
@@ -237,14 +237,14 @@ void boxPack2D(boxPack *boxarray, int len, float *tot_width, float *tot_height)
box_width = box->w;
box_height = box->h;
- qsort(vertex_pack_indicies, verts_pack_len, sizeof(int), vertex_sort);
+ qsort(vertex_pack_indices, verts_pack_len, sizeof(int), vertex_sort);
/* Pack the box in with the others */
/* sort the verts */
isect = 1;
for (i=0; i<verts_pack_len && isect; i++) {
- vert = vertarray + vertex_pack_indicies[i];
+ vert = vertarray + vertex_pack_indices[i];
/* printf("\ttesting vert %i %i %i %f %f\n", i,
* vert->free, verts_pack_len, vert->x, vert->y); */
@@ -401,7 +401,7 @@ void boxPack2D(boxPack *boxarray, int len, float *tot_width, float *tot_height)
for (k=0; k<4; k++) {
if (box->v[k] != vert) {
- vertex_pack_indicies[verts_pack_len] =
+ vertex_pack_indices[verts_pack_len] =
box->v[k]->index;
verts_pack_len++;
}
@@ -423,7 +423,7 @@ void boxPack2D(boxPack *boxarray, int len, float *tot_width, float *tot_height)
box = boxarray+box_index;
box->v[0] = box->v[1] = box->v[2] = box->v[3] = NULL;
}
- MEM_freeN(vertex_pack_indicies);
+ MEM_freeN(vertex_pack_indices);
MEM_freeN(vertarray);
}
diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c
index 92deb6fbebc..c930bd903b4 100644
--- a/source/blender/blenlib/intern/bpath.c
+++ b/source/blender/blenlib/intern/bpath.c
@@ -91,6 +91,7 @@ typedef struct BPathIterator {
void* data;
int len;
int type;
+ int flag; /* iterator options */
void (*setpath_callback)(struct BPathIterator *, const char *);
void (*getpath_callback)(struct BPathIterator *, char *);
@@ -123,7 +124,8 @@ enum BPathTypes {
BPATH_DONE
};
-void BLI_bpathIterator_init(struct BPathIterator **bpi_pt, Main *bmain, const char *basedir) {
+void BLI_bpathIterator_init(struct BPathIterator **bpi_pt, Main *bmain, const char *basedir, const int flag)
+{
BPathIterator *bpi;
bpi= MEM_mallocN(sizeof(BPathIterator), "BLI_bpathIterator_init");
@@ -140,7 +142,9 @@ void BLI_bpathIterator_init(struct BPathIterator **bpi_pt, Main *bmain, const ch
bpi->seqdata.seq= 0;
bpi->seqdata.seqar= NULL;
bpi->seqdata.scene= NULL;
-
+
+ bpi->flag= flag;
+
/* Freestyle module specific */
bpi->frsmoduledata.scene= NULL;
bpi->frsmoduledata.layer= NULL;
@@ -214,7 +218,8 @@ const char* BLI_bpathIterator_getBasePath( struct BPathIterator *bpi) {
}
/* gets the first or the next image that has a path - not a viewer node or generated image */
-static struct Image *ima_stepdata__internal(struct Image *ima, int step_next) {
+static struct Image *ima_stepdata__internal(struct Image *ima, const int step_next, const int flag)
+{
if (ima==NULL)
return NULL;
@@ -222,15 +227,19 @@ static struct Image *ima_stepdata__internal(struct Image *ima, int step_next) {
ima= ima->id.next;
while (ima) {
- if (ima->packedfile==NULL && ELEM3(ima->source, IMA_SRC_FILE, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE))
- break;
+ if (ELEM3(ima->source, IMA_SRC_FILE, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE)) {
+ if(ima->packedfile==NULL || (flag & BPATH_USE_PACKED)) {
+ break;
+ }
+ }
/* image is not a image with a path, skip it */
ima= ima->id.next;
}
return ima;
}
-static struct Tex *tex_stepdata__internal(struct Tex *tex, int step_next) {
+static struct Tex *tex_stepdata__internal(struct Tex *tex, const int step_next, const int UNUSED(flag))
+{
if (tex==NULL)
return NULL;
@@ -246,7 +255,8 @@ static struct Tex *tex_stepdata__internal(struct Tex *tex, int step_next) {
return tex;
}
-static struct Text *text_stepdata__internal(struct Text *text, int step_next) {
+static struct Text *text_stepdata__internal(struct Text *text, const int step_next, const int UNUSED(flag))
+{
if (text==NULL)
return NULL;
@@ -262,7 +272,8 @@ static struct Text *text_stepdata__internal(struct Text *text, int step_next) {
return text;
}
-static struct VFont *vf_stepdata__internal(struct VFont *vf, int step_next) {
+static struct VFont *vf_stepdata__internal(struct VFont *vf, const int step_next, const int flag)
+{
if (vf==NULL)
return NULL;
@@ -270,8 +281,10 @@ static struct VFont *vf_stepdata__internal(struct VFont *vf, int step_next) {
vf= vf->id.next;
while (vf) {
- if (vf->packedfile==NULL && strcmp(vf->name, FO_BUILTIN_NAME)!=0) {
- break;
+ if (strcmp(vf->name, FO_BUILTIN_NAME)!=0) {
+ if(vf->packedfile==NULL || (flag & BPATH_USE_PACKED)) {
+ break;
+ }
}
/* font with no path, skip it */
@@ -280,7 +293,8 @@ static struct VFont *vf_stepdata__internal(struct VFont *vf, int step_next) {
return vf;
}
-static struct bSound *snd_stepdata__internal(struct bSound *snd, int step_next) {
+static struct bSound *snd_stepdata__internal(struct bSound *snd, int step_next, const int flag)
+{
if (snd==NULL)
return NULL;
@@ -288,10 +302,10 @@ static struct bSound *snd_stepdata__internal(struct bSound *snd, int step_next)
snd= snd->id.next;
while (snd) {
- if (snd->packedfile==NULL) {
+ if(snd->packedfile==NULL || (flag & BPATH_USE_PACKED)) {
break;
}
-
+
/* font with no path, skip it */
snd= snd->id.next;
}
@@ -486,8 +500,8 @@ void BLI_bpathIterator_step( struct BPathIterator *bpi) {
if ((bpi->type) == BPATH_IMAGE) {
/*if (bpi->data) bpi->data= ((ID *)bpi->data)->next;*/
- if (bpi->data) bpi->data= ima_stepdata__internal( (Image *)bpi->data, 1 ); /* must skip images that have no path */
- else bpi->data= ima_stepdata__internal(bpi->bmain->image.first, 0);
+ if (bpi->data) bpi->data= ima_stepdata__internal((Image *)bpi->data, 1, bpi->flag); /* must skip images that have no path */
+ else bpi->data= ima_stepdata__internal(bpi->bmain->image.first, 0, bpi->flag);
if (bpi->data) {
/* get the path info from this datatype */
@@ -508,8 +522,8 @@ void BLI_bpathIterator_step( struct BPathIterator *bpi) {
if ((bpi->type) == BPATH_TEXTURE) {
/*if (bpi->data) bpi->data= ((ID *)bpi->data)->next;*/
- if (bpi->data) bpi->data= tex_stepdata__internal( (Tex *)bpi->data, 1 ); /* must skip images that have no path */
- else bpi->data= tex_stepdata__internal(bpi->bmain->tex.first, 0);
+ if (bpi->data) bpi->data= tex_stepdata__internal( (Tex *)bpi->data, 1, bpi->flag); /* must skip images that have no path */
+ else bpi->data= tex_stepdata__internal(bpi->bmain->tex.first, 0, bpi->flag);
if (bpi->data) {
/* get the path info from this datatype */
@@ -535,8 +549,8 @@ void BLI_bpathIterator_step( struct BPathIterator *bpi) {
if ((bpi->type) == BPATH_TEXT) {
/*if (bpi->data) bpi->data= ((ID *)bpi->data)->next;*/
- if (bpi->data) bpi->data= text_stepdata__internal( (Text *)bpi->data, 1 ); /* must skip images that have no path */
- else bpi->data= text_stepdata__internal(bpi->bmain->text.first, 0);
+ if (bpi->data) bpi->data= text_stepdata__internal((Text *)bpi->data, 1, bpi->flag); /* must skip images that have no path */
+ else bpi->data= text_stepdata__internal(bpi->bmain->text.first, 0, bpi->flag);
if (bpi->data) {
/* get the path info from this datatype */
@@ -556,8 +570,8 @@ void BLI_bpathIterator_step( struct BPathIterator *bpi) {
}
else if ((bpi->type) == BPATH_SOUND) {
- if (bpi->data) bpi->data= snd_stepdata__internal( (bSound *)bpi->data, 1 ); /* must skip images that have no path */
- else bpi->data= snd_stepdata__internal(bpi->bmain->sound.first, 0);
+ if (bpi->data) bpi->data= snd_stepdata__internal((bSound *)bpi->data, 1, bpi->flag); /* must skip images that have no path */
+ else bpi->data= snd_stepdata__internal(bpi->bmain->sound.first, 0, bpi->flag);
if (bpi->data) {
/* get the path info from this datatype */
@@ -577,8 +591,8 @@ void BLI_bpathIterator_step( struct BPathIterator *bpi) {
} else if ((bpi->type) == BPATH_FONT) {
- if (bpi->data) bpi->data= vf_stepdata__internal( (VFont *)bpi->data, 1 );
- else bpi->data= vf_stepdata__internal( bpi->bmain->vfont.first, 0 );
+ if (bpi->data) bpi->data= vf_stepdata__internal((VFont *)bpi->data, 1, bpi->flag);
+ else bpi->data= vf_stepdata__internal(bpi->bmain->vfont.first, 0, bpi->flag);
if (bpi->data) {
/* get the path info from this datatype */
@@ -721,7 +735,7 @@ void checkMissingFiles(Main *bmain, ReportList *reports) {
/* be sure there is low chance of the path being too short */
char filepath_expanded[FILE_MAXDIR*2];
- BLI_bpathIterator_init(&bpi, bmain, bmain->name);
+ BLI_bpathIterator_init(&bpi, bmain, bmain->name, 0);
while (!BLI_bpathIterator_isDone(bpi)) {
BLI_bpathIterator_getPathExpanded(bpi, filepath_expanded);
@@ -743,7 +757,7 @@ void makeFilesRelative(Main *bmain, const char *basedir, ReportList *reports) {
/* be sure there is low chance of the path being too short */
char filepath_relative[(FILE_MAXDIR * 2) + FILE_MAXFILE];
- BLI_bpathIterator_init(&bpi, bmain, basedir);
+ BLI_bpathIterator_init(&bpi, bmain, basedir, 0);
while (!BLI_bpathIterator_isDone(bpi)) {
BLI_bpathIterator_getPath(bpi, filepath);
libpath= BLI_bpathIterator_getLib(bpi);
@@ -794,7 +808,7 @@ void makeFilesAbsolute(Main *bmain, const char *basedir, ReportList *reports)
/* be sure there is low chance of the path being too short */
char filepath_absolute[(FILE_MAXDIR * 2) + FILE_MAXFILE];
- BLI_bpathIterator_init(&bpi, bmain, basedir);
+ BLI_bpathIterator_init(&bpi, bmain, basedir, 0);
while (!BLI_bpathIterator_isDone(bpi)) {
BLI_bpathIterator_getPath(bpi, filepath);
libpath= BLI_bpathIterator_getLib(bpi);
@@ -900,7 +914,7 @@ void findMissingFiles(Main *bmain, const char *str) {
BLI_split_dirfile(str, dirname, NULL);
- BLI_bpathIterator_init(&bpi, bmain, bmain->name);
+ BLI_bpathIterator_init(&bpi, bmain, bmain->name, 0);
while (!BLI_bpathIterator_isDone(bpi)) {
BLI_bpathIterator_getPath(bpi, filepath);
diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c
index d25aefef543..15f696e073c 100644
--- a/source/blender/blenlib/intern/math_geom.c
+++ b/source/blender/blenlib/intern/math_geom.c
@@ -236,51 +236,39 @@ float dist_to_line_segment_v3(float *v1, float *v2, float *v3)
/* intersect Line-Line, shorts */
int isect_line_line_v2_short(const short *v1, const short *v2, const short *v3, const short *v4)
{
- /* return:
- -1: colliniar
- 0: no intersection of segments
- 1: exact intersection of segments
- 2: cross-intersection of segments
- */
float div, labda, mu;
div= (float)((v2[0]-v1[0])*(v4[1]-v3[1])-(v2[1]-v1[1])*(v4[0]-v3[0]));
- if(div==0.0f) return -1;
+ if(div==0.0f) return ISECT_LINE_LINE_COLINEAR;
labda= ((float)(v1[1]-v3[1])*(v4[0]-v3[0])-(v1[0]-v3[0])*(v4[1]-v3[1]))/div;
mu= ((float)(v1[1]-v3[1])*(v2[0]-v1[0])-(v1[0]-v3[0])*(v2[1]-v1[1]))/div;
if(labda>=0.0f && labda<=1.0f && mu>=0.0f && mu<=1.0f) {
- if(labda==0.0f || labda==1.0f || mu==0.0f || mu==1.0f) return 1;
- return 2;
+ if(labda==0.0f || labda==1.0f || mu==0.0f || mu==1.0f) return ISECT_LINE_LINE_EXACT;
+ return ISECT_LINE_LINE_CROSS;
}
- return 0;
+ return ISECT_LINE_LINE_NONE;
}
/* intersect Line-Line, floats */
int isect_line_line_v2(const float *v1, const float *v2, const float *v3, const float *v4)
{
- /* return:
- -1: colliniar
-0: no intersection of segments
-1: exact intersection of segments
-2: cross-intersection of segments
- */
float div, labda, mu;
div= (v2[0]-v1[0])*(v4[1]-v3[1])-(v2[1]-v1[1])*(v4[0]-v3[0]);
- if(div==0.0) return -1;
+ if(div==0.0) return ISECT_LINE_LINE_COLINEAR;
labda= ((float)(v1[1]-v3[1])*(v4[0]-v3[0])-(v1[0]-v3[0])*(v4[1]-v3[1]))/div;
mu= ((float)(v1[1]-v3[1])*(v2[0]-v1[0])-(v1[0]-v3[0])*(v2[1]-v1[1]))/div;
if(labda>=0.0 && labda<=1.0 && mu>=0.0 && mu<=1.0) {
- if(labda==0.0 || labda==1.0 || mu==0.0 || mu==1.0) return 1;
- return 2;
+ if(labda==0.0 || labda==1.0 || mu==0.0 || mu==1.0) return ISECT_LINE_LINE_EXACT;
+ return ISECT_LINE_LINE_CROSS;
}
- return 0;
+ return ISECT_LINE_LINE_NONE;
}
/* get intersection point of two 2D segments and return intersection type:
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 60b56df1258..a5077af5647 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -2105,8 +2105,11 @@ static void direct_link_nodetree(FileData *fd, bNodeTree *ntree)
else if(ELEM3(node->type, CMP_NODE_IMAGE, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER))
((ImageUser *)node->storage)->ok= 1;
}
- else if( ntree->type==NTREE_TEXTURE && (node->type==TEX_NODE_CURVE_RGB || node->type==TEX_NODE_CURVE_TIME) ) {
- direct_link_curvemapping(fd, node->storage);
+ else if( ntree->type==NTREE_TEXTURE) {
+ if(node->type==TEX_NODE_CURVE_RGB || node->type==TEX_NODE_CURVE_TIME)
+ direct_link_curvemapping(fd, node->storage);
+ else if(node->type==TEX_NODE_IMAGE)
+ ((ImageUser *)node->storage)->ok= 1;
}
}
link_list(fd, &node->inputs);
@@ -3821,11 +3824,11 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb)
clmd->sim_parms->reset = 0;
clmd->sim_parms->effector_weights = newdataadr(fd, clmd->sim_parms->effector_weights);
- }
- if(!clmd->sim_parms->effector_weights)
- clmd->sim_parms->effector_weights = BKE_add_effector_weights(NULL);
-
+ if(!clmd->sim_parms->effector_weights) {
+ clmd->sim_parms->effector_weights = BKE_add_effector_weights(NULL);
+ }
+ }
}
else if (md->type==eModifierType_Fluidsim) {
FluidsimModifierData *fluidmd = (FluidsimModifierData*) md;
@@ -9014,9 +9017,13 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
ob->soft->pointcache= BKE_ptcache_add(&ob->soft->ptcaches);
for(psys=ob->particlesystem.first; psys; psys=psys->next) {
- //if(psys->soft && !psys->soft->pointcache)
- // psys->soft->pointcache= BKE_ptcache_add(&psys->soft->ptcaches);
- if(!psys->pointcache)
+ if(psys->pointcache) {
+ if(psys->pointcache->flag & PTCACHE_BAKED && (psys->pointcache->flag & PTCACHE_DISK_CACHE)==0) {
+ printf("Old memory cache isn't supported for particles, so re-bake the simulation!\n");
+ psys->pointcache->flag &= ~PTCACHE_BAKED;
+ }
+ }
+ else
psys->pointcache= BKE_ptcache_add(&psys->ptcaches);
}
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 1b2c44cfb31..ba275ae7f48 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -1963,21 +1963,23 @@ static void write_gpencils(WriteData *wd, ListBase *lb)
bGPDstroke *gps;
for (gpd= lb->first; gpd; gpd= gpd->id.next) {
- /* write gpd data block to file */
- writestruct(wd, ID_GD, "bGPdata", 1, gpd);
-
- /* write grease-pencil layers to file */
- for (gpl= gpd->layers.first; gpl; gpl= gpl->next) {
- writestruct(wd, DATA, "bGPDlayer", 1, gpl);
+ if (gpd->id.us>0 || wd->current) {
+ /* write gpd data block to file */
+ writestruct(wd, ID_GD, "bGPdata", 1, gpd);
- /* write this layer's frames to file */
- for (gpf= gpl->frames.first; gpf; gpf= gpf->next) {
- writestruct(wd, DATA, "bGPDframe", 1, gpf);
+ /* write grease-pencil layers to file */
+ for (gpl= gpd->layers.first; gpl; gpl= gpl->next) {
+ writestruct(wd, DATA, "bGPDlayer", 1, gpl);
- /* write strokes */
- for (gps= gpf->strokes.first; gps; gps= gps->next) {
- writestruct(wd, DATA, "bGPDstroke", 1, gps);
- writestruct(wd, DATA, "bGPDspoint", gps->totpoints, gps->points);
+ /* write this layer's frames to file */
+ for (gpf= gpl->frames.first; gpf; gpf= gpf->next) {
+ writestruct(wd, DATA, "bGPDframe", 1, gpf);
+
+ /* write strokes */
+ for (gps= gpf->strokes.first; gps; gps= gps->next) {
+ writestruct(wd, DATA, "bGPDstroke", 1, gps);
+ writestruct(wd, DATA, "bGPDspoint", gps->totpoints, gps->points);
+ }
}
}
}
@@ -2525,6 +2527,10 @@ static void write_global(WriteData *wd, int fileflags, Main *mainvar)
bScreen *screen;
char subvstr[8];
+ /* prevent mem checkers from complaining */
+ fg.pads= fg.pad= 0;
+ memset(fg.filename, 0, sizeof(fg.filename));
+
current_screen_compat(mainvar, &screen);
/* XXX still remap G */
@@ -2550,7 +2556,6 @@ static void write_global(WriteData *wd, int fileflags, Main *mainvar)
#else
fg.revision= 0;
#endif
- fg.pads= fg.pad= 0; /* prevent mem checkers from complaining */
writestruct(wd, GLOB, "FileGlobal", 1, &fg);
}
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c
index 888ab9769d8..b779250995e 100644
--- a/source/blender/editors/animation/keyframing.c
+++ b/source/blender/editors/animation/keyframing.c
@@ -95,7 +95,7 @@ short ANIM_get_keyframing_flags (Scene *scene, short incl_mode)
if (IS_AUTOKEY_FLAG(INSERTNEEDED))
flag |= INSERTKEY_NEEDED;
- /* default F-Curve color mode - RGB from XYZ indicies */
+ /* default F-Curve color mode - RGB from XYZ indices */
if (IS_AUTOKEY_FLAG(XYZ2RGB))
flag |= INSERTKEY_XYZ2RGB;
}
diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c
index 51b00cc0086..24bd5b3ec5e 100644
--- a/source/blender/editors/animation/keyingsets.c
+++ b/source/blender/editors/animation/keyingsets.c
@@ -500,7 +500,7 @@ void ANIM_OT_keying_set_active_set (wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* keyingset to use
- * - here the type is int not enum, since many of the indicies here are determined dynamically
+ * - here the type is int not enum, since many of the indices here are determined dynamically
*/
RNA_def_int(ot->srna, "type", 0, INT_MIN, INT_MAX, "Keying Set Number", "Index (determined internally) of the Keying Set to use", 0, 1);
}
diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c
index 2252c926c71..e0172b603b7 100644
--- a/source/blender/editors/armature/editarmature.c
+++ b/source/blender/editors/armature/editarmature.c
@@ -3000,14 +3000,13 @@ static int armature_fill_bones_exec (bContext *C, wmOperator *op)
bArmature *arm= (obedit) ? obedit->data : NULL;
Scene *scene= CTX_data_scene(C);
View3D *v3d= CTX_wm_view3d(C);
- EditBone *newbone=NULL;
ListBase points = {NULL, NULL};
int count;
-
+
/* sanity checks */
- if ELEM(NULL, obedit, arm)
+ if (ELEM(NULL, obedit, arm))
return OPERATOR_CANCELLED;
-
+
/* loop over all bones, and only consider if visible */
CTX_DATA_BEGIN(C, EditBone *, ebone, visible_bones)
{
@@ -3041,7 +3040,7 @@ static int armature_fill_bones_exec (bContext *C, wmOperator *op)
mul_v3_m4v3(curs, obedit->imat, give_cursor(scene, v3d));
/* Create a bone */
- newbone= add_points_bone(obedit, ebp->vec, curs);
+ /* newbone= */ add_points_bone(obedit, ebp->vec, curs);
}
else if (count == 2) {
EditBonePoint *ebp, *ebp2;
@@ -3102,7 +3101,7 @@ static int armature_fill_bones_exec (bContext *C, wmOperator *op)
/* add new bone and parent it to the appropriate end */
if (headtail) {
- newbone= add_points_bone(obedit, head, tail);
+ EditBone *newbone= add_points_bone(obedit, head, tail);
/* do parenting (will need to set connected flag too) */
if (headtail == 2) {
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index ce4a61b5cff..3eaf53b4bcb 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -2184,7 +2184,7 @@ static int smooth_radius_exec(bContext *C, wmOperator *UNUSED(op))
/* use for smoothing */
int last_sel;
- int start_sel, end_sel; /* selection indicies, inclusive */
+ int start_sel, end_sel; /* selection indices, inclusive */
float start_rad, end_rad, fac, range;
for(nu= editnurb->first; nu; nu= nu->next) {
@@ -6096,21 +6096,18 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob)
Curve *cu= (Curve*)obedit->data;
float vec[3], zvec[3]= {0.0f, 0.0f, 1.0f};
float umat[4][4]= MAT4_UNITY, viewmat[4][4]= MAT4_UNITY;
- float fac, grid;
- int a, b, cutype, stype;
- int force_3d = ((Curve *)obedit->data)->flag & CU_3D; /* could be adding to an existing 3D curve */
+ float fac;
+ int a, b;
+ const float grid= v3d ? v3d->grid : 1.0f;
+ const int cutype= (type & CU_TYPE); // poly, bezier, nurbs, etc
+ const int stype= (type & CU_PRIMITIVE);
+ const int force_3d = ((Curve *)obedit->data)->flag & CU_3D; /* could be adding to an existing 3D curve */
if(rv3d) {
copy_m4_m4(viewmat, rv3d->viewmat);
VECCOPY(zvec, rv3d->viewinv[2]);
}
-
- cutype= type & CU_TYPE; // poly, bezier, nurbs, etc
- stype= type & CU_PRIMITIVE;
-
- if (v3d) grid = v3d->grid;
- else grid = 1.0;
-
+
setflagsNurb(editnurb, 0);
/* these types call this function to return a Nurb */
@@ -6432,6 +6429,10 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob)
}
break;
+
+ default: /* should never happen */
+ BLI_assert(!"invalid nurbs type");
+ return NULL;
}
/* always do: */
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 3a82274e356..baa6f7d6a25 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -45,6 +45,7 @@
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_gpencil_types.h"
+#include "DNA_windowmanager_types.h"
#include "UI_view2d.h"
@@ -66,6 +67,8 @@
/* Temporary 'Stroke' Operation data */
typedef struct tGPsdata {
Scene *scene; /* current scene from context */
+
+ wmWindow *win; /* window where painting originated */
ScrArea *sa; /* area where painting originated */
ARegion *ar; /* region where painting originated */
View2D *v2d; /* needed for GP_STROKE_2DSPACE */
@@ -888,15 +891,16 @@ static tGPsdata *gp_session_initpaint (bContext *C)
/* create new context data */
p= MEM_callocN(sizeof(tGPsdata), "GPencil Drawing Data");
- /* pass on current scene */
+ /* pass on current scene and window */
p->scene= CTX_data_scene(C);
+ p->win= CTX_wm_window(C);
switch (curarea->spacetype) {
/* supported views first */
case SPACE_VIEW3D:
{
- View3D *v3d= curarea->spacedata.first;
- RegionView3D *rv3d= ar->regiondata;
+ // View3D *v3d= curarea->spacedata.first;
+ // RegionView3D *rv3d= ar->regiondata;
/* set current area
* - must verify that region data is 3D-view (and not something else)
@@ -910,12 +914,6 @@ static tGPsdata *gp_session_initpaint (bContext *C)
printf("Error: 3D-View active region doesn't have any region data, so cannot be drawable \n");
return p;
}
-
- /* for camera view set the subrect */
- if(rv3d->persp == RV3D_CAMOB) {
- view3d_calc_camera_border(p->scene, p->ar, NULL, v3d, &p->subrect_data, -1); /* negative shift */
- p->subrect= &p->subrect_data;
- }
#if 0 // XXX will this sort of antiquated stuff be restored?
/* check that gpencil data is allowed to be drawn */
@@ -1097,9 +1095,17 @@ static void gp_paint_initstroke (tGPsdata *p, short paintmode)
switch (p->sa->spacetype) {
case SPACE_VIEW3D:
{
+ View3D *v3d= p->sa->spacedata.first;
RegionView3D *rv3d= p->ar->regiondata;
float rvec[3];
+ /* for camera view set the subrect */
+ if (rv3d->persp == RV3D_CAMOB) {
+ view3d_calc_camera_border(p->scene, p->ar, NULL, v3d, &p->subrect_data, -1); /* negative shift */
+ p->subrect= &p->subrect_data;
+ }
+
+ /* get reference point for 3d space placement */
gp_get_3d_reference(p, rvec);
initgrabz(rv3d, rvec[0], rvec[1], rvec[2]);
@@ -1172,6 +1178,17 @@ static void gp_paint_initstroke (tGPsdata *p, short paintmode)
/* finish off a stroke (clears buffer, but doesn't finish the paint operation) */
static void gp_paint_strokeend (tGPsdata *p)
{
+ /* for surface sketching, need to set the right OpenGL context stuff so that
+ * the conversions will project the values correctly...
+ */
+ if (gpencil_project_check(p)) {
+ View3D *v3d= p->sa->spacedata.first;
+
+ /* need to restore the original projection settings before packing up */
+ view3d_region_operator_needs_opengl(p->win, p->ar);
+ view_autodist_init(p->scene, p->ar, v3d, (p->gpd->flag & GP_DATA_DEPTH_STROKE) ? 1:0);
+ }
+
/* check if doing eraser or not */
if ((p->gpd->sbuffer_sflag & GP_STROKE_ERASER) == 0) {
/* smooth stroke before transferring? */
@@ -1247,14 +1264,6 @@ static void gpencil_draw_exit (bContext *C, wmOperator *op)
}
/* cleanup */
- if (gpencil_project_check(p)) {
- View3D *v3d= p->sa->spacedata.first;
-
- /* need to restore the original projection settings before packing up */
- view3d_operator_needs_opengl(C);
- view_autodist_init(p->scene, p->ar, v3d, (p->gpd->flag & GP_DATA_DEPTH_STROKE) ? 1:0);
- }
-
gp_paint_cleanup(p);
gp_session_cleanup(p);
@@ -1573,7 +1582,7 @@ static int gpencil_draw_modal (bContext *C, wmOperator *op, wmEvent *event)
if (GPENCIL_SKETCH_SESSIONS_ON(p->scene)) {
/* end stroke only, and then wait to resume painting soon */
//printf("\t\tGP - end stroke only\n");
- gp_paint_strokeend(p);
+ gp_paint_cleanup(p);
p->status= GP_STATUS_IDLING;
/* we've just entered idling state, so this event was processed (but no others yet) */
diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h
index 337104e3737..d6fc0797449 100644
--- a/source/blender/editors/include/ED_view3d.h
+++ b/source/blender/editors/include/ED_view3d.h
@@ -47,6 +47,7 @@ struct RegionView3D;
struct Scene;
struct View3D;
struct ViewContext;
+struct wmWindow;
/* for derivedmesh drawing callbacks, for view3d_select, .... */
@@ -144,6 +145,7 @@ short view3d_opengl_select(struct ViewContext *vc, unsigned int *buffer, unsigne
void view3d_set_viewcontext(struct bContext *C, struct ViewContext *vc);
void view3d_operator_needs_opengl(const struct bContext *C);
+void view3d_region_operator_needs_opengl(struct wmWindow *win, struct ARegion *ar);
void view3d_get_view_aligned_coordinate(struct ViewContext *vc, float *fp, short mval[2]);
void view3d_get_transformation(struct ARegion *ar, struct RegionView3D *rv3d, struct Object *ob, struct bglMats *mats);
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index 1ea4f88ebe6..b9ded28b613 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -211,6 +211,7 @@ typedef struct uiLayout uiLayout;
#define TOGBUT (37<<9)
#define OPTION (38<<9)
#define OPTIONN (39<<9)
+ /* buttons with value >= SEARCH_MENU don't get undo pushes */
#define SEARCH_MENU (40<<9)
#define BUT_EXTRA (41<<9)
#define HSVCIRCLE (42<<9)
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 2620db30b39..43919617047 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -523,6 +523,7 @@ static int ui_but_update_from_old_block(const bContext *C, uiBlock *block, uiBut
#endif
but->active= oldbut->active;
but->pos= oldbut->pos;
+ but->ofs= oldbut->ofs;
but->editstr= oldbut->editstr;
but->editval= oldbut->editval;
but->editvec= oldbut->editvec;
@@ -2505,8 +2506,10 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str,
}
}
- if(ELEM8(but->type, BLOCK, BUT, LABEL, PULLDOWN, ROUNDBOX, LISTBOX, SEARCH_MENU, BUTM));
+ /* keep track of UI_interface.h */
+ if(ELEM7(but->type, BLOCK, BUT, LABEL, PULLDOWN, ROUNDBOX, LISTBOX, BUTM));
else if(ELEM5(but->type, SCROLL, SEPR, LINK, INLINK, FTPREVIEW));
+ else if(but->type >= SEARCH_MENU);
else but->flag |= UI_BUT_UNDO;
BLI_addtail(&block->buttons, but);
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index ffb18bcad4d..d49e7866268 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -5722,7 +5722,7 @@ int ui_handle_menu_event(bContext *C, wmEvent *event, uiPopupBlockHandle *menu,
if(ELEM3(event->type, LEFTMOUSE, MIDDLEMOUSE, RIGHTMOUSE) && event->val==KM_PRESS) {
if(saferct && !BLI_in_rctf(&saferct->parent, event->x, event->y)) {
- if(block->flag & (UI_BLOCK_OUT_1|UI_BLOCK_KEEP_OPEN))
+ if(block->flag & (UI_BLOCK_OUT_1))
menu->menuretval= UI_RETURN_OK;
else
menu->menuretval= UI_RETURN_OUT;
@@ -5763,7 +5763,7 @@ int ui_handle_menu_event(bContext *C, wmEvent *event, uiPopupBlockHandle *menu,
/* strict check, and include the parent rect */
if(!menu->dotowards && !saferct) {
- if(block->flag & (UI_BLOCK_OUT_1|UI_BLOCK_KEEP_OPEN))
+ if(block->flag & (UI_BLOCK_OUT_1))
menu->menuretval= UI_RETURN_OK;
else
menu->menuretval= UI_RETURN_OUT;
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c
index ff041c18b00..788de41202d 100644
--- a/source/blender/editors/interface/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -48,6 +48,7 @@
#include "DNA_brush_types.h"
#include "DNA_object_types.h"
#include "DNA_screen_types.h"
+#include "DNA_space_types.h"
#include "RNA_access.h"
#include "RNA_enum_types.h"
@@ -1000,42 +1001,62 @@ static void icon_draw_size(float x, float y, int icon_id, float aspect, float al
}
}
-void ui_id_icon_render(bContext *C, ID *id, int preview)
+static void ui_id_icon_render(bContext *C, ID *id, int big)
{
PreviewImage *pi = BKE_previewimg_get(id);
-
+
if (pi) {
if ((pi->changed[0] ||!pi->rect[0])) /* changed only ever set by dynamic icons */
{
- /* create the preview rect if necessary */
+ /* create the rect if necessary */
icon_set_image(C, id, pi, 0); /* icon size */
- if (preview)
- icon_set_image(C, id, pi, 1); /* preview size */
+ if (big)
+ icon_set_image(C, id, pi, 1); /* bigger preview size */
pi->changed[0] = 0;
}
}
}
-static int ui_id_brush_get_icon(bContext *C, ID *id, int preview)
+static void ui_id_brush_render(bContext *C, ID *id)
+{
+ PreviewImage *pi = BKE_previewimg_get(id);
+ int i;
+
+ if(!pi)
+ return;
+
+ for(i = 0; i < PREVIEW_MIPMAPS; i++) {
+ /* check if rect needs to be created; changed
+ only set by dynamic icons */
+ if((pi->changed[i] || !pi->rect[i])) {
+ icon_set_image(C, id, pi, i);
+ pi->changed[i] = 0;
+ }
+ }
+}
+
+
+static int ui_id_brush_get_icon(bContext *C, ID *id)
{
Brush *br = (Brush*)id;
if(br->flag & BRUSH_CUSTOM_ICON) {
BKE_icon_getid(id);
- ui_id_icon_render(C, id, preview);
+ ui_id_brush_render(C, id);
}
else {
Object *ob = CTX_data_active_object(C);
- EnumPropertyItem *items;
+ SpaceImage *sima;
+ EnumPropertyItem *items = NULL;
int tool, mode = 0;
- /* this is not nice, should probably make brushes be
- strictly in one paint mode only to avoid checking
- object mode here */
+ /* XXX: this is not nice, should probably make brushes
+ be strictly in one paint mode only to avoid
+ checking various context stuff here */
- if(ob) {
+ if(CTX_wm_view3d(C) && ob) {
if(ob->mode & OB_MODE_SCULPT)
mode = OB_MODE_SCULPT;
else if(ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT))
@@ -1043,12 +1064,10 @@ static int ui_id_brush_get_icon(bContext *C, ID *id, int preview)
else if(ob->mode & OB_MODE_TEXTURE_PAINT)
mode = OB_MODE_TEXTURE_PAINT;
}
-
- /* check if cached icon is OK */
- if(!mode || (id->icon_id && mode == br->icon_mode))
- return id->icon_id;
-
- br->icon_mode = mode;
+ else if((sima = CTX_wm_space_image(C)) &&
+ (sima->flag & SI_DRAWTOOL)) {
+ mode = OB_MODE_TEXTURE_PAINT;
+ }
/* reset the icon */
if(mode == OB_MODE_SCULPT) {
@@ -1064,14 +1083,14 @@ static int ui_id_brush_get_icon(bContext *C, ID *id, int preview)
tool = br->imagepaint_tool;
}
- if(!RNA_enum_icon_from_value(items, tool, &id->icon_id))
+ if(!items || !RNA_enum_icon_from_value(items, tool, &id->icon_id))
id->icon_id = 0;
}
return id->icon_id;
}
-int ui_id_icon_get(bContext *C, ID *id, int preview)
+int ui_id_icon_get(bContext *C, ID *id, int big)
{
int iconid= 0;
@@ -1079,7 +1098,7 @@ int ui_id_icon_get(bContext *C, ID *id, int preview)
switch(GS(id->name))
{
case ID_BR:
- iconid= ui_id_brush_get_icon(C, id, preview);
+ iconid= ui_id_brush_get_icon(C, id);
break;
case ID_MA: /* fall through */
case ID_TE: /* fall through */
@@ -1088,7 +1107,7 @@ int ui_id_icon_get(bContext *C, ID *id, int preview)
case ID_LA: /* fall through */
iconid= BKE_icon_getid(id);
/* checks if not exists, or changed */
- ui_id_icon_render(C, id, preview);
+ ui_id_icon_render(C, id, big);
break;
default:
break;
diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h
index 95b808fe4b1..7dde0a73d56 100644
--- a/source/blender/editors/interface/interface_intern.h
+++ b/source/blender/editors/interface/interface_intern.h
@@ -479,7 +479,6 @@ void ui_draw_preview_item(struct uiFontStyle *fstyle, rcti *rect, char *name, in
void uiStyleInit(void);
/* interface_icons.c */
-void ui_id_icon_render(struct bContext *C, struct ID *id, int preview);
int ui_id_icon_get(struct bContext *C, struct ID *id, int preview);
/* resources.c */
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index f39a0204dcb..d67946752da 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -1234,7 +1234,7 @@ void ui_but_add_search(uiBut *but, PointerRNA *ptr, PropertyRNA *prop, PointerRN
but->hardmax= MAX2(but->hardmax, 256);
but->rnasearchpoin= *searchptr;
but->rnasearchprop= searchprop;
- but->flag |= UI_ICON_LEFT|UI_TEXT_LEFT|UI_BUT_UNDO;
+ but->flag |= UI_ICON_LEFT|UI_TEXT_LEFT;
uiButSetSearchFunc(but, rna_search_cb, but, NULL, NULL);
}
@@ -2730,4 +2730,12 @@ void uiLayoutOperatorButs(const bContext *C, uiLayout *layout, wmOperator *op,in
uiItemL(layout, "No Properties.", ICON_NULL);
}
}
+
+ /* no undo for buttons for operator redo panels */
+ {
+ uiBut *but;
+
+ for(but= uiLayoutGetBlock(layout)->buttons.first; but; but= but->next)
+ uiButClearFlag(but, UI_BUT_UNDO);
+ }
}
diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c
index 571a48a4100..4b855b88ece 100644
--- a/source/blender/editors/interface/interface_regions.c
+++ b/source/blender/editors/interface/interface_regions.c
@@ -1984,7 +1984,7 @@ uiBlock *ui_block_func_COL(bContext *C, uiPopupBlockHandle *handle, void *arg_bu
uiBlockPicker(block, handle->retvec, &but->rnapoin, but->rnaprop);
- block->flag= UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_KEEP_OPEN;
+ block->flag= UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_KEEP_OPEN|UI_BLOCK_OUT_1;
uiBoundsBlock(block, 10);
block->block_event_func= ui_picker_small_wheel_cb;
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index cf29794434e..4224b0b080f 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -746,7 +746,7 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol)
#define PREVIEW_PAD 4
-static void widget_draw_preview(BIFIconID icon, float aspect, float UNUSED(alpha), rcti *rect)
+static void widget_draw_preview(BIFIconID icon, float UNUSED(alpha), rcti *rect)
{
int w, h, size;
@@ -762,7 +762,7 @@ static void widget_draw_preview(BIFIconID icon, float aspect, float UNUSED(alpha
int x = rect->xmin + w/2 - size/2;
int y = rect->ymin + h/2 - size/2;
- UI_icon_draw_preview_aspect_size(x, y, icon, aspect, size);
+ UI_icon_draw_preview_aspect_size(x, y, icon, 1.0f, size);
}
}
@@ -776,7 +776,7 @@ static void widget_draw_icon(uiBut *but, BIFIconID icon, float alpha, rcti *rect
float aspect, height;
if (but->flag & UI_ICON_PREVIEW) {
- widget_draw_preview(icon, but->block->aspect, alpha, rect);
+ widget_draw_preview(icon, alpha, rect);
return;
}
@@ -871,28 +871,42 @@ static void ui_text_leftclip(uiFontStyle *fstyle, uiBut *but, rcti *rect)
if (fstyle->kerning==1) /* for BLF_width */
BLF_enable(fstyle->uifont_id, BLF_KERNING_DEFAULT);
- but->strwidth= BLF_width(fstyle->uifont_id, but->drawstr);
- but->ofs= 0;
+ /* if text editing we define ofs dynamically */
+ if(but->editstr && but->pos >= 0) {
+ if(but->ofs > but->pos)
+ but->ofs= but->pos;
+ }
+ else but->ofs= 0;
- while(but->strwidth > okwidth ) {
-
- but->ofs++;
- but->strwidth= BLF_width(fstyle->uifont_id, but->drawstr+but->ofs);
+ but->strwidth= BLF_width(fstyle->uifont_id, but->drawstr + but->ofs);
+
+ while(but->strwidth > okwidth) {
- /* textbut exception */
- if(but->editstr && but->pos != -1) {
- int pos= but->pos+1;
+ /* textbut exception, clip right when... */
+ if(but->editstr && but->pos >= 0) {
+ float width;
+ char buf[256];
- if(pos-1 < but->ofs) {
- pos= but->ofs-pos+1;
- but->ofs -= pos;
- if(but->ofs<0) {
- but->ofs= 0;
- pos--;
- }
- but->drawstr[ strlen(but->drawstr)-pos ]= 0;
+ /* copy draw string */
+ BLI_strncpy(buf, but->drawstr, sizeof(buf));
+ /* string position of cursor */
+ buf[but->pos]= 0;
+ width= BLF_width(fstyle->uifont_id, buf+but->ofs);
+
+ /* if cursor is at 20 pixels of right side button we clip left */
+ if(width > okwidth-20)
+ but->ofs++;
+ else {
+ /* shift string to the left */
+ if(width < 20 && but->ofs > 0)
+ but->ofs--;
+ but->drawstr[ strlen(but->drawstr)-1 ]= 0;
}
}
+ else
+ but->ofs++;
+
+ but->strwidth= BLF_width(fstyle->uifont_id, but->drawstr+but->ofs);
if(but->strwidth < 10) break;
}
@@ -3118,7 +3132,7 @@ void ui_draw_preview_item(uiFontStyle *fstyle, rcti *rect, char *name, int iconi
wt->state(wt, state);
wt->draw(&wt->wcol, rect, 0, 0);
- widget_draw_preview(iconid, 1.f, 1.f, rect);
+ widget_draw_preview(iconid, 1.0f, rect);
if (state == UI_ACTIVE)
glColor3ubv((unsigned char*)wt->wcol.text);
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c
index 5e3a0c6022a..3a29419074b 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -1015,7 +1015,7 @@ void init_userdef_do_versions(void)
}
if (U.savetime <= 0) {
U.savetime = 1;
-// XXX error("startup.blend is buggy, please consider removing it.\n");
+// XXX error(STRINGIFY(BLENDER_STARTUP_FILE)" is buggy, please consider removing it.\n");
}
/* transform widget settings */
if(U.tw_hotspot==0) {
diff --git a/source/blender/editors/mesh/editmesh_lib.c b/source/blender/editors/mesh/editmesh_lib.c
index 8fab314e989..72c0e7a9a64 100644
--- a/source/blender/editors/mesh/editmesh_lib.c
+++ b/source/blender/editors/mesh/editmesh_lib.c
@@ -2442,7 +2442,7 @@ void EM_make_hq_normals(EditMesh *em)
for(edge_iter = BLI_edgehashIterator_new(edge_hash); !BLI_edgehashIterator_isDone(edge_iter); BLI_edgehashIterator_step(edge_iter)) {
- /* Get the edge vert indicies, and edge value (the face indicies that use it)*/
+ /* Get the edge vert indices, and edge value (the face indices that use it)*/
BLI_edgehashIterator_getKey(edge_iter, (int*)&ed_v1, (int*)&ed_v2);
edge_ref = BLI_edgehashIterator_getValue(edge_iter);
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index cd2b0f79f1a..eee17bc78ef 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -491,7 +491,7 @@ void OBJECT_OT_camera_add(wmOperatorType *ot)
static int object_metaball_add_exec(bContext *C, wmOperator *op)
{
Object *obedit= CTX_data_edit_object(C);
- MetaElem *elem;
+ /*MetaElem *elem;*/ /*UNUSED*/
int newob= 0;
int enter_editmode;
unsigned int layer;
@@ -511,7 +511,7 @@ static int object_metaball_add_exec(bContext *C, wmOperator *op)
ED_object_new_primitive_matrix(C, obedit, loc, rot, mat);
- elem= (MetaElem*)add_metaball_primitive(C, mat, RNA_enum_get(op->ptr, "type"), newob);
+ /* elem= (MetaElem *) */ add_metaball_primitive(C, mat, RNA_enum_get(op->ptr, "type"), newob);
/* userdef */
if (newob && !enter_editmode) {
diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c
index 9322886266a..344c2c13861 100644
--- a/source/blender/editors/object/object_constraint.c
+++ b/source/blender/editors/object/object_constraint.c
@@ -469,11 +469,11 @@ static EnumPropertyItem constraint_owner_items[] = {
static int edit_constraint_poll_generic(bContext *C, StructRNA *rna_type)
{
PointerRNA ptr= CTX_data_pointer_get_type(C, "constraint", rna_type);
- Object *ob= (ptr.id.data)?ptr.id.data:ED_object_active_context(C);
-
+ Object *ob= (ptr.id.data) ? ptr.id.data : ED_object_active_context(C);
+
if (!ob || ob->id.lib) return 0;
- if (ptr.data && ((ID*)ptr.id.data)->lib) return 0;
-
+ if (ptr.id.data && ((ID*)ptr.id.data)->lib) return 0;
+
return 1;
}
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index a0d8e3c9733..704efb59d3d 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -1050,7 +1050,8 @@ static unsigned int move_to_layer_init(bContext *C, wmOperator *op)
unsigned int lay= 0;
if(!RNA_property_is_set(op->ptr, "layers")) {
- CTX_DATA_BEGIN(C, Base*, base, selected_editable_bases) {
+ /* note: layers are set in bases, library objects work for this */
+ CTX_DATA_BEGIN(C, Base*, base, selected_bases) {
lay |= base->lay;
}
CTX_DATA_END;
@@ -1098,8 +1099,8 @@ static int move_to_layer_exec(bContext *C, wmOperator *op)
if(v3d && v3d->localvd) {
/* now we can move out of localview. */
- // XXX if (!okee("Move from localview")) return;
- CTX_DATA_BEGIN(C, Base*, base, selected_editable_bases) {
+ /* note: layers are set in bases, library objects work for this */
+ CTX_DATA_BEGIN(C, Base*, base, selected_bases) {
lay= base->lay & ~v3d->lay;
base->lay= lay;
base->object->lay= lay;
@@ -1111,7 +1112,8 @@ static int move_to_layer_exec(bContext *C, wmOperator *op)
}
else {
/* normal non localview operation */
- CTX_DATA_BEGIN(C, Base*, base, selected_editable_bases) {
+ /* note: layers are set in bases, library objects work for this */
+ CTX_DATA_BEGIN(C, Base*, base, selected_bases) {
/* upper byte is used for local view */
local= base->lay & 0xFF000000;
base->lay= lay + local;
diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c
index 8501ee22031..bd7983004eb 100644
--- a/source/blender/editors/object/object_vgroup.c
+++ b/source/blender/editors/object/object_vgroup.c
@@ -30,6 +30,7 @@
#include <string.h>
#include <stddef.h>
#include <math.h>
+#include <assert.h>
#include "MEM_guardedalloc.h"
@@ -168,8 +169,7 @@ int ED_vgroup_give_parray(ID *id, MDeformVert ***dvert_arr, int *dvert_tot)
return 0;
}
- i = 0;
- for (eve=em->verts.first; eve; eve=eve->next) i++;
+ i= BLI_countlist(&em->verts);
*dvert_arr= MEM_mallocN(sizeof(void*)*i, "vgroup parray from me");
*dvert_tot = i;
@@ -492,23 +492,10 @@ void ED_vgroup_vert_remove(Object *ob, bDeformGroup *dg, int vertnum)
/* This routine removes the vertex from the specified
* deform group.
*/
-
- int def_nr;
-
- /* if the object is NULL abort
- */
- if(!ob)
+ const int def_nr= defgroup_find_index(ob, dg);
+ if(def_nr < 0)
return;
- /* get the deform number that cooresponds
- * to this deform group, and abort if it
- * can not be found.
- */
- def_nr = defgroup_find_index(ob, dg);
- if(def_nr < 0) return;
-
- /* call another routine to do the work
- */
ED_vgroup_nr_vert_remove(ob, def_nr, vertnum);
}
@@ -1128,55 +1115,52 @@ static void vgroup_delete_update_users(Object *ob, int id)
static void vgroup_delete_object_mode(Object *ob, bDeformGroup *dg)
{
- MDeformVert *dvert, *dvert_array=NULL;
+ MDeformVert *dvert_array=NULL;
int i, e, dvert_tot=0;
+ const int dg_index= BLI_findindex(&ob->defbase, dg);
+
+ assert(dg_index > -1);
ED_vgroup_give_array(ob->data, &dvert_array, &dvert_tot);
if(dvert_array) {
- for(i = 0; i < dvert_tot; i++) {
- dvert = dvert_array + i;
- if(dvert) {
- if(defvert_find_index(dvert, (ob->actdef-1)))
- ED_vgroup_vert_remove(ob, dg, i);
- }
+ MDeformVert *dvert;
+ for(i= 0, dvert= dvert_array; i < dvert_tot; i++, dvert++) {
+ ED_vgroup_vert_remove(ob, dg, i); /* ok if the dg isnt in this dvert, will continue silently */
}
- for(i = 0; i < dvert_tot; i++) {
- dvert = dvert_array+i;
- if(dvert) {
- for(e = 0; e < dvert->totweight; e++) {
- if(dvert->dw[e].def_nr > (ob->actdef-1))
- dvert->dw[e].def_nr--;
+ for(i= 0, dvert= dvert_array; i < dvert_tot; i++, dvert++) {
+ for(e = 0; e < dvert->totweight; e++) {
+ if(dvert->dw[e].def_nr > dg_index) {
+ dvert->dw[e].def_nr--;
}
}
}
}
- vgroup_delete_update_users(ob, ob->actdef);
+ vgroup_delete_update_users(ob, dg_index + 1);
- /* Update the active deform index if necessary */
- if(ob->actdef == BLI_countlist(&ob->defbase))
- ob->actdef--;
-
/* Remove the group */
BLI_freelinkN(&ob->defbase, dg);
+
+ /* Update the active deform index if necessary */
+ if(ob->actdef > dg_index)
+ ob->actdef--;
+ if(ob->actdef < 1 && ob->defbase.first)
+ ob->actdef= 1;
+
}
/* only in editmode */
/* removes from active defgroup, if allverts==0 only selected vertices */
-static void vgroup_active_remove_verts(Object *ob, int allverts)
+static void vgroup_active_remove_verts(Object *ob, const int allverts, bDeformGroup *dg)
{
EditVert *eve;
MDeformVert *dvert;
MDeformWeight *newdw;
- bDeformGroup *dg, *eg;
+ bDeformGroup *eg;
int i;
- dg=BLI_findlink(&ob->defbase, ob->actdef-1);
- if(!dg)
- return;
-
if(ob->type == OB_MESH) {
Mesh *me= ob->data;
EditMesh *em = BKE_mesh_get_editmesh(me);
@@ -1226,15 +1210,15 @@ static void vgroup_active_remove_verts(Object *ob, int allverts)
}
}
-static void vgroup_delete_edit_mode(Object *ob, bDeformGroup *defgroup)
+static void vgroup_delete_edit_mode(Object *ob, bDeformGroup *dg)
{
int i;
+ const int dg_index= BLI_findindex(&ob->defbase, dg);
- if(!ob->actdef)
- return;
+ assert(dg_index > -1);
/* Make sure that no verts are using this group */
- vgroup_active_remove_verts(ob, 1);
+ vgroup_active_remove_verts(ob, TRUE, dg);
/* Make sure that any verts with higher indices are adjusted accordingly */
if(ob->type==OB_MESH) {
@@ -1248,7 +1232,7 @@ static void vgroup_delete_edit_mode(Object *ob, bDeformGroup *defgroup)
if(dvert)
for(i=0; i<dvert->totweight; i++)
- if(dvert->dw[i].def_nr > (ob->actdef-1))
+ if(dvert->dw[i].def_nr > dg_index)
dvert->dw[i].def_nr--;
}
BKE_mesh_end_editmesh(me, em);
@@ -1263,24 +1247,26 @@ static void vgroup_delete_edit_mode(Object *ob, bDeformGroup *defgroup)
tot= lt->pntsu*lt->pntsv*lt->pntsw;
for(a=0, bp= lt->def; a<tot; a++, bp++, dvert++) {
for(i=0; i<dvert->totweight; i++){
- if(dvert->dw[i].def_nr > (ob->actdef-1))
+ if(dvert->dw[i].def_nr > dg_index)
dvert->dw[i].def_nr--;
}
}
}
}
- vgroup_delete_update_users(ob, ob->actdef);
+ vgroup_delete_update_users(ob, dg_index + 1);
+
+ /* Remove the group */
+ BLI_freelinkN (&ob->defbase, dg);
/* Update the active deform index if necessary */
- if(ob->actdef==BLI_countlist(&ob->defbase))
+ if(ob->actdef > dg_index)
ob->actdef--;
-
- /* Remove the group */
- BLI_freelinkN (&ob->defbase, defgroup);
-
+ if(ob->actdef < 1 && ob->defbase.first)
+ ob->actdef= 1;
+
/* remove all dverts */
- if(ob->actdef==0) {
+ if(ob->defbase.first == NULL) {
if(ob->type==OB_MESH) {
Mesh *me= ob->data;
CustomData_free_layer_active(&me->vdata, CD_MDEFORMVERT, me->totvert);
@@ -1417,22 +1403,14 @@ static void vgroup_assign_verts(Object *ob, float weight)
/* removes from all defgroup, if allverts==0 only selected vertices */
static void vgroup_remove_verts(Object *ob, int allverts)
{
- int actdef, defCount;
-
- actdef= ob->actdef;
- defCount= BLI_countlist(&ob->defbase);
-
- if(defCount == 0)
- return;
-
/* To prevent code redundancy, we just use vgroup_active_remove_verts, but that
* only operates on the active vgroup. So we iterate through all groups, by changing
* active group index
*/
- for(ob->actdef= 1; ob->actdef <= defCount; ob->actdef++)
- vgroup_active_remove_verts(ob, allverts);
-
- ob->actdef= actdef;
+ bDeformGroup *dg;
+ for(dg= ob->defbase.first; dg; dg= dg->next) {
+ vgroup_active_remove_verts(ob, allverts, dg);
+ }
}
/********************** vertex group operators *********************/
@@ -1552,8 +1530,15 @@ static int vertex_group_remove_from_exec(bContext *C, wmOperator *op)
if(RNA_boolean_get(op->ptr, "all"))
vgroup_remove_verts(ob, 0);
- else
- vgroup_active_remove_verts(ob, 0);
+ else {
+ bDeformGroup *dg= BLI_findlink(&ob->defbase, ob->actdef - 1);
+
+ if(dg == NULL) {
+ return OPERATOR_CANCELLED;
+ }
+
+ vgroup_active_remove_verts(ob, FALSE, dg);
+ }
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_GEOM|ND_DATA, ob->data);
@@ -1938,7 +1923,7 @@ void OBJECT_OT_vertex_group_copy_to_selected(wmOperatorType *ot)
/* identifiers */
ot->name= "Copy Vertex Group to Selected";
ot->idname= "OBJECT_OT_vertex_group_copy_to_selected";
- ot->description= "Copy Vertex Groups to other selected objects with matching indicies";
+ ot->description= "Copy Vertex Groups to other selected objects with matching indices";
/* api callbacks */
ot->poll= vertex_group_poll;
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c
index 0017fd0130a..93e652023cf 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -4014,6 +4014,9 @@ static void PE_create_particle_edit(Scene *scene, Object *ob, PointCache *cache,
if(cache && cache->flag & PTCACHE_DISK_CACHE)
return;
+ if(psys == NULL && cache->mem_cache.first == NULL)
+ return;
+
if(!edit) {
totpoint = psys ? psys->totpart : ((PTCacheMem*)cache->mem_cache.first)->totpoint;
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index 6f4f996d004..ba73c488c46 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -432,7 +432,8 @@ static void image_undo_restore(bContext *C, ListBase *lb)
GPU_free_image(ima); /* force OpenGL reload */
if(ibuf->rect_float)
- imb_freerectImBuf(ibuf); /* force recreate of char rect */
+ ibuf->userflags |= IB_RECT_INVALID; /* force recreate of char rect */
+
}
IMB_freeImBuf(tmpibuf);
@@ -935,7 +936,7 @@ static int pixel_bounds_array(float (* uv)[2], rcti *bounds_px, const int ibuf_x
#ifndef PROJ_DEBUG_NOSEAMBLEED
-/* This function returns 1 if this face has a seam along the 2 face-vert indicies
+/* This function returns 1 if this face has a seam along the 2 face-vert indices
* 'orig_i1_fidx' and 'orig_i2_fidx' */
static int check_seam(const ProjPaintState *ps, const int orig_face, const int orig_i1_fidx, const int orig_i2_fidx, int *other_face, int *orig_fidx)
{
@@ -948,7 +949,7 @@ static int check_seam(const ProjPaintState *ps, const int orig_face, const int o
const MFace *orig_mf = ps->dm_mface + orig_face;
const MTFace *orig_tf = ps->dm_mtface + orig_face;
- /* vert indicies from face vert order indicies */
+ /* vert indices from face vert order indices */
i1 = (*(&orig_mf->v1 + orig_i1_fidx));
i2 = (*(&orig_mf->v1 + orig_i2_fidx));
@@ -2576,7 +2577,7 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i
}
-/* takes floating point screenspace min/max and returns int min/max to be used as indicies for ps->bucketRect, ps->bucketFlags */
+/* takes floating point screenspace min/max and returns int min/max to be used as indices for ps->bucketRect, ps->bucketFlags */
static void project_paint_bucket_bounds(const ProjPaintState *ps, const float min[2], const float max[2], int bucketMin[2], int bucketMax[2])
{
/* divide by bucketWidth & bucketHeight so the bounds are offset in bucket grid units */
@@ -4022,7 +4023,7 @@ static void imapaint_image_update(SpaceImage *sima, Image *image, ImBuf *ibuf, s
{
if(ibuf->rect_float)
/* TODO - should just update a portion from imapaintpartial! */
- imb_freerectImBuf(ibuf); /* force recreate of char rect */
+ ibuf->userflags |= IB_RECT_INVALID; /* force recreate of char rect */
if(ibuf->mipmap[0])
ibuf->userflags |= IB_MIPMAP_INVALID;
diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c
index 1ae26421152..365c17d45c0 100644
--- a/source/blender/editors/space_action/action_select.c
+++ b/source/blender/editors/space_action/action_select.c
@@ -123,10 +123,10 @@ static void deselect_action_keys (bAnimContext *ac, short test, short sel)
/* Now set the flags */
for (ale= anim_data.first; ale; ale= ale->next) {
- if (ale->type == ANIMTYPE_FCURVE)
- ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, sel_cb, NULL);
- else if (ale->type == ANIMTYPE_GPLAYER)
+ if (ale->type == ANIMTYPE_GPLAYER)
set_gplayer_frame_selection(ale->data, sel);
+ else
+ ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, sel_cb, NULL);
}
/* Cleanup */
@@ -253,10 +253,10 @@ static void borderselect_action (bAnimContext *ac, rcti rect, short mode, short
!((ymax < rectf.ymin) || (ymin > rectf.ymax)) )
{
/* loop over data selecting */
- if (ale->type == ANIMTYPE_FCURVE)
- ANIM_animchannel_keyframes_loop(&ked, ale, ok_cb, select_cb, NULL, filterflag);
- else if (ale->type == ANIMTYPE_GPLAYER)
+ if (ale->type == ANIMTYPE_GPLAYER)
borderselect_gplayer_frames(ale->data, rectf.xmin, rectf.xmax, selectmode);
+ else
+ ANIM_animchannel_keyframes_loop(&ked, ale, ok_cb, select_cb, NULL, filterflag);
}
/* set minimum extent to be the maximum of the next channel */
@@ -484,10 +484,10 @@ static void columnselect_action_keys (bAnimContext *ac, short mode)
ked.f1= ce->cfra;
/* select elements with frame number matching cfraelem */
- if (ale->type == ANIMTYPE_FCURVE)
- ANIM_fcurve_keyframes_loop(&ked, ale->key_data, ok_cb, select_cb, NULL);
- else if (ale->type == ANIMTYPE_GPLAYER)
+ if (ale->type == ANIMTYPE_GPLAYER)
select_gpencil_frame(ale->data, ce->cfra, SELECT_ADD);
+ else
+ ANIM_fcurve_keyframes_loop(&ked, ale->key_data, ok_cb, select_cb, NULL);
}
}
@@ -865,10 +865,10 @@ static void actkeys_mselect_column(bAnimContext *ac, short select_mode, float se
ked.f1= selx;
/* select elements with frame number matching cfra */
- if (ale->type == ANIMTYPE_FCURVE)
- ANIM_fcurve_keyframes_loop(&ked, ale->key_data, ok_cb, select_cb, NULL);
- else if (ale->type == ANIMTYPE_GPLAYER)
+ if (ale->type == ANIMTYPE_GPLAYER)
select_gpencil_frame(ale->key_data, selx, select_mode);
+ else
+ ANIM_fcurve_keyframes_loop(&ked, ale->key_data, ok_cb, select_cb, NULL);
}
/* free elements */
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c
index 98547dbe798..e9e036a65cb 100644
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@ -302,7 +302,8 @@ static void file_draw_string(int sx, int sy, const char* string, float width, in
fs.align = align;
BLI_strncpy(fname,string, FILE_MAXFILE);
-
+ file_shorten_string(fname, width+1.0, 0);
+
/* no text clipping needed, uiStyleFontDraw does it but is a bit too strict (for buttons it works) */
rect.xmin = sx;
rect.xmax = sx + ceil(width+4.0f);
diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c
index dc86a56e9f0..e688454464c 100644
--- a/source/blender/editors/space_graph/graph_edit.c
+++ b/source/blender/editors/space_graph/graph_edit.c
@@ -178,6 +178,7 @@ void GRAPH_OT_previewrange_set (wmOperatorType *ot)
/* identifiers */
ot->name= "Auto-Set Preview Range";
ot->idname= "GRAPH_OT_previewrange_set";
+ ot->description= "Automatically set Preview Range based on range of keyframes";
/* api callbacks */
ot->exec= graphkeys_previewrange_exec;
diff --git a/source/blender/editors/space_graph/graph_ops.c b/source/blender/editors/space_graph/graph_ops.c
index 95c499c263b..42f0f35f4e8 100644
--- a/source/blender/editors/space_graph/graph_ops.c
+++ b/source/blender/editors/space_graph/graph_ops.c
@@ -204,6 +204,7 @@ void GRAPH_OT_view_togglehandles (wmOperatorType *ot)
/* identification */
ot->name= "Show/Hide All Handles";
ot->idname= "GRAPH_OT_handles_view_toggle";
+ ot->description= "Toggle whether handles are drawn on all keyframes that need them";
/* callbacks */
ot->exec= view_toggle_handles_exec;
diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c
index e2d58b1df5f..5fd86e2ed9a 100644
--- a/source/blender/editors/space_image/image_draw.c
+++ b/source/blender/editors/space_image/image_draw.c
@@ -83,7 +83,7 @@ static void image_verify_buffer_float(Image *ima, ImBuf *ibuf, int color_manage)
NOTE: if float buffer changes, we have to manually remove the rect
*/
- if(ibuf->rect_float && ibuf->rect==NULL) {
+ if(ibuf->rect_float && (ibuf->rect==NULL || (ibuf->userflags & IB_RECT_INVALID)) ) {
if(color_manage) {
if(ima && ima->source == IMA_SRC_VIEWER)
ibuf->profile = IB_PROFILE_LINEAR_RGB;
@@ -473,13 +473,18 @@ static void draw_image_buffer_tiled(SpaceImage *sima, ARegion *ar, Scene *scene,
static void draw_image_buffer_repeated(SpaceImage *sima, ARegion *ar, Scene *scene, Image *ima, ImBuf *ibuf, float zoomx, float zoomy)
{
- float x, y;
- double time_current;
-
- time_current = PIL_check_seconds_timer();
+ const double time_current= PIL_check_seconds_timer();
+
+ const int xmax= ceil(ar->v2d.cur.xmax);
+ const int ymax= ceil(ar->v2d.cur.ymax);
+ const int xmin= floor(ar->v2d.cur.xmin);
+ const int ymin= floor(ar->v2d.cur.ymin);
+
+ int x;
- for(x=floor(ar->v2d.cur.xmin); x<ar->v2d.cur.xmax; x += 1.0f) {
- for(y=floor(ar->v2d.cur.ymin); y<ar->v2d.cur.ymax; y += 1.0f) {
+ for(x=xmin; x<xmax; x++) {
+ int y;
+ for(y=ymin; y<ymax; y++) {
if(ima && (ima->tpageflag & IMA_TILES))
draw_image_buffer_tiled(sima, ar, scene, ima, ibuf, x, y, zoomx, zoomy);
else
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index 3f4c10c8155..cd54a899f35 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -1445,7 +1445,10 @@ static void unpack_menu(bContext *C, const char *opname, Image *ima, const char
pup= uiPupMenuBegin(C, "Unpack file", ICON_NULL);
layout= uiPupMenuLayout(pup);
- uiItemEnumO(layout, opname, "Remove Pack", 0, "method", PF_REMOVE);
+ sprintf(line, "Remove Pack");
+ props_ptr= uiItemFullO(layout, opname, line, ICON_NULL, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+ RNA_enum_set(&props_ptr, "method", PF_REMOVE);
+ RNA_string_set(&props_ptr, "image", ima->id.name+2);
if(strcmp(abs_name, local_name)) {
switch(checkPackedFile(local_name, pf)) {
diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c
index c8766f5c4c1..ec8f21065f5 100644
--- a/source/blender/editors/space_logic/logic_window.c
+++ b/source/blender/editors/space_logic/logic_window.c
@@ -3263,7 +3263,8 @@ static void draw_sensor_armature(uiLayout *layout, PointerRNA *ptr)
}
row = uiLayoutRow(layout, 1);
uiItemR(row, ptr, "test_type", 0, NULL, ICON_NULL);
- uiItemR(row, ptr, "value", 0, NULL, ICON_NULL);
+ if (RNA_enum_get(ptr, "test_type") != SENS_ARM_STATE_CHANGED)
+ uiItemR(row, ptr, "value", 0, NULL, ICON_NULL);
}
static void draw_sensor_collision(uiLayout *layout, PointerRNA *ptr, bContext *C)
diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c
index fd3623eec11..7d4db6fd89c 100644
--- a/source/blender/editors/space_nla/nla_channels.c
+++ b/source/blender/editors/space_nla/nla_channels.c
@@ -342,8 +342,9 @@ static int nlachannels_mouseclick_invoke(bContext *C, wmOperator *op, wmEvent *e
void NLA_OT_channels_click (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Mouse Click on Channels";
+ ot->name= "Mouse Click on NLA Channels";
ot->idname= "NLA_OT_channels_click";
+ ot->description= "Handle clicks to select NLA channels";
/* api callbacks */
ot->invoke= nlachannels_mouseclick_invoke;
diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c
index d1417d69ae3..b70a6339fed 100644
--- a/source/blender/editors/space_nla/nla_edit.c
+++ b/source/blender/editors/space_nla/nla_edit.c
@@ -621,8 +621,8 @@ static int nlaedit_duplicate_exec (bContext *C, wmOperator *UNUSED(op))
/* deselect the original and the active flag */
strip->flag &= ~(NLASTRIP_FLAG_SELECT|NLASTRIP_FLAG_ACTIVE);
- /* auto-name it */
- BKE_nlastrip_validate_name(adt, strip);
+ /* auto-name newly created strip */
+ BKE_nlastrip_validate_name(adt, nstrip);
done++;
}
@@ -650,7 +650,7 @@ static int nlaedit_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED
{
nlaedit_duplicate_exec(C, op);
- RNA_int_set(op->ptr, "mode", TFM_TIME_TRANSLATE); // XXX
+ RNA_int_set(op->ptr, "mode", TFM_TRANSLATION);
WM_operator_name_call(C, "TRANSFORM_OT_transform", WM_OP_INVOKE_REGION_WIN, op->ptr);
return OPERATOR_FINISHED;
@@ -1006,6 +1006,164 @@ void NLA_OT_mute_toggle (wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
}
+/* ******************** Swap Strips Operator ************************** */
+/* Tries to exchange strips within their owner tracks */
+
+static int nlaedit_swap_exec (bContext *C, wmOperator *op)
+{
+ bAnimContext ac;
+
+ ListBase anim_data = {NULL, NULL};
+ bAnimListElem *ale;
+ int filter;
+
+ /* get editor data */
+ if (ANIM_animdata_get_context(C, &ac) == 0)
+ return OPERATOR_CANCELLED;
+
+ /* get a list of the editable tracks being shown in the NLA */
+ filter= (ANIMFILTER_VISIBLE | ANIMFILTER_NLATRACKS | ANIMFILTER_FOREDIT);
+ ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
+
+ /* consider each track in turn */
+ for (ale= anim_data.first; ale; ale= ale->next) {
+ NlaTrack *nlt= (NlaTrack *)ale->data;
+
+ NlaStrip *strip, *stripN=NULL;
+ NlaStrip *sa=NULL, *sb=NULL;
+
+ /* make temporary metastrips so that entire islands of selections can be moved around */
+ BKE_nlastrips_make_metas(&nlt->strips, 1);
+
+ /* special case: if there is only 1 island (i.e. temp meta BUT NOT unselected/normal/normal-meta strips) left after this,
+ * and this island has two strips inside it, then we should be able to just swap these still...
+ */
+ if ((nlt->strips.first == nlt->strips.last) && (nlt->strips.first != NULL)) {
+ NlaStrip *mstrip = (NlaStrip *)nlt->strips.first;
+
+ if ((mstrip->flag & NLASTRIP_FLAG_TEMP_META) && (BLI_countlist(&mstrip->strips) == 2))
+ {
+ /* remove this temp meta, so that we can see the strips inside */
+ BKE_nlastrips_clear_metas(&nlt->strips, 0, 1);
+ }
+ }
+
+ /* get two selected strips only (these will be metas due to prev step) to operate on
+ * - only allow swapping 2, as with more the context becomes unclear
+ */
+ for (strip = nlt->strips.first; strip; strip = stripN) {
+ stripN = strip->next;
+
+ if (strip->flag & NLASTRIP_FLAG_SELECT) {
+ /* first or second strip? */
+ if (sa == NULL) {
+ /* store as first */
+ sa = strip;
+ }
+ else if (sb == NULL) {
+ /* store as second */
+ sb = strip;
+ }
+ else {
+ /* too many selected */
+ break;
+ }
+ }
+ }
+
+ if (strip) {
+ /* too many selected warning */
+ BKE_reportf(op->reports, RPT_WARNING,
+ "Too many clusters of strips selected in NLA Track (%s). Needs exactly 2 to be selected.",
+ nlt->name);
+ }
+ else if (sa == NULL) {
+ /* no warning as this is just a common case, and it may get annoying when doing multiple tracks */
+ }
+ else if (sb == NULL) {
+ /* too few selected warning */
+ BKE_reportf(op->reports, RPT_WARNING,
+ "Too few clusters of strips selected in NLA Track (%s). Needs exactly 2 to be selected.",
+ nlt->name);
+ }
+ else {
+ float nsa[2], nsb[2];
+
+ /* remove these strips from the track, so that we can test if they can fit in the proposed places */
+ BLI_remlink(&nlt->strips, sa);
+ BLI_remlink(&nlt->strips, sb);
+
+ /* calculate new extents for strips */
+ /* a --> b */
+ nsa[0] = sb->start;
+ nsa[1] = sb->start + (sa->end - sa->start);
+ /* b --> a */
+ nsb[0] = sa->start;
+ nsb[1] = sa->start + (sb->end - sb->start);
+
+ /* check if the track has room for the strips to be swapped */
+ if (BKE_nlastrips_has_space(&nlt->strips, nsa[0], nsa[1]) &&
+ BKE_nlastrips_has_space(&nlt->strips, nsb[0], nsb[1]))
+ {
+ /* set new extents for strips then */
+ sa->start = nsa[0];
+ sa->end = nsa[1];
+ BKE_nlameta_flush_transforms(sa);
+
+ sb->start = nsb[0];
+ sb->end = nsb[1];
+ BKE_nlameta_flush_transforms(sb);
+ }
+ else {
+ /* not enough room to swap, so show message */
+ if ((sa->flag & NLASTRIP_FLAG_TEMP_META) || (sb->flag & NLASTRIP_FLAG_TEMP_META)) {
+ BKE_report(op->reports, RPT_WARNING,
+ "Cannot swap selected strips as they will not be able to fit in their new places");
+ }
+ else {
+ BKE_reportf(op->reports, RPT_WARNING,
+ "Cannot swap '%s' and '%s' as one or both will not be able to fit in their new places",
+ sa->name, sb->name);
+ }
+ }
+
+ /* add strips back to track now */
+ BKE_nlatrack_add_strip(nlt, sa);
+ BKE_nlatrack_add_strip(nlt, sb);
+ }
+
+ /* clear (temp) metastrips */
+ BKE_nlastrips_clear_metas(&nlt->strips, 0, 1);
+ }
+
+ /* free temp data */
+ BLI_freelistN(&anim_data);
+
+ /* refresh auto strip properties */
+ ED_nla_postop_refresh(&ac);
+
+ /* set notifier that things have changed */
+ WM_event_add_notifier(C, NC_ANIMATION|ND_NLA|NA_EDITED, NULL);
+
+ /* done */
+ return OPERATOR_FINISHED;
+}
+
+void NLA_OT_swap (wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Swap Strips";
+ ot->idname= "NLA_OT_swap";
+ ot->description= "Swap order of selected strips within tracks";
+
+ /* api callbacks */
+ ot->exec= nlaedit_swap_exec;
+ ot->poll= nlaop_poll_tweakmode_off;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
/* ******************** Move Strips Up Operator ************************** */
/* Tries to move the selected strips into the track above if possible. */
diff --git a/source/blender/editors/space_nla/nla_intern.h b/source/blender/editors/space_nla/nla_intern.h
index 5bf81658fdf..b2ff0e107b3 100644
--- a/source/blender/editors/space_nla/nla_intern.h
+++ b/source/blender/editors/space_nla/nla_intern.h
@@ -100,6 +100,7 @@ void NLA_OT_split(wmOperatorType *ot);
void NLA_OT_mute_toggle(wmOperatorType *ot);
+void NLA_OT_swap(wmOperatorType *ot);
void NLA_OT_move_up(wmOperatorType *ot);
void NLA_OT_move_down(wmOperatorType *ot);
diff --git a/source/blender/editors/space_nla/nla_ops.c b/source/blender/editors/space_nla/nla_ops.c
index c5d6cde62c6..6a32f02c8ad 100644
--- a/source/blender/editors/space_nla/nla_ops.c
+++ b/source/blender/editors/space_nla/nla_ops.c
@@ -139,6 +139,7 @@ void nla_operatortypes(void)
WM_operatortype_append(NLA_OT_mute_toggle);
+ WM_operatortype_append(NLA_OT_swap);
WM_operatortype_append(NLA_OT_move_up);
WM_operatortype_append(NLA_OT_move_down);
@@ -225,6 +226,9 @@ static void nla_keymap_main (wmKeyConfig *keyconf, wmKeyMap *keymap)
/* toggles */
WM_keymap_add_item(keymap, "NLA_OT_mute_toggle", HKEY, KM_PRESS, 0, 0);
+ /* swap */
+ WM_keymap_add_item(keymap, "NLA_OT_swap", FKEY, KM_PRESS, KM_ALT, 0);
+
/* move up */
WM_keymap_add_item(keymap, "NLA_OT_move_up", PAGEUPKEY, KM_PRESS, 0, 0);
/* move down */
diff --git a/source/blender/editors/space_nla/nla_select.c b/source/blender/editors/space_nla/nla_select.c
index bb22b78b2d1..032f4984b83 100644
--- a/source/blender/editors/space_nla/nla_select.c
+++ b/source/blender/editors/space_nla/nla_select.c
@@ -581,6 +581,7 @@ void NLA_OT_click_select (wmOperatorType *ot)
/* identifiers */
ot->name= "Mouse Select";
ot->idname= "NLA_OT_click_select";
+ ot->description= "Handle clicks to select NLA Strips";
/* api callbacks - absolutely no exec() this yet... */
ot->invoke= nlaedit_clickselect_invoke;
diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c
index dc2396f0d15..cf5822d0461 100644
--- a/source/blender/editors/space_node/node_edit.c
+++ b/source/blender/editors/space_node/node_edit.c
@@ -194,6 +194,17 @@ void snode_composite_job(const bContext *C, ScrArea *sa)
/* ***************************************** */
+/* operator poll callback */
+static int composite_node_active(bContext *C)
+{
+ if( ED_operator_node_active(C)) {
+ SpaceNode *snode= CTX_wm_space_node(C);
+ if(snode->treetype==NTREE_COMPOSIT)
+ return 1;
+ }
+ return 0;
+}
+
/* also checks for edited groups */
bNode *editnode_get_active(bNodeTree *ntree)
{
@@ -821,7 +832,7 @@ void NODE_OT_backimage_move(wmOperatorType *ot)
/* api callbacks */
ot->invoke= snode_bg_viewmove_invoke;
ot->modal= snode_bg_viewmove_modal;
- ot->poll= ED_operator_node_active;
+ ot->poll= composite_node_active;
/* flags */
ot->flag= OPTYPE_BLOCKING;
@@ -849,7 +860,7 @@ void NODE_OT_backimage_zoom(wmOperatorType *ot)
/* api callbacks */
ot->exec= backimage_zoom;
- ot->poll= ED_operator_node_active;
+ ot->poll= composite_node_active;
/* flags */
ot->flag= OPTYPE_BLOCKING;
@@ -1396,7 +1407,7 @@ void snode_autoconnect(SpaceNode *snode, int allow_multiple, int replace)
ListBase *nodelist = MEM_callocN(sizeof(ListBase), "items_list");
bNodeListItem *nli;
bNode *node;
- int i;
+ int i, numlinks=0;
for(node= snode->edittree->nodes.first; node; node= node->next) {
if(node->flag & NODE_SELECT) {
@@ -1434,11 +1445,15 @@ void snode_autoconnect(SpaceNode *snode, int allow_multiple, int replace)
nodeRemSocketLinks(snode->edittree, sock_to);
nodeAddLink(snode->edittree, node_fr, sock_fr, node_to, sock_to);
NodeTagChanged(snode->edittree, node_to);
+ ++numlinks;
break;
}
}
- ntreeSolveOrder(snode->edittree);
+ if (numlinks > 0) {
+ node_tree_verify_groups(snode->nodetree);
+ ntreeSolveOrder(snode->edittree);
+ }
BLI_freelistN(nodelist);
MEM_freeN(nodelist);
@@ -1898,6 +1913,7 @@ void NODE_OT_links_cut(wmOperatorType *ot)
/* ******************************** */
// XXX some code needing updating to operators...
+
/* goes over all scenes, reads render layers */
static int node_read_renderlayers_exec(bContext *C, wmOperator *UNUSED(op))
{
@@ -1935,7 +1951,7 @@ void NODE_OT_read_renderlayers(wmOperatorType *ot)
ot->exec= node_read_renderlayers_exec;
- ot->poll= ED_operator_node_active;
+ ot->poll= composite_node_active;
/* flags */
ot->flag= 0;
@@ -1966,7 +1982,7 @@ void NODE_OT_read_fullsamplelayers(wmOperatorType *ot)
ot->exec= node_read_fullsamplelayers_exec;
- ot->poll= ED_operator_node_active;
+ ot->poll= composite_node_active;
/* flags */
ot->flag= 0;
@@ -2369,7 +2385,7 @@ void NODE_OT_add_file(wmOperatorType *ot)
/* callbacks */
ot->exec= node_add_file_exec;
ot->invoke= node_add_file_invoke;
- ot->poll= ED_operator_node_active;
+ ot->poll= composite_node_active;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
diff --git a/source/blender/editors/space_node/node_select.c b/source/blender/editors/space_node/node_select.c
index 748ba847f22..b53ac07aab3 100644
--- a/source/blender/editors/space_node/node_select.c
+++ b/source/blender/editors/space_node/node_select.c
@@ -137,6 +137,7 @@ void NODE_OT_select(wmOperatorType *ot)
/* identifiers */
ot->name= "Select";
ot->idname= "NODE_OT_select";
+ ot->description= "Select node under cursor";
/* api callbacks */
ot->invoke= node_select_invoke;
diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c
index fe587bd98d6..dad85626886 100644
--- a/source/blender/editors/space_outliner/outliner.c
+++ b/source/blender/editors/space_outliner/outliner.c
@@ -1409,7 +1409,6 @@ static void outliner_build_tree(Main *mainvar, Scene *scene, SpaceOops *soops)
for(group= mainvar->group.first; group; group= group->id.next) {
if(group->gobject.first) {
te= outliner_add_element(soops, &soops->tree, group, NULL, 0, 0);
- tselem= TREESTORE(te);
for(go= group->gobject.first; go; go= go->next) {
ten= outliner_add_element(soops, &te->subtree, go->ob, te, 0, 0);
@@ -1846,6 +1845,7 @@ void OUTLINER_OT_show_one_level(wmOperatorType *ot)
/* identifiers */
ot->name= "Show/Hide One Level";
ot->idname= "OUTLINER_OT_show_one_level";
+ ot->description= "Expand/collapse all entries by one level";
/* callbacks */
ot->exec= outliner_one_level_exec;
@@ -2022,13 +2022,13 @@ static int tree_element_active_material(bContext *C, Scene *scene, SpaceOops *so
static int tree_element_active_texture(bContext *C, Scene *scene, SpaceOops *soops, TreeElement *te, int set)
{
TreeElement *tep;
- TreeStoreElem *tselem, *tselemp;
+ TreeStoreElem /* *tselem,*/ *tselemp;
Object *ob=OBACT;
SpaceButs *sbuts=NULL;
if(ob==NULL) return 0; // no active object
- tselem= TREESTORE(te);
+ /*tselem= TREESTORE(te);*/ /*UNUSED*/
/* find buttons area (note, this is undefined really still, needs recode in blender) */
/* XXX removed finding sbuts */
@@ -2595,6 +2595,7 @@ void OUTLINER_OT_item_activate(wmOperatorType *ot)
{
ot->name= "Activate Item";
ot->idname= "OUTLINER_OT_item_activate";
+ ot->description= "Handle mouse clicks to activate/select items";
ot->invoke= outliner_item_activate;
@@ -2657,6 +2658,7 @@ void OUTLINER_OT_item_openclose(wmOperatorType *ot)
{
ot->name= "Open/Close Item";
ot->idname= "OUTLINER_OT_item_openclose";
+ ot->description= "Toggle whether item under cursor is enabled or closed";
ot->invoke= outliner_item_openclose;
@@ -2687,9 +2689,11 @@ static int do_outliner_item_rename(bContext *C, ARegion *ar, SpaceOops *soops, T
error("Cannot edit sequence name");
else if(tselem->id->lib) {
// XXX error_libdata();
- } else if(te->idcode == ID_LI && te->parent) {
+ }
+ else if(te->idcode == ID_LI && te->parent) {
error("Cannot edit the path of an indirectly linked library");
- } else {
+ }
+ else {
tselem->flag |= TSE_TEXTBUT;
ED_region_tag_redraw(ar);
}
@@ -2724,6 +2728,7 @@ void OUTLINER_OT_item_rename(wmOperatorType *ot)
{
ot->name= "Rename Item";
ot->idname= "OUTLINER_OT_item_rename";
+ ot->description= "Rename item under cursor";
ot->invoke= outliner_item_rename;
@@ -3778,6 +3783,7 @@ void OUTLINER_OT_operation(wmOperatorType *ot)
{
ot->name= "Execute Operation";
ot->idname= "OUTLINER_OT_operation";
+ ot->description= "Context menu for item operations";
ot->invoke= outliner_operation;
@@ -4052,7 +4058,7 @@ void OUTLINER_OT_drivers_add_selected(wmOperatorType *ot)
ot->poll= ed_operator_outliner_datablocks_active;
/* flags */
- ot->flag = OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
@@ -4087,7 +4093,7 @@ void OUTLINER_OT_drivers_delete_selected(wmOperatorType *ot)
ot->poll= ed_operator_outliner_datablocks_active;
/* flags */
- ot->flag = OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ***************** KEYINGSET OPERATIONS *************** */
@@ -4217,14 +4223,15 @@ void OUTLINER_OT_keyingset_add_selected(wmOperatorType *ot)
{
/* identifiers */
ot->idname= "OUTLINER_OT_keyingset_add_selected";
- ot->name= "Keyingset Add Selected";
+ ot->name= "Keying Set Add Selected";
+ ot->description= "Add selected items (blue-grey rows) to active Keying Set";
/* api callbacks */
ot->exec= outliner_keyingset_additems_exec;
ot->poll= ed_operator_outliner_datablocks_active;
/* flags */
- ot->flag = OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
@@ -4253,14 +4260,15 @@ void OUTLINER_OT_keyingset_remove_selected(wmOperatorType *ot)
{
/* identifiers */
ot->idname= "OUTLINER_OT_keyingset_remove_selected";
- ot->name= "Keyingset Remove Selected";
+ ot->name= "Keying Set Remove Selected";
+ ot->description = "Remove selected items (blue-grey rows) from active Keying Set";
/* api callbacks */
ot->exec= outliner_keyingset_removeitems_exec;
ot->poll= ed_operator_outliner_datablocks_active;
/* flags */
- ot->flag = OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ***************** DRAW *************** */
@@ -4546,7 +4554,6 @@ static void outliner_draw_iconrow(bContext *C, uiBlock *block, Scene *scene, Spa
if(level<1 || (tselem->type==0 && te->idcode==ID_OB)) {
/* active blocks get white circle */
- active= 0;
if(tselem->type==0) {
if(te->idcode==ID_OB) active= (OBACT==(Object *)tselem->id);
else if(scene->obedit && scene->obedit->data==tselem->id) active= 1; // XXX use context?
diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c
index 74c2dd5db1c..0b941e910f8 100644
--- a/source/blender/editors/space_outliner/space_outliner.c
+++ b/source/blender/editors/space_outliner/space_outliner.c
@@ -117,6 +117,7 @@ static void outliner_main_area_listener(ARegion *ar, wmNotifier *wmn)
break;
case ND_BONE_ACTIVE:
case ND_BONE_SELECT:
+ case ND_DRAW:
case ND_PARENT:
case ND_OB_SHADING:
ED_region_tag_redraw(ar);
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 6afe2791ff9..52f4697bad1 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -2014,7 +2014,7 @@ static void view3d_main_area_setup_view(Scene *scene, View3D *v3d, ARegion *ar,
/* calculate pixelsize factor once, is used for lamps and obcenters */
{
/* note: '1.0f / len_v3(v1)' replaced 'len_v3(rv3d->viewmat[0])'
- * because of float point precission problems at large values [#23908] */
+ * because of float point precision problems at large values [#23908] */
float v1[3], v2[3];
float len1, len2;
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 4eeacd6f05f..bbb52826de6 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -699,7 +699,7 @@ static void viewrotate_apply(ViewOpsData *vod, int x, int y)
vod->oldx= x;
vod->oldy= y;
- /* avoid precission loss over time */
+ /* avoid precision loss over time */
normalize_qt(rv3d->viewquat);
ED_region_tag_redraw(vod->ar);
@@ -1364,7 +1364,7 @@ static int view3d_all_exec(bContext *C, wmOperator *op) /* was view3d_home() in
}
for(base= scene->base.first; base; base= base->next) {
- if(base->lay & v3d->lay) {
+ if(BASE_VISIBLE(v3d, base)) {
onedone= 1;
minmax_object(base->object, min, max);
}
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c
index 4bb263d3ed9..f85bdc437f3 100644
--- a/source/blender/editors/space_view3d/view3d_select.c
+++ b/source/blender/editors/space_view3d/view3d_select.c
@@ -218,16 +218,26 @@ void arrows_move_cursor(unsigned short event)
static int view3d_selectable_data(bContext *C)
{
Object *ob = CTX_data_active_object(C);
-
+
if (!ED_operator_region_view3d_active(C))
return 0;
-
- if (!CTX_data_edit_object(C))
- if (ob && ob->mode & OB_MODE_SCULPT)
- return 0;
- if (ob && ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT) && !paint_facesel_test(ob))
- return 0;
-
+
+ if(ob) {
+ if (ob->mode & OB_MODE_EDIT) {
+ if(ob->type == OB_FONT) {
+ return 0;
+ }
+ }
+ else {
+ if (ob->mode & OB_MODE_SCULPT) {
+ return 0;
+ }
+ if (ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT) && !paint_facesel_test(ob)) {
+ return 0;
+ }
+ }
+ }
+
return 1;
}
diff --git a/source/blender/editors/space_view3d/view3d_toolbar.c b/source/blender/editors/space_view3d/view3d_toolbar.c
index 33ba1dbb7f9..3f69ce3e8a8 100644
--- a/source/blender/editors/space_view3d/view3d_toolbar.c
+++ b/source/blender/editors/space_view3d/view3d_toolbar.c
@@ -118,7 +118,8 @@ static void view3d_panel_operator_redo(const bContext *C, Panel *pa)
if(ED_undo_valid(C, op->type->name)==0)
uiLayoutSetEnabled(pa->layout, 0);
- uiBlockSetFunc(block, ED_undo_operator_repeat_cb, op, NULL);
+ /* note, blockfunc is a default but->func, use Handle func to allow button callbacks too */
+ uiBlockSetHandleFunc(block, ED_undo_operator_repeat_cb_evt, op);
view3d_panel_operator_redo_operator(C, pa, op);
}
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c
index 2f7a24d600f..49071af8bdd 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -69,15 +69,21 @@
opengl drawing context */
void view3d_operator_needs_opengl(const bContext *C)
{
+ wmWindow *win = CTX_wm_window(C);
ARegion *ar= CTX_wm_region(C);
+
+ view3d_region_operator_needs_opengl(win, ar);
+}
+void view3d_region_operator_needs_opengl(wmWindow *win, ARegion *ar)
+{
/* for debugging purpose, context should always be OK */
- if(ar->regiontype!=RGN_TYPE_WINDOW)
- printf("view3d_operator_needs_opengl error, wrong region\n");
+ if ((ar == NULL) || (ar->regiontype!=RGN_TYPE_WINDOW))
+ printf("view3d_region_operator_needs_opengl error, wrong region\n");
else {
RegionView3D *rv3d= ar->regiondata;
- wmSubWindowSet(CTX_wm_window(C), ar->swinid);
+ wmSubWindowSet(win, ar->swinid);
glMatrixMode(GL_PROJECTION);
glLoadMatrixf(rv3d->winmat);
glMatrixMode(GL_MODELVIEW);
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index 196b6af84fe..03b03d211d9 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -3821,47 +3821,7 @@ void flushTransGraphData(TransInfo *t)
}
}
-/* *************************** Object Transform data ******************* */
-
-/* Little helper function for ObjectToTransData used to give certain
- * constraints (ChildOf, FollowPath, and others that may be added)
- * inverse corrections for transform, so that they aren't in CrazySpace.
- * These particular constraints benefit from this, but others don't, hence
- * this semi-hack ;-) - Aligorith
- */
-static short constraints_list_needinv(TransInfo *t, ListBase *list)
-{
- bConstraint *con;
-
- /* loop through constraints, checking if there's one of the mentioned
- * constraints needing special crazyspace corrections
- */
- if (list) {
- for (con= list->first; con; con=con->next) {
- /* only consider constraint if it is enabled, and has influence on result */
- if ((con->flag & CONSTRAINT_DISABLE)==0 && (con->enforce!=0.0)) {
- /* (affirmative) returns for specific constraints here... */
- /* constraints that require this regardless */
- if (con->type == CONSTRAINT_TYPE_CHILDOF) return 1;
- if (con->type == CONSTRAINT_TYPE_FOLLOWPATH) return 1;
- if (con->type == CONSTRAINT_TYPE_CLAMPTO) return 1;
-
- /* constraints that require this only under special conditions */
- if (con->type == CONSTRAINT_TYPE_ROTLIKE) {
- /* CopyRot constraint only does this when rotating, and offset is on */
- bRotateLikeConstraint *data = (bRotateLikeConstraint *)con->data;
-
- if ((data->flag & ROTLIKE_OFFSET) && (t->mode == TFM_ROTATION))
- return 1;
- }
- }
- }
- }
-
- /* no appropriate candidates found */
- return 0;
-}
-
+/* ******************* Sequencer Transform data ******************* */
/* This function applies the rules for transforming a strip so duplicate
* checks dont need to be added in multiple places.
@@ -4267,6 +4227,47 @@ static void createTransSeqData(bContext *C, TransInfo *t)
}
+/* *********************** Object Transform data ******************* */
+
+/* Little helper function for ObjectToTransData used to give certain
+ * constraints (ChildOf, FollowPath, and others that may be added)
+ * inverse corrections for transform, so that they aren't in CrazySpace.
+ * These particular constraints benefit from this, but others don't, hence
+ * this semi-hack ;-) - Aligorith
+ */
+static short constraints_list_needinv(TransInfo *t, ListBase *list)
+{
+ bConstraint *con;
+
+ /* loop through constraints, checking if there's one of the mentioned
+ * constraints needing special crazyspace corrections
+ */
+ if (list) {
+ for (con= list->first; con; con=con->next) {
+ /* only consider constraint if it is enabled, and has influence on result */
+ if ((con->flag & CONSTRAINT_DISABLE)==0 && (con->enforce!=0.0)) {
+ /* (affirmative) returns for specific constraints here... */
+ /* constraints that require this regardless */
+ if (con->type == CONSTRAINT_TYPE_CHILDOF) return 1;
+ if (con->type == CONSTRAINT_TYPE_FOLLOWPATH) return 1;
+ if (con->type == CONSTRAINT_TYPE_CLAMPTO) return 1;
+
+ /* constraints that require this only under special conditions */
+ if (con->type == CONSTRAINT_TYPE_ROTLIKE) {
+ /* CopyRot constraint only does this when rotating, and offset is on */
+ bRotateLikeConstraint *data = (bRotateLikeConstraint *)con->data;
+
+ if ((data->flag & ROTLIKE_OFFSET) && (t->mode == TFM_ROTATION))
+ return 1;
+ }
+ }
+ }
+ }
+
+ /* no appropriate candidates found */
+ return 0;
+}
+
/* transcribe given object into TransData for Transforming */
static void ObjectToTransData(TransInfo *t, TransData *td, Object *ob)
{
diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c
index 8a2a52df2c8..0d3e9b94f98 100644
--- a/source/blender/editors/uvedit/uvedit_ops.c
+++ b/source/blender/editors/uvedit/uvedit_ops.c
@@ -880,7 +880,7 @@ static void select_linked(Scene *scene, Image *ima, EditMesh *em, float limit[2]
nverts= efa->v4? 4: 3;
for(i=0; i<nverts; i++) {
- /* make_uv_vert_map_EM sets verts tmp.l to the indicies */
+ /* make_uv_vert_map_EM sets verts tmp.l to the indices */
vlist= EM_get_uv_map_vert(vmap, (*(&efa->v1 + i))->tmp.l);
startv= vlist;
@@ -2452,7 +2452,7 @@ static int snap_uvs_to_adjacent_unselected(Scene *scene, Image *ima, Object *obe
eve->tmp.l=-1;
/* index every vert that has a selected UV using it, but only once so as to
- * get unique indicies and to count how much to malloc */
+ * get unique indices and to count how much to malloc */
for(efa= em->faces.first; efa; efa= efa->next) {
tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
index 6f123200dd3..09069be6d5f 100644
--- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c
+++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
@@ -154,7 +154,7 @@ ParamHandle *construct_param_handle(Scene *scene, EditMesh *em, short implicit,
}
}
- /* we need the vert indicies */
+ /* we need the vert indices */
for(ev= em->verts.first, a=0; ev; ev= ev->next, a++)
ev->tmp.l = a;
diff --git a/source/blender/imbuf/IMB_imbuf_types.h b/source/blender/imbuf/IMB_imbuf_types.h
index f60c6d03547..5629ead80db 100644
--- a/source/blender/imbuf/IMB_imbuf_types.h
+++ b/source/blender/imbuf/IMB_imbuf_types.h
@@ -137,12 +137,7 @@ typedef struct ImBuf {
#define IB_BITMAPFONT (1 << 0) /* this image is a font */
#define IB_BITMAPDIRTY (1 << 1) /* image needs to be saved is not the same as filename */
#define IB_MIPMAP_INVALID (1 << 2) /* image mipmaps are invalid, need recreate */
-
-/* From iff.h. This was once moved away by Frank, now Nzc moves it
- * back. Such is the way it is... It is a long list of defines, and
- * there are a few external defines in the back. Most of the stuff is
- * probably imbuf_intern only. This will need to be merged later
- * on. */
+#define IB_RECT_INVALID (1 << 3) /* float buffer changed, needs recreation of byte rect */
/**
* \name Imbuf Component flags
diff --git a/source/blender/imbuf/intern/allocimbuf.c b/source/blender/imbuf/intern/allocimbuf.c
index 17387c0a4d3..fa823169966 100644
--- a/source/blender/imbuf/intern/allocimbuf.c
+++ b/source/blender/imbuf/intern/allocimbuf.c
@@ -277,7 +277,8 @@ short imb_addrectfloatImBuf(ImBuf *ibuf)
if(ibuf==NULL) return FALSE;
- imb_freerectfloatImBuf(ibuf);
+ if(ibuf->rect_float)
+ imb_freerectfloatImBuf(ibuf); /* frees mipmap too, hrm */
size = ibuf->x *ibuf->y;
size = size *4 *sizeof(float);
diff --git a/source/blender/imbuf/intern/divers.c b/source/blender/imbuf/intern/divers.c
index 9e2c32765d2..9605185e897 100644
--- a/source/blender/imbuf/intern/divers.c
+++ b/source/blender/imbuf/intern/divers.c
@@ -188,6 +188,8 @@ void IMB_rect_from_float(struct ImBuf *ibuf)
}
}
}
+ /* ensure user flag is reset */
+ ibuf->userflags &= ~IB_RECT_INVALID;
}
static void imb_float_from_rect_nonlinear(struct ImBuf *ibuf, float *fbuf)
diff --git a/source/blender/imbuf/intern/jp2.c b/source/blender/imbuf/intern/jp2.c
index 49920219d8c..c0f54898119 100644
--- a/source/blender/imbuf/intern/jp2.c
+++ b/source/blender/imbuf/intern/jp2.c
@@ -95,9 +95,9 @@ struct ImBuf *imb_jp2_decode(unsigned char *mem, size_t size, int flags)
struct ImBuf *ibuf = 0;
int use_float = 0; /* for precision higher then 8 use float */
- long signed_offsets[4] = {0,0,0,0};
- int float_divs[4];
-
+ long signed_offsets[4]= {0, 0, 0, 0};
+ int float_divs[4]= {1, 1, 1, 1};
+
int index;
int w, h, depth;
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index 7b53dd9ef77..d79b63e9c38 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -127,8 +127,9 @@ typedef struct Library {
#define PREVIEW_MIPMAP_LARGE 1
typedef struct PreviewImage {
+ /* All values of 2 are really PREVIEW_MIPMAPS */
unsigned int w[2];
- unsigned int h[2];
+ unsigned int h[2];
short changed[2];
short changed_timestamp[2];
unsigned int * rect[2];
diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h
index b12ffac044b..5261ad65776 100644
--- a/source/blender/makesdna/DNA_action_types.h
+++ b/source/blender/makesdna/DNA_action_types.h
@@ -327,7 +327,9 @@ typedef struct bPose {
ListBase chanbase; /* list of pose channels, PoseBones in RNA */
struct GHash *chanhash; /* ghash for quicker string lookups */
- short flag, proxy_layer; /* proxy layer: copy from armature, gets synced */
+ short flag, pad;
+ unsigned int proxy_layer; /* proxy layer: copy from armature, gets synced */
+ int pad1;
float ctime; /* local action time of this pose */
float stride_offset[3]; /* applied to object */
diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h
index 37c6200b91f..6ddad214af4 100644
--- a/source/blender/makesdna/DNA_brush_types.h
+++ b/source/blender/makesdna/DNA_brush_types.h
@@ -57,9 +57,6 @@ typedef struct Brush {
struct ImBuf *icon_imbuf;
PreviewImage *preview;
char icon_filepath[240];
- int icon_mode; /* store paint mode for which brush's icon was last generated */
- int pad;
-
float normal_weight;
diff --git a/source/blender/makesdna/DNA_ipo_types.h b/source/blender/makesdna/DNA_ipo_types.h
index b7e15808ff0..d0554a7aaa5 100644
--- a/source/blender/makesdna/DNA_ipo_types.h
+++ b/source/blender/makesdna/DNA_ipo_types.h
@@ -421,10 +421,10 @@ typedef struct Ipo {
#define PART_TOTNAM 25
#define PART_EMIT_FREQ 1
-#define PART_EMIT_LIFE 2
+/* #define PART_EMIT_LIFE 2 */ /*UNUSED*/
#define PART_EMIT_VEL 3
#define PART_EMIT_AVE 4
-#define PART_EMIT_SIZE 5
+/* #define PART_EMIT_SIZE 5 */ /*UNUSED*/
#define PART_AVE 6
#define PART_SIZE 7
diff --git a/source/blender/makesdna/DNA_lamp_types.h b/source/blender/makesdna/DNA_lamp_types.h
index 5231108a756..1028d733c65 100644
--- a/source/blender/makesdna/DNA_lamp_types.h
+++ b/source/blender/makesdna/DNA_lamp_types.h
@@ -140,7 +140,7 @@ typedef struct Lamp {
#define LA_SHAD_RAY 8192
/* yafray: lamp shadowbuffer flag, softlight */
/* Since it is used with LOCAL lamp, can't use LA_SHAD */
-#define LA_YF_SOFT 16384
+/* #define LA_YF_SOFT 16384 */ /* no longer used */
#define LA_LAYER_SHADOW 32768
#define LA_SHAD_TEX (1<<16)
#define LA_SHOW_CONE (1<<17)
diff --git a/source/blender/makesdna/DNA_object_force.h b/source/blender/makesdna/DNA_object_force.h
index 89d31586f6b..7656ae6372b 100644
--- a/source/blender/makesdna/DNA_object_force.h
+++ b/source/blender/makesdna/DNA_object_force.h
@@ -339,7 +339,7 @@ typedef struct SoftBody {
/* pd->flag: various settings */
#define PFIELD_USEMAX 1
-#define PDEFLE_DEFORM 2
+/*#define PDEFLE_DEFORM 2*/ /*UNUSED*/
#define PFIELD_GUIDE_PATH_ADD 4 /* TODO: do_versions for below */
#define PFIELD_PLANAR 8 /* used for do_versions */
#define PDEFLE_KILL_PART 16
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h
index d1dcd2dd29c..5ccb3e62f7d 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -320,7 +320,7 @@ extern Object workob;
#define PARSLOW 16
/* (short) transflag */
-#define OB_OFFS_LOCAL 1
+/*#define OB_OFFS_LOCAL 1*/ /*UNUSED*/
/* #define OB_QUAT 2 */ /* never used, free flag */
#define OB_NEG_SCALE 4
#define OB_DUPLI (8+16+256+512+2048)
@@ -328,7 +328,7 @@ extern Object workob;
#define OB_DUPLIVERTS 16
#define OB_DUPLIROT 32
#define OB_DUPLINOSPEED 64
-#define OB_POWERTRACK 128
+/*#define OB_POWERTRACK 128*/ /*UNUSED*/
#define OB_DUPLIGROUP 256
#define OB_DUPLIFACES 512
#define OB_DUPLIFACES_SCALE 1024
@@ -341,9 +341,9 @@ extern Object workob;
#define OB_DRAWKEY 1
#define OB_DRAWKEYSEL 2
#define OB_OFFS_OB 4
-#define OB_OFFS_MAT 8
-#define OB_OFFS_VKEY 16
-#define OB_OFFS_PATH 32
+/* #define OB_OFFS_MAT 8 */ /*UNUSED*/
+/* #define OB_OFFS_VKEY 16 */ /*UNUSED*/
+/* #define OB_OFFS_PATH 32 */ /*UNUSED*/
#define OB_OFFS_PARENT 64
#define OB_OFFS_PARTICLE 128
/* get ipo from from action or not? */
@@ -415,7 +415,7 @@ extern Object workob;
/* NOTE: this was used as a proper setting in past, so nullify before using */
#define BA_TEMP_TAG 32
-#define BA_FROMSET 128
+/* #define BA_FROMSET 128 */ /*UNUSED*/
#define BA_TRANSFORM_CHILD 256 /* child of a transformed object */
#define BA_TRANSFORM_PARENT 8192 /* parent of a transformed object */
diff --git a/source/blender/makesdna/DNA_particle_types.h b/source/blender/makesdna/DNA_particle_types.h
index f140d60d3e9..f009f3a9eb0 100644
--- a/source/blender/makesdna/DNA_particle_types.h
+++ b/source/blender/makesdna/DNA_particle_types.h
@@ -321,7 +321,7 @@ typedef struct ParticleSystem{ /* note, make sure all (runtime) are NULL's in
#define PART_CHILD_EFFECT (1<<27)
#define PART_CHILD_LONG_HAIR (1<<28)
-#define PART_CHILD_RENDER (1<<29)
+/* #define PART_CHILD_RENDER (1<<29) */ /*UNUSED*/
#define PART_CHILD_GUIDE (1<<30)
#define PART_SELF_EFFECT (1<<22)
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index 85a93a87f74..e7302fff6df 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -1176,7 +1176,7 @@ typedef enum SculptFlags {
/* toolsettings->uvcalc_flag */
#define UVCALC_FILLHOLES 1
-#define UVCALC_NO_ASPECT_CORRECT 2 /* would call this UVCALC_ASPECT_CORRECT, except it should be default with old file */
+/*#define UVCALC_NO_ASPECT_CORRECT 2*/ /* would call this UVCALC_ASPECT_CORRECT, except it should be default with old file */
#define UVCALC_TRANSFORM_CORRECT 4 /* adjust UV's while transforming to avoid distortion */
/* toolsettings->uv_flag */
@@ -1234,10 +1234,10 @@ typedef enum SculptFlags {
#define RETOPO 1
#define RETOPO_PAINT 2
-/* toolsettings->retopo_paint_tool */
-#define RETOPO_PEN 1
-#define RETOPO_LINE 2
-#define RETOPO_ELLIPSE 4
+/* toolsettings->retopo_paint_tool */ /*UNUSED*/
+/* #define RETOPO_PEN 1 */
+/* #define RETOPO_LINE 2 */
+/* #define RETOPO_ELLIPSE 4 */
/* toolsettings->skgen_options */
#define SKGEN_FILTER_INTERNAL (1 << 0)
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index 0d388066cf2..8c681dc87b7 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -842,12 +842,6 @@ enum {
#define B_IMASELHOME 451
#define B_IMASELREMOVEBIP 452
-#define C_BACK 0xBAAAAA
-#define C_DARK 0x665656
-#define C_DERK 0x766666
-#define C_HI 0xCBBBBB
-#define C_LO 0x544444
-
/* nla->flag */
/* flags (1<<0), (1<<1), and (1<<3) are depreceated flags from old blenders */
/* draw timing in seconds instead of frames */
diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h
index ab3ca025ed5..d429f55eb6c 100644
--- a/source/blender/makesdna/DNA_view3d_types.h
+++ b/source/blender/makesdna/DNA_view3d_types.h
@@ -204,7 +204,7 @@ typedef struct View3D {
/* View3D->flag (short) */
-#define V3D_DISPIMAGE 1
+/*#define V3D_DISPIMAGE 1*/ /*UNUSED*/
#define V3D_DISPBGPICS 2
#define V3D_HIDE_HELPLINES 4
#define V3D_INVALID_BACKBUF 8
@@ -285,7 +285,7 @@ typedef struct View3D {
/* USE = user setting, DRAW = based on selection */
#define V3D_USE_MANIPULATOR 1
#define V3D_DRAW_MANIPULATOR 2
-#define V3D_CALC_MANIPULATOR 4
+/* #define V3D_CALC_MANIPULATOR 4 */ /*UNUSED*/
/* BGPic->flag */
/* may want to use 1 for select ?*/
diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h
index a29ea4e9152..f47ea06645b 100644
--- a/source/blender/makesdna/DNA_windowmanager_types.h
+++ b/source/blender/makesdna/DNA_windowmanager_types.h
@@ -169,9 +169,10 @@ typedef struct wmWindow {
short monitor; /* multiscreen... no idea how to store yet */
short active; /* set to 1 if an active window, for quick rejects */
short cursor; /* current mouse cursor type */
- short lastcursor; /* for temp waitcursor */
+ short lastcursor; /* previous cursor when setting modal one */
+ short modalcursor; /* the current modal cursor */
short addmousemove; /* internal: tag this for extra mousemove event, makes cursors/buttons active on UI switching */
- short pad2[2];
+ short pad2;
struct wmEvent *eventstate; /* storage for event system */
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c
index 05cb3436ce4..d5d9c4c6cb3 100644
--- a/source/blender/makesrna/intern/makesrna.c
+++ b/source/blender/makesrna/intern/makesrna.c
@@ -948,7 +948,7 @@ static char *rna_def_property_begin_func(FILE *f, StructRNA *srna, PropertyRNA *
static char *rna_def_property_lookup_int_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp, char *manualfunc, char *nextfunc)
{
- /* note on indicies, this is for external functions and ignores skipped values.
+ /* note on indices, this is for external functions and ignores skipped values.
* so the the index can only be checked against the length when there is no 'skip' funcion. */
char *func;
@@ -2296,11 +2296,9 @@ static void rna_generate_struct(BlenderRNA *brna, StructRNA *srna, FILE *f)
prop= srna->cont.properties.last;
if(prop) fprintf(f, "(PropertyRNA*)&rna_%s_%s}},\n", srna->identifier, prop->identifier);
else fprintf(f, "NULL}},\n");
-
- fprintf(f, "\tNULL,NULL,\n"); /* PyType - Cant initialize here */
-
fprintf(f, "\t");
rna_print_c_string(f, srna->identifier);
+ fprintf(f, "\t, NULL,NULL\n"); /* PyType - Cant initialize here */
fprintf(f, ", %d, ", srna->flag);
rna_print_c_string(f, srna->name);
fprintf(f, ", ");
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index 742483663a6..cc2e5fc909f 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -4206,7 +4206,7 @@ void RNA_parameter_list_begin(ParameterList *parms, ParameterIterator *iter)
if(iter->valid) {
iter->size= rna_parameter_size_alloc(iter->parm);
- iter->data= (((char*)iter->parms->data)+iter->offset);
+ iter->data= (((char*)iter->parms->data)); /* +iter->offset, always 0 */
}
}
@@ -4400,7 +4400,7 @@ static int rna_function_format_array_length(const char *format, int ofs, int fle
for (; ofs<flen && format[ofs]!=']' && idx<sizeof(*lenbuf)-1; idx++, ofs++)
lenbuf[idx]= format[ofs];
- if (ofs<flen && format[ofs++]==']') {
+ if (ofs<flen && format[ofs+1]==']') {
/* XXX put better error reporting for ofs>=flen or idx over lenbuf capacity */
lenbuf[idx]= '\0';
return atoi(lenbuf);
diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c
index 2fa93bcecdd..3c71319a322 100644
--- a/source/blender/makesrna/intern/rna_actuator.c
+++ b/source/blender/makesrna/intern/rna_actuator.c
@@ -1591,7 +1591,7 @@ static void rna_def_visibility_actuator(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_visible", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ACT_VISIBILITY_INVISIBLE);
- RNA_def_property_ui_text(prop, "Visible", "Set the objects visible. Initialized from the objects render restriction toggle (access in the outliner)");
+ RNA_def_property_ui_text(prop, "Visible", "Set the objects visible. Initialized from the object render restriction toggle in physics button");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "use_occlusion", PROP_BOOLEAN, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c
index e366b0c61b9..a28017e50f6 100644
--- a/source/blender/makesrna/intern/rna_animation.c
+++ b/source/blender/makesrna/intern/rna_animation.c
@@ -727,23 +727,27 @@ void rna_def_animdata(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_EDITABLE); /* this flag as well as the dynamic test must be defined for this to be editable... */
RNA_def_property_editable_func(prop, "rna_AnimData_action_editable");
RNA_def_property_ui_text(prop, "Action", "Active Action for this datablock");
+ RNA_def_property_update(prop, NC_ANIMATION, NULL); /* this will do? */
/* Active Action Settings */
prop= RNA_def_property(srna, "action_extrapolation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "act_extendmode");
RNA_def_property_enum_items(prop, nla_mode_extend_items);
RNA_def_property_ui_text(prop, "Action Extrapolation", "Action to take for gaps past the Active Action's range (when evaluating with NLA)");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
prop= RNA_def_property(srna, "action_blend_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "act_blendmode");
RNA_def_property_enum_items(prop, nla_mode_blend_items);
RNA_def_property_ui_text(prop, "Action Blending", "Method used for combining Active Action's result with result of NLA stack");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
prop= RNA_def_property(srna, "action_influence", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "act_influence");
RNA_def_property_float_default(prop, 1.0f);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Action Influence", "Amount the Active Action contributes to the result of the NLA stack");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
/* Drivers */
prop= RNA_def_property(srna, "drivers", PROP_COLLECTION, PROP_NONE);
@@ -755,6 +759,7 @@ void rna_def_animdata(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_nla", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ADT_NLA_EVAL_OFF);
RNA_def_property_ui_text(prop, "NLA Evaluation Enabled", "NLA stack is evaluated when evaluating this block");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
}
/* --- */
diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c
index 7656e543440..f76994f31ea 100644
--- a/source/blender/makesrna/intern/rna_curve.c
+++ b/source/blender/makesrna/intern/rna_curve.c
@@ -1118,7 +1118,7 @@ static void rna_def_curve_spline_points(BlenderRNA *brna, PropertyRNA *cprop)
func= RNA_def_function(srna, "add", "rna_Curve_spline_points_add");
RNA_def_function_ui_description(func, "Add a number of points to this spline.");
RNA_def_function_flag(func, FUNC_USE_SELF_ID|FUNC_USE_REPORTS);
- RNA_def_int(func, "number", 1, INT_MIN, INT_MAX, "Number", "Number of points to add to the spline", 0, INT_MAX);
+ RNA_def_int(func, "count", 1, 1, INT_MAX, "Number", "Number of points to add to the spline", 1, INT_MAX);
/*
func= RNA_def_function(srna, "remove", "rna_Curve_spline_remove");
@@ -1145,7 +1145,7 @@ static void rna_def_curve_spline_bezpoints(BlenderRNA *brna, PropertyRNA *cprop)
func= RNA_def_function(srna, "add", "rna_Curve_spline_bezpoints_add");
RNA_def_function_ui_description(func, "Add a number of points to this spline.");
RNA_def_function_flag(func, FUNC_USE_SELF_ID|FUNC_USE_REPORTS);
- RNA_def_int(func, "number", 1, INT_MIN, INT_MAX, "Number", "Number of points to add to the spline", 0, INT_MAX);
+ RNA_def_int(func, "count", 1, INT_MIN, INT_MAX, "Number", "Number of points to add to the spline", 0, INT_MAX);
/*
func= RNA_def_function(srna, "remove", "rna_Curve_spline_remove");
diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c
index b6b0bd3ae84..454ed7cee71 100644
--- a/source/blender/makesrna/intern/rna_define.c
+++ b/source/blender/makesrna/intern/rna_define.c
@@ -839,7 +839,7 @@ void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
{
- StructRNA *srna= DefRNA.laststruct;
+ /*StructRNA *srna= DefRNA.laststruct;*/ /* invalid for python defined props */
ContainerRNA *cont= cont_;
ContainerDefRNA *dcont;
PropertyDefRNA *dprop= NULL;
@@ -849,7 +849,7 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier
char error[512];
if (rna_validate_identifier(identifier, error, 1) == 0) {
- fprintf(stderr, "RNA_def_property: property identifier \"%s.%s\" - %s\n", srna->identifier, identifier, error);
+ fprintf(stderr, "RNA_def_property: property identifier \"%s.%s\" - %s\n", CONTAINER_RNA_ID(cont), identifier, error);
DefRNA.error= 1;
}
@@ -857,7 +857,7 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier
/* XXX - toto, detect supertype collisions */
if(rna_findlink(&dcont->properties, identifier)) {
- fprintf(stderr, "RNA_def_property: duplicate identifier \"%s.%s\"\n", srna->identifier, identifier);
+ fprintf(stderr, "RNA_def_property: duplicate identifier \"%s.%s\"\n", CONTAINER_RNA_ID(cont), identifier);
DefRNA.error= 1;
}
@@ -915,7 +915,7 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier
case PROP_COLLECTION:
break;
default:
- fprintf(stderr, "RNA_def_property: \"%s.%s\", invalid property type.\n", srna->identifier, identifier);
+ fprintf(stderr, "RNA_def_property: \"%s.%s\", invalid property type.\n", CONTAINER_RNA_ID(cont), identifier);
DefRNA.error= 1;
return NULL;
}
diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c
index 5aa1e8e836f..606dee0aa8b 100644
--- a/source/blender/makesrna/intern/rna_fcurve.c
+++ b/source/blender/makesrna/intern/rna_fcurve.c
@@ -546,12 +546,29 @@ static void rna_FModifierStepped_end_frame_range(PointerRNA *ptr, float *min, fl
*max= MAXFRAMEF;
}
-static BezTriple *rna_FKeyframe_points_add(FCurve *fcu, float frame, float value, int flag)
+static BezTriple *rna_FKeyframe_points_insert(FCurve *fcu, float frame, float value, int flag)
{
int index= insert_vert_fcurve(fcu, frame, value, flag);
return ((fcu->bezt) && (index >= 0))? (fcu->bezt + index) : NULL;
}
+static void rna_FKeyframe_points_add(FCurve *fcu, int tot)
+{
+ if(tot > 0) {
+ if(fcu->totvert) {
+ BezTriple *nbezt= MEM_callocN(sizeof(BezTriple) * (fcu->totvert + tot), "rna_FKeyframe_points_add");
+ memcpy(nbezt, fcu->bezt, sizeof(BezTriple) * fcu->totvert);
+ MEM_freeN(fcu->bezt);
+ fcu->bezt= nbezt;
+ }
+ else {
+ fcu->bezt= MEM_callocN(sizeof(BezTriple) * tot, "rna_FKeyframe_points_add");
+ }
+
+ fcu->totvert += tot;
+ }
+}
+
static void rna_FKeyframe_points_remove(FCurve *fcu, ReportList *reports, BezTriple *bezt, int do_fast)
{
int index= (int)(bezt - fcu->bezt);
@@ -1326,7 +1343,7 @@ static void rna_def_fcurve_keyframe_points(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_struct_sdna(srna, "FCurve");
RNA_def_struct_ui_text(srna, "Keyframe Points", "Collection of keyframe points");
- func= RNA_def_function(srna, "add", "rna_FKeyframe_points_add");
+ func= RNA_def_function(srna, "insert", "rna_FKeyframe_points_insert");
RNA_def_function_ui_description(func, "Add a keyframe point to a F-Curve.");
parm= RNA_def_float(func, "frame", 0.0f, -FLT_MAX, FLT_MAX, "", "X Value of this keyframe point", -FLT_MAX, FLT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED);
@@ -1338,6 +1355,9 @@ static void rna_def_fcurve_keyframe_points(BlenderRNA *brna, PropertyRNA *cprop)
parm= RNA_def_pointer(func, "keyframe", "Keyframe", "", "Newly created keyframe");
RNA_def_function_return(func, parm);
+ func= RNA_def_function(srna, "add", "rna_FKeyframe_points_add");
+ RNA_def_function_ui_description(func, "Add a keyframe point to a F-Curve.");
+ RNA_def_int(func, "count", 1, 1, INT_MAX, "Number", "Number of points to add to the spline", 1, INT_MAX);
func= RNA_def_function(srna, "remove", "rna_FKeyframe_points_remove");
RNA_def_function_ui_description(func, "Remove keyframe from an fcurve.");
diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h
index 8f760466513..71d66dffcbe 100644
--- a/source/blender/makesrna/intern/rna_internal.h
+++ b/source/blender/makesrna/intern/rna_internal.h
@@ -327,11 +327,11 @@ typedef struct ArrayIterator {
void *free_ptr; /* will be free'd if set */
int itemsize;
- /* array length with no skip functins applied, take care not to compare against index from animsys or python indicies */
+ /* array length with no skip functins applied, take care not to compare against index from animsys or python indices */
int length;
/* optional skip function, when set the array as viewed by rna can contain only a subset of the members.
- * this changes indicies so quick array index lookups are not possible when skip function is used. */
+ * this changes indices so quick array index lookups are not possible when skip function is used. */
IteratorSkipFunc skip;
} ArrayIterator;
@@ -364,9 +364,9 @@ int rna_parameter_size(struct PropertyRNA *parm);
int rna_parameter_size_alloc(struct PropertyRNA *parm);
// XXX, these should not need to be defined here~!
-struct MTex *rna_mtex_texture_slots_add(struct ID *self, struct ReportList *reports);
-struct MTex *rna_mtex_texture_slots_create(struct ID *self, struct ReportList *reports, int index);
-void rna_mtex_texture_slots_clear(struct ID *self, struct ReportList *reports, int index);
+struct MTex *rna_mtex_texture_slots_add(struct ID *self, struct bContext *C, struct ReportList *reports);
+struct MTex *rna_mtex_texture_slots_create(struct ID *self, struct bContext *C, struct ReportList *reports, int index);
+void rna_mtex_texture_slots_clear(struct ID *self, struct bContext *C, struct ReportList *reports, int index);
#endif /* RNA_INTERNAL_H */
diff --git a/source/blender/makesrna/intern/rna_internal_types.h b/source/blender/makesrna/intern/rna_internal_types.h
index 2bb47643e14..c31c473512a 100644
--- a/source/blender/makesrna/intern/rna_internal_types.h
+++ b/source/blender/makesrna/intern/rna_internal_types.h
@@ -108,7 +108,7 @@ struct FunctionRNA {
/* structs are containers of properties */
ContainerRNA cont;
- /* unique identifier */
+ /* unique identifier, keep after 'cont' */
const char *identifier;
/* various options */
int flag;
@@ -283,13 +283,14 @@ struct StructRNA {
/* structs are containers of properties */
ContainerRNA cont;
+ /* unique identifier, keep after 'cont' */
+ const char *identifier;
+
/* python type, this is a subtype of pyrna_struct_Type but used so each struct can have its own type
* which is useful for subclassing RNA */
void *py_type;
void *blender_type;
- /* unique identifier */
- const char *identifier;
/* various options */
int flag;
@@ -340,4 +341,6 @@ struct BlenderRNA {
ListBase structs;
};
+#define CONTAINER_RNA_ID(cont) (const char *)(((ContainerRNA *)(cont))+1)
+
#endif /* RNA_INTERNAL_TYPES_H */
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c
index 0fdb42f9146..aecb89a0fee 100644
--- a/source/blender/makesrna/intern/rna_material.c
+++ b/source/blender/makesrna/intern/rna_material.c
@@ -276,7 +276,7 @@ static EnumPropertyItem *rna_Material_texture_coordinates_itemf(bContext *C, Poi
return item;
}
-MTex *rna_mtex_texture_slots_add(ID *self_id, ReportList *reports)
+MTex *rna_mtex_texture_slots_add(ID *self_id, struct bContext *C, ReportList *reports)
{
MTex *mtex= add_mtex_id(self_id, -1);
if (mtex == NULL) {
@@ -284,10 +284,13 @@ MTex *rna_mtex_texture_slots_add(ID *self_id, ReportList *reports)
return NULL;
}
+ /* for redraw only */
+ WM_event_add_notifier(C, NC_TEXTURE, CTX_data_scene(C));
+
return mtex;
}
-MTex *rna_mtex_texture_slots_create(ID *self_id, ReportList *reports, int index)
+MTex *rna_mtex_texture_slots_create(ID *self_id, struct bContext *C, ReportList *reports, int index)
{
MTex *mtex;
@@ -298,10 +301,13 @@ MTex *rna_mtex_texture_slots_create(ID *self_id, ReportList *reports, int index)
mtex= add_mtex_id(self_id, index);
+ /* for redraw only */
+ WM_event_add_notifier(C, NC_TEXTURE, CTX_data_scene(C));
+
return mtex;
}
-void rna_mtex_texture_slots_clear(ID *self_id, ReportList *reports, int index)
+void rna_mtex_texture_slots_clear(ID *self_id, struct bContext *C, ReportList *reports, int index)
{
MTex **mtex_ar;
short act;
@@ -323,6 +329,9 @@ void rna_mtex_texture_slots_clear(ID *self_id, ReportList *reports, int index)
MEM_freeN(mtex_ar[index]);
mtex_ar[index]= NULL;
}
+
+ /* for redraw only */
+ WM_event_add_notifier(C, NC_TEXTURE, CTX_data_scene(C));
}
#else
@@ -1841,13 +1850,13 @@ static void rna_def_texture_slots(BlenderRNA *brna, PropertyRNA *cprop, const ch
/* functions */
func= RNA_def_function(srna, "add", "rna_mtex_texture_slots_add");
RNA_def_function_ui_description(func, "Add a number of points to this spline.");
- RNA_def_function_flag(func, FUNC_USE_SELF_ID|FUNC_NO_SELF|FUNC_USE_REPORTS);
+ RNA_def_function_flag(func, FUNC_USE_SELF_ID|FUNC_NO_SELF|FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
parm= RNA_def_pointer(func, "mtex", structname, "", "The newly initialized mtex.");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "create", "rna_mtex_texture_slots_create");
RNA_def_function_ui_description(func, "Add a number of points to this spline.");
- RNA_def_function_flag(func, FUNC_USE_SELF_ID|FUNC_NO_SELF|FUNC_USE_REPORTS);
+ RNA_def_function_flag(func, FUNC_USE_SELF_ID|FUNC_NO_SELF|FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
parm= RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "Slot index to initialize.", 0, INT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_pointer(func, "mtex", structname, "", "The newly initialized mtex.");
@@ -1855,7 +1864,7 @@ static void rna_def_texture_slots(BlenderRNA *brna, PropertyRNA *cprop, const ch
func= RNA_def_function(srna, "clear", "rna_mtex_texture_slots_clear");
RNA_def_function_ui_description(func, "Add a number of points to this spline.");
- RNA_def_function_flag(func, FUNC_USE_SELF_ID|FUNC_NO_SELF|FUNC_USE_REPORTS);
+ RNA_def_function_flag(func, FUNC_USE_SELF_ID|FUNC_NO_SELF|FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
parm= RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "Slot index to clar.", 0, INT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED);
}
diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c
index d0ddc918c3a..f28fec75fe2 100644
--- a/source/blender/makesrna/intern/rna_nla.c
+++ b/source/blender/makesrna/intern/rna_nla.c
@@ -34,6 +34,9 @@
#include "MEM_guardedalloc.h"
+#include "WM_api.h"
+#include "WM_types.h"
+
#ifdef RNA_RUNTIME
#include <stdio.h>
@@ -43,9 +46,6 @@
#include "BKE_animsys.h"
#include "BKE_nla.h"
-#include "WM_api.h"
-#include "WM_types.h"
-
#include "ED_anim_api.h"
/* temp constant defined for these funcs only... */
@@ -360,6 +360,7 @@ static void rna_def_nlastrip(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Name", "");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_NlaStrip_name_set");
RNA_def_struct_name_property(srna, prop);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
/* Enums */
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
@@ -367,16 +368,19 @@ static void rna_def_nlastrip(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX for now, not editable, since this is dangerous
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Type", "Type of NLA Strip");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
prop= RNA_def_property(srna, "extrapolation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "extendmode");
RNA_def_property_enum_items(prop, nla_mode_extend_items);
RNA_def_property_ui_text(prop, "Extrapolation", "Action to take for gaps past the strip extents");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
prop= RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "blendmode");
RNA_def_property_enum_items(prop, nla_mode_blend_items);
RNA_def_property_ui_text(prop, "Blending", "Method used for combining strip's result with accumulated result");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
/* Strip extents */
prop= RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_TIME);
@@ -396,32 +400,38 @@ static void rna_def_nlastrip(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "blendin");
RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_blend_in_set", NULL);
RNA_def_property_ui_text(prop, "Blend In", "Number of frames at start of strip to fade in influence");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
prop= RNA_def_property(srna, "blend_out", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "blendout");
RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_blend_out_set", NULL);
RNA_def_property_ui_text(prop, "Blend Out", "");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
prop= RNA_def_property(srna, "use_auto_blend", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_AUTO_BLENDS);
RNA_def_property_ui_text(prop, "Auto Blend In/Out", "Number of frames for Blending In/Out is automatically determined from overlapping strips");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
/* Action */
prop= RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "act");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Action", "Action referenced by this strip");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
/* Action extents */
prop= RNA_def_property(srna, "action_frame_start", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "actstart");
RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_action_start_frame_set", NULL);
RNA_def_property_ui_text(prop, "Action Start Frame", "");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
prop= RNA_def_property(srna, "action_frame_end", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "actend");
RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_action_end_frame_set", NULL);
RNA_def_property_ui_text(prop, "Action End Frame", "");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
/* Action Reuse */
prop= RNA_def_property(srna, "repeat", PROP_FLOAT, PROP_NONE);
@@ -429,12 +439,14 @@ static void rna_def_nlastrip(BlenderRNA *brna)
RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_repeat_set", NULL);
RNA_def_property_range(prop, 0.1f, 1000.0f); /* these limits have currently be chosen arbitarily, but could be extended (minimum should still be > 0 though) if needed... */
RNA_def_property_ui_text(prop, "Repeat", "Number of times to repeat the action range");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "scale");
RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_scale_set", NULL);
RNA_def_property_range(prop, 0.0001f, 1000.0f); /* these limits can be extended, but beyond this, we can get some crazy+annoying bugs due to numeric errors */
RNA_def_property_ui_text(prop, "Scale", "Scaling factor for action");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
/* Strip's F-Curves */
prop= RNA_def_property(srna, "fcurves", PROP_COLLECTION, PROP_NONE);
@@ -455,21 +467,25 @@ static void rna_def_nlastrip(BlenderRNA *brna)
prop= RNA_def_property(srna, "influence", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Influence", "Amount the strip contributes to the current result");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
prop= RNA_def_property(srna, "strip_time", PROP_FLOAT, PROP_TIME);
RNA_def_property_ui_text(prop, "Strip Time", "Frame of referenced Action to evaluate");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
// TODO: should the animated_influence/time settings be animatable themselves?
prop= RNA_def_property(srna, "use_animated_influence", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_USR_INFLUENCE);
RNA_def_property_boolean_funcs(prop, NULL, "rna_NlaStrip_animated_influence_set");
RNA_def_property_ui_text(prop, "Animated Influence", "Influence setting is controlled by an F-Curve rather than automatically determined");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
prop= RNA_def_property(srna, "use_animated_time", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_USR_TIME);
RNA_def_property_boolean_funcs(prop, NULL, "rna_NlaStrip_animated_time_set");
RNA_def_property_ui_text(prop, "Animated Strip Time", "Strip time is controlled by an F-Curve rather than automatically determined");
-
+ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
+
prop= RNA_def_property(srna, "use_animated_time_cyclic", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_USR_TIME_CYCLIC);
RNA_def_property_ui_text(prop, "Cyclic Strip Time", "Cycle the animated time within the action start & end");
@@ -480,18 +496,22 @@ static void rna_def_nlastrip(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* can be made editable by hooking it up to the necessary NLA API methods */
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_ACTIVE);
RNA_def_property_ui_text(prop, "Active", "NLA Strip is active");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_SELECT);
RNA_def_property_ui_text(prop, "Select", "NLA Strip is selected");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
prop= RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_MUTED);
RNA_def_property_ui_text(prop, "Muted", "NLA Strip is not evaluated");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
prop= RNA_def_property(srna, "use_reverse", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_REVERSE);
RNA_def_property_ui_text(prop, "Reversed", "NLA Strip is played back in reverse order (only when timing is automatically determined)");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
// TODO:
// - sync length
@@ -548,29 +568,35 @@ static void rna_def_nlatrack(BlenderRNA *brna)
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "");
RNA_def_struct_name_property(srna, prop);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
/* settings */
prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* can be made editable by hooking it up to the necessary NLA API methods */
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_ACTIVE);
RNA_def_property_ui_text(prop, "Active", "NLA Track is active");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
prop= RNA_def_property(srna, "is_solo", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* can be made editable by hooking it up to the necessary NLA API methods */
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_SOLO);
RNA_def_property_ui_text(prop, "Solo", "NLA Track is evaluated itself (i.e. active Action and all other NLA Tracks in the same AnimData block are disabled)");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_SELECTED);
RNA_def_property_ui_text(prop, "Select", "NLA Track is selected");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
prop= RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_MUTED);
RNA_def_property_ui_text(prop, "Muted", "NLA Track is not evaluated");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
prop= RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_PROTECTED);
RNA_def_property_ui_text(prop, "Locked", "NLA Track is locked");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
}
/* --------- */
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index 7184fd05dcf..5c962145c55 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -524,13 +524,16 @@ static bNodeLink *rna_NodeTree_link_new(bNodeTree *ntree, ReportList *reports, b
nodeRemSocketLinks(ntree, out);
ret= nodeAddLink(ntree, fromnode, in, tonode, out);
+
+ if(ret) {
+ NodeTagChanged(ntree, tonode);
- NodeTagChanged(ntree, tonode);
-
- ntreeSolveOrder(ntree);
+ nodeVerifyGroup(ntree); /* update group node socket links*/
- WM_main_add_notifier(NC_NODE|NA_EDITED, ntree);
+ ntreeSolveOrder(ntree);
+ WM_main_add_notifier(NC_NODE|NA_EDITED, ntree);
+ }
return ret;
}
diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c
index aa5f69e7164..1fabdb8d21c 100644
--- a/source/blender/makesrna/intern/rna_particle.c
+++ b/source/blender/makesrna/intern/rna_particle.c
@@ -423,6 +423,14 @@ static float rna_PartSetting_linelenhead_get(struct PointerRNA *ptr)
return settings->draw_line[1];
}
+
+static int rna_PartSettings_is_fluid_get(PointerRNA *ptr)
+{
+ ParticleSettings *part= (ParticleSettings*)ptr->data;
+
+ return part->type == PART_FLUID;
+}
+
static PointerRNA rna_ParticleSystem_active_particle_target_get(PointerRNA *ptr)
{
ParticleSystem *psys= (ParticleSystem*)ptr->data;
@@ -1199,6 +1207,12 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Particle Settings", "Particle settings, reusable by multiple particle systems");
RNA_def_struct_ui_icon(srna, ICON_PARTICLE_DATA);
+ /* fluid particle type can't be checked from the type value in rna as it's not shown in the menu */
+ prop= RNA_def_property(srna, "is_fluid", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_boolean_funcs(prop, "rna_PartSettings_is_fluid_get", NULL);
+ RNA_def_property_ui_text(prop, "Fluid", "Particles were created by a fluid simulation");
+
/* flag */
prop= RNA_def_property(srna, "use_react_start_end", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_REACT_STA_END);
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c
index ae13e5c68d9..040c2175d07 100644
--- a/source/blender/makesrna/intern/rna_sculpt_paint.c
+++ b/source/blender/makesrna/intern/rna_sculpt_paint.c
@@ -160,19 +160,23 @@ static int rna_ParticleEdit_hair_get(PointerRNA *ptr)
static int rna_Brush_mode_poll(PointerRNA *ptr, PointerRNA value)
{
Scene *scene= (Scene *)ptr->id.data;
- Object *ob = OBACT;
+ ToolSettings *ts = scene->toolsettings;
Brush *brush= value.id.data;
-
- /* weak, for object painting we need to check against the object mode
- * but for 2D view image painting we always want texture brushes
- * this is not quite correct since you could be in object weightpaint
- * mode at the same time as the 2D image view, but for now its *good enough* */
- if(ob && ob->mode & OB_MODE_ALL_PAINT) {
- return ob->mode & brush->ob_mode;
- }
- else {
- return OB_MODE_TEXTURE_PAINT & brush->ob_mode;
- }
+ int mode = 0;
+
+ /* check the origin of the Paint struct to see which paint
+ mode to select from */
+
+ if(ptr->data == &ts->imapaint)
+ mode = OB_MODE_TEXTURE_PAINT;
+ else if(ptr->data == ts->sculpt)
+ mode = OB_MODE_SCULPT;
+ else if(ptr->data == ts->vpaint)
+ mode = OB_MODE_VERTEX_PAINT;
+ else if(ptr->data == ts->wpaint)
+ mode = OB_MODE_WEIGHT_PAINT;
+
+ return brush->ob_mode & mode;
}
#else
diff --git a/source/blender/makesrna/intern/rna_sensor.c b/source/blender/makesrna/intern/rna_sensor.c
index 47a619f661a..7073923b05e 100644
--- a/source/blender/makesrna/intern/rna_sensor.c
+++ b/source/blender/makesrna/intern/rna_sensor.c
@@ -332,7 +332,7 @@ static void rna_def_near_sensor(BlenderRNA *brna)
prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name");
- RNA_def_property_ui_text(prop, "Property", "Only look for objects with this property");
+ RNA_def_property_ui_text(prop, "Property", "Only look for objects with this property (blank = all objects)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
@@ -343,7 +343,7 @@ static void rna_def_near_sensor(BlenderRNA *brna)
prop= RNA_def_property(srna, "reset_distance", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "resetdist");
- RNA_def_property_ui_text(prop, "Reset Distance", "");
+ RNA_def_property_ui_text(prop, "Reset Distance", "The distance where the sensor forgets the actor");
RNA_def_property_range(prop, 0.0f, 10000.0f);
RNA_def_property_update(prop, NC_LOGIC, NULL);
}
@@ -388,7 +388,7 @@ static void rna_def_touch_sensor(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "Material");
RNA_def_property_pointer_sdna(prop, NULL, "ma");
RNA_def_property_flag(prop, PROP_EDITABLE);
- RNA_def_property_ui_text(prop, "Material", "Only look for objects with this material");
+ RNA_def_property_ui_text(prop, "Material", "Only look for objects with this material (blank = all objects)");
/* note: custom set function is ONLY to avoid rna setting a user for this. */
RNA_def_property_pointer_funcs(prop, NULL, "rna_Sensor_touch_material_set", NULL, NULL);
RNA_def_property_update(prop, NC_LOGIC, NULL);
@@ -502,7 +502,7 @@ static void rna_def_armature_sensor(BlenderRNA *brna)
prop= RNA_def_property(srna, "test_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, prop_type_items);
- RNA_def_property_ui_text(prop, "Test Type", "Type of value and test");
+ RNA_def_property_ui_text(prop, "Test", "Type of value and test");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "bone", PROP_STRING, PROP_NONE);
@@ -583,13 +583,13 @@ static void rna_def_collision_sensor(BlenderRNA *brna)
prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name");
- RNA_def_property_ui_text(prop, "Property", "Only look for Objects with this property");
+ RNA_def_property_ui_text(prop, "Property", "Only look for Objects with this property (blank = all objects)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
//XXX to make a setFunction to create a lookup with all materials in Blend File (not only this object mat.)
prop= RNA_def_property(srna, "material", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "materialName");
- RNA_def_property_ui_text(prop, "Material", "Only look for Objects with this material");
+ RNA_def_property_ui_text(prop, "Material", "Only look for Objects with this material (blank = all objects)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/*//XXX either use a datablock look up to store the string name (material)
@@ -598,7 +598,7 @@ static void rna_def_collision_sensor(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "Material");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_sdna(prop, NULL, "ma");
- RNA_def_property_ui_text(prop, "Material", "Only look for Objects with this material");
+ RNA_def_property_ui_text(prop, "Material", "Only look for Objects with this material (blank = all objects)");
*/
}
@@ -621,7 +621,7 @@ static void rna_def_radar_sensor(BlenderRNA *brna)
prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name");
- RNA_def_property_ui_text(prop, "Property", "Only look for Objects with this property");
+ RNA_def_property_ui_text(prop, "Property", "Only look for Objects with this property (blank = all objects)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE);
@@ -629,7 +629,7 @@ static void rna_def_radar_sensor(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Axis", "Specify along which axis the radar cone is cast");
RNA_def_property_update(prop, NC_LOGIC, NULL);
- prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_range(prop, 0.0, 179.9);
RNA_def_property_ui_text(prop, "Angle", "Opening angle of the radar cone");
RNA_def_property_update(prop, NC_LOGIC, NULL);
@@ -686,12 +686,12 @@ static void rna_def_ray_sensor(BlenderRNA *brna)
prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "propname");
- RNA_def_property_ui_text(prop, "Property", "Only look for Objects with this property");
+ RNA_def_property_ui_text(prop, "Property", "Only look for Objects with this property (blank = all objects)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "material", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "matname");
- RNA_def_property_ui_text(prop, "Material", "Only look for Objects with this material");
+ RNA_def_property_ui_text(prop, "Material", "Only look for Objects with this material (blank = all objects)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* //XXX either use a datablock look up to store the string name (material)
@@ -700,7 +700,7 @@ static void rna_def_ray_sensor(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "Material");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_sdna(prop, NULL, "ma");
- RNA_def_property_ui_text(prop, "Material", "Only look for Objects with this material");
+ RNA_def_property_ui_text(prop, "Material", "Only look for Objects with this material (blank = all objects)");
*/
prop= RNA_def_property(srna, "use_x_ray", PROP_BOOLEAN, PROP_NONE);
diff --git a/source/blender/modifiers/intern/MOD_mask.c b/source/blender/modifiers/intern/MOD_mask.c
index e0a46203905..05a7bbecaea 100644
--- a/source/blender/modifiers/intern/MOD_mask.c
+++ b/source/blender/modifiers/intern/MOD_mask.c
@@ -134,7 +134,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
return derivedData;
/* hashes for finding mapping of:
- * - vgroups to indicies -> vgroupHash (string, int)
+ * - vgroups to indices -> vgroupHash (string, int)
* - bones to vgroup indices -> boneHash (index of vgroup, dummy)
*/
vgroupHash= BLI_ghash_new(BLI_ghashutil_strhash, BLI_ghashutil_strcmp, "mask vgroup gh");
diff --git a/source/blender/modifiers/intern/MOD_screw.c b/source/blender/modifiers/intern/MOD_screw.c
index e1c14faa3e1..689a30dd2d2 100644
--- a/source/blender/modifiers/intern/MOD_screw.c
+++ b/source/blender/modifiers/intern/MOD_screw.c
@@ -266,7 +266,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
step_tot = ((step_tot + 1) * ltmd->iter) - (ltmd->iter - 1);
/* will the screw be closed?
- * Note! smaller then FLT_EPSILON*100 gives problems with float precission so its never closed. */
+ * Note! smaller then FLT_EPSILON*100 gives problems with float precision so its never closed. */
if (fabs(screw_ofs) <= (FLT_EPSILON*100) && fabs(fabs(angle) - (M_PI * 2)) <= (FLT_EPSILON*100)) {
close= 1;
step_tot--;
diff --git a/source/blender/modifiers/intern/MOD_solidify.c b/source/blender/modifiers/intern/MOD_solidify.c
index 013ca7c231f..6485076bde4 100644
--- a/source/blender/modifiers/intern/MOD_solidify.c
+++ b/source/blender/modifiers/intern/MOD_solidify.c
@@ -127,7 +127,7 @@ static void dm_calc_normal(DerivedMesh *dm, float (*temp_nors)[3])
}
for(edge_iter = BLI_edgehashIterator_new(edge_hash); !BLI_edgehashIterator_isDone(edge_iter); BLI_edgehashIterator_step(edge_iter)) {
- /* Get the edge vert indicies, and edge value (the face indicies that use it)*/
+ /* Get the edge vert indices, and edge value (the face indices that use it)*/
BLI_edgehashIterator_getKey(edge_iter, (int*)&ed_v1, (int*)&ed_v2);
edge_ref = BLI_edgehashIterator_getValue(edge_iter);
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_brightness.c b/source/blender/nodes/intern/CMP_nodes/CMP_brightness.c
index 889d61fe4fa..6b0d6ff45a0 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_brightness.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_brightness.c
@@ -44,15 +44,14 @@ static bNodeSocketType cmp_node_brightcontrast_out[]= {
{ -1, 0, "" }
};
-static void do_brightnesscontrast(bNode *node, float *out, float *in)
+static void do_brightnesscontrast(bNode *UNUSED(node), float *out, float *in, float *in_brightness, float *in_contrast)
{
float i;
int c;
- float a, b, contrast, brightness, delta, v;
- contrast = node->custom2;
- brightness = (float)(node->custom1);
- brightness = (brightness) / 100.0f;
- delta = contrast / 200.0f;
+ float a, b, v;
+ float brightness = (*in_brightness) / 100.0f;
+ float contrast = *in_contrast;
+ float delta = contrast / 200.0f;
a = 1.0f - delta * 2.0f;
/*
* The algorithm is by Werner D. Streidt
@@ -84,10 +83,8 @@ static void node_composit_exec_brightcontrast(void *UNUSED(data), bNode *node, b
if(in[0]->data) {
CompBuf *stackbuf, *cbuf= typecheck_compbuf(in[0]->data, CB_RGBA);
- node->custom1 = in[1]->vec[0];
- node->custom2 = in[2]->vec[0];
stackbuf= dupalloc_compbuf(cbuf);
- composit1_pixel_processor(node, stackbuf, cbuf, in[0]->vec, do_brightnesscontrast, CB_RGBA);
+ composit3_pixel_processor(node, stackbuf, in[0]->data, in[0]->vec, in[1]->data, in[1]->vec, in[2]->data, in[2]->vec, do_brightnesscontrast, CB_RGBA, CB_VAL, CB_VAL);
out[0]->data = stackbuf;
if(cbuf != in[0]->data)
free_compbuf(cbuf);
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_texture.c b/source/blender/nodes/intern/CMP_nodes/CMP_texture.c
index d344e9bf959..b2510917ba1 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_texture.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_texture.c
@@ -118,7 +118,7 @@ static void node_composit_exec_texture(void *data, bNode *node, bNodeStack **in,
VECCOPY(stackbuf->procedural_offset, in[0]->vec);
VECCOPY(stackbuf->procedural_size, in[1]->vec);
stackbuf->procedural_type= CB_VAL;
- composit1_pixel_processor(node, prevbuf, prevbuf, out[0]->vec, do_copy_value, CB_VAL);
+ composit1_pixel_processor(node, stackbuf, stackbuf, out[0]->vec, do_copy_value, CB_VAL);
stackbuf->rect_procedural= NULL;
out[0]->data= stackbuf;
@@ -131,7 +131,7 @@ static void node_composit_exec_texture(void *data, bNode *node, bNodeStack **in,
VECCOPY(stackbuf->procedural_offset, in[0]->vec);
VECCOPY(stackbuf->procedural_size, in[1]->vec);
stackbuf->procedural_type= CB_RGBA;
- composit1_pixel_processor(node, prevbuf, prevbuf, out[0]->vec, do_copy_rgba, CB_RGBA);
+ composit1_pixel_processor(node, stackbuf, stackbuf, out[0]->vec, do_copy_rgba, CB_RGBA);
stackbuf->rect_procedural= NULL;
out[1]->data= stackbuf;
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_image.c b/source/blender/nodes/intern/TEX_nodes/TEX_image.c
index c764c7a22d2..7c680b4c25a 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_image.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_image.c
@@ -58,7 +58,13 @@ static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **UNUSED(i
py = (int)( (y-yoff) * ysize );
if( (!xsize) || (!ysize) ) return;
- if( !ibuf->rect_float ) IMB_float_from_rect(ibuf);
+
+ if( !ibuf->rect_float ) {
+ BLI_lock_thread(LOCK_IMAGE);
+ if( !ibuf->rect_float )
+ IMB_float_from_rect(ibuf);
+ BLI_unlock_thread(LOCK_IMAGE);
+ }
while( px < 0 ) px += ibuf->x;
while( py < 0 ) py += ibuf->y;
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_output.c b/source/blender/nodes/intern/TEX_nodes/TEX_output.c
index 26733a94180..1be2e8f1c56 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_output.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_output.c
@@ -45,7 +45,7 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **UNUSED(o
TexParams params;
params_from_cdata(&params, cdata);
- if(in[1]->hasinput && !in[0]->hasinput)
+ if(in[1] && in[1]->hasinput && !in[0]->hasinput)
tex_input_rgba(&target->tr, in[1], &params, cdata->thread);
else
tex_input_rgba(&target->tr, in[0], &params, cdata->thread);
@@ -63,7 +63,7 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **UNUSED(o
target->talpha = 1.0f;
if(target->nor) {
- if(in[1]->hasinput)
+ if(in[1] && in[1]->hasinput)
tex_input_vec(target->nor, in[1], &params, cdata->thread);
else
target->nor = 0;
diff --git a/source/blender/nodes/intern/TEX_util.c b/source/blender/nodes/intern/TEX_util.c
index 38f2cd1a306..d288b13a66c 100644
--- a/source/blender/nodes/intern/TEX_util.c
+++ b/source/blender/nodes/intern/TEX_util.c
@@ -181,6 +181,7 @@ int ntreeTexExecTree(
MTex *mtex
){
TexCallData data;
+ float *nor= texres->nor;
int retval = TEX_INT;
data.co = co;
@@ -199,6 +200,9 @@ int ntreeTexExecTree(
if(texres->nor) retval |= TEX_NOR;
retval |= TEX_RGB;
+ /* confusing stuff; the texture output node sets this to NULL to indicate no normal socket was set
+ however, the texture code checks this for other reasons (namely, a normal is required for material) */
+ texres->nor= nor;
return retval;
}
diff --git a/source/blender/python/generic/bgl.c b/source/blender/python/generic/bgl.c
index 3d525b08ecc..474259fe0e3 100644
--- a/source/blender/python/generic/bgl.c
+++ b/source/blender/python/generic/bgl.c
@@ -187,43 +187,60 @@ Buffer *BGL_MakeBuffer(int type, int ndimensions, int *dimensions, void *initbuf
#define MAX_DIMENSIONS 256
static PyObject *Method_Buffer (PyObject *UNUSED(self), PyObject *args)
{
- PyObject *length_ob= NULL, *template= NULL;
+ PyObject *length_ob= NULL, *init= NULL;
Buffer *buffer;
int dimensions[MAX_DIMENSIONS];
int i, type;
int ndimensions = 0;
- if (!PyArg_ParseTuple(args, "iO|O", &type, &length_ob, &template)) {
+ if (!PyArg_ParseTuple(args, "iO|O", &type, &length_ob, &init)) {
PyErr_SetString(PyExc_AttributeError, "expected an int and one or two PyObjects");
return NULL;
}
- if (type!=GL_BYTE && type!=GL_SHORT && type!=GL_INT && type!=GL_FLOAT && type!=GL_DOUBLE) {
+ if (!ELEM5(type, GL_BYTE, GL_SHORT, GL_INT, GL_FLOAT, GL_DOUBLE)) {
PyErr_SetString(PyExc_AttributeError, "invalid first argument type, should be one of GL_BYTE, GL_SHORT, GL_INT, GL_FLOAT or GL_DOUBLE");
return NULL;
}
- if (PyNumber_Check(length_ob)) {
+ if (PyLong_Check(length_ob)) {
ndimensions= 1;
- dimensions[0]= PyLong_AsLong(length_ob);
- } else if (PySequence_Check(length_ob)) {
+ if(((dimensions[0]= PyLong_AsLong(length_ob)) < 1)) {
+ PyErr_SetString(PyExc_AttributeError, "dimensions must be between 1 and "STRINGIFY(MAX_DIMENSIONS));
+ return NULL;
+ }
+ }
+ else if (PySequence_Check(length_ob)) {
ndimensions= PySequence_Size(length_ob);
if (ndimensions > MAX_DIMENSIONS) {
- PyErr_SetString(PyExc_AttributeError, "too many dimensions, max is 256");
+ PyErr_SetString(PyExc_AttributeError, "too many dimensions, max is "STRINGIFY(MAX_DIMENSIONS));
+ return NULL;
+ }
+ else if (ndimensions < 1) {
+ PyErr_SetString(PyExc_AttributeError, "sequence must have at least one dimension");
return NULL;
}
for (i=0; i<ndimensions; i++) {
PyObject *ob= PySequence_GetItem(length_ob, i);
- if (!PyNumber_Check(ob)) dimensions[i]= 1;
+ if (!PyLong_Check(ob)) dimensions[i]= 1;
else dimensions[i]= PyLong_AsLong(ob);
Py_DECREF(ob);
+
+ if(dimensions[i] < 1) {
+ PyErr_SetString(PyExc_AttributeError, "dimensions must be between 1 and "STRINGIFY(MAX_DIMENSIONS));
+ return NULL;
+ }
}
}
+ else {
+ PyErr_Format(PyExc_TypeError, "invalid second argument argument expected a sequence or an int, not a %.200s", Py_TYPE(length_ob)->tp_name);
+ return NULL;
+ }
buffer= BGL_MakeBuffer(type, ndimensions, dimensions, NULL);
- if (template && ndimensions) {
- if (Buffer_ass_slice((PyObject *) buffer, 0, dimensions[0], template)) {
+ if (init && ndimensions) {
+ if (Buffer_ass_slice((PyObject *) buffer, 0, dimensions[0], init)) {
Py_DECREF(buffer);
return NULL;
}
diff --git a/source/blender/python/generic/mathutils.c b/source/blender/python/generic/mathutils.c
index f0eca793028..5b75552ca8d 100644
--- a/source/blender/python/generic/mathutils.c
+++ b/source/blender/python/generic/mathutils.c
@@ -40,6 +40,7 @@
* - Matrix.scalePart --> Matrix.scale_part
* - Matrix.translationPart --> Matrix.translation_part
* - Matrix.rotationPart --> Matrix.rotation_part
+ * - mathutils.Matrix.Shear(plane, fac, size), now takes a pair of floats for 3x3 or 4x4 shear factor.
* - toMatrix --> to_matrix
* - toEuler --> to_euler
* - toQuat --> to_quat
@@ -81,8 +82,7 @@
static char M_Mathutils_doc[] =
"This module provides access to matrices, eulers, quaternions and vectors.";
-/* helper functionm returns length of the 'value', -1 on error */
-int mathutils_array_parse(float *array, int array_min, int array_max, PyObject *value, const char *error_prefix)
+static int mathutils_array_parse_fast(float *array, int array_min, int array_max, PyObject *value, const char *error_prefix)
{
PyObject *value_fast= NULL;
@@ -117,6 +117,37 @@ int mathutils_array_parse(float *array, int array_min, int array_max, PyObject *
return size;
}
+/* helper functionm returns length of the 'value', -1 on error */
+int mathutils_array_parse(float *array, int array_min, int array_max, PyObject *value, const char *error_prefix)
+{
+#if 1 /* approx 6x speedup for mathutils types */
+ int size;
+
+ if( (VectorObject_Check(value) && (size= ((VectorObject *)value)->size)) ||
+ (EulerObject_Check(value) && (size= 3)) ||
+ (QuaternionObject_Check(value) && (size= 4)) ||
+ (ColorObject_Check(value) && (size= 3))
+ ) {
+ if(!BaseMath_ReadCallback((BaseMathObject *)value)) {
+ return -1;
+ }
+
+ if(size > array_max || size < array_min) {
+ if (array_max == array_min) PyErr_Format(PyExc_ValueError, "%.200s: sequence size is %d, expected %d", error_prefix, size, array_max);
+ else PyErr_Format(PyExc_ValueError, "%.200s: sequence size is %d, expected [%d - %d]", error_prefix, size, array_min, array_max);
+ return -1;
+ }
+
+ memcpy(array, ((BaseMathObject *)value)->data, size * sizeof(float));
+ return size;
+ }
+ else
+#endif
+ {
+ return mathutils_array_parse_fast(array, array_min, array_max, value, error_prefix);
+ }
+}
+
//----------------------------------MATRIX FUNCTIONS--------------------
diff --git a/source/blender/python/generic/mathutils_color.c b/source/blender/python/generic/mathutils_color.c
index bc82e11915e..b8dd059fe3c 100644
--- a/source/blender/python/generic/mathutils_color.c
+++ b/source/blender/python/generic/mathutils_color.c
@@ -276,7 +276,7 @@ static PyObject *Color_subscript(ColorObject *self, PyObject *item)
} else if (PySlice_Check(item)) {
Py_ssize_t start, stop, step, slicelength;
- if (PySlice_GetIndicesEx((PySliceObject*)item, COLOR_SIZE, &start, &stop, &step, &slicelength) < 0)
+ if (PySlice_GetIndicesEx((void *)item, COLOR_SIZE, &start, &stop, &step, &slicelength) < 0)
return NULL;
if (slicelength <= 0) {
@@ -309,7 +309,7 @@ static int Color_ass_subscript(ColorObject *self, PyObject *item, PyObject *valu
else if (PySlice_Check(item)) {
Py_ssize_t start, stop, step, slicelength;
- if (PySlice_GetIndicesEx((PySliceObject*)item, COLOR_SIZE, &start, &stop, &step, &slicelength) < 0)
+ if (PySlice_GetIndicesEx((void *)item, COLOR_SIZE, &start, &stop, &step, &slicelength) < 0)
return -1;
if (step == 1)
diff --git a/source/blender/python/generic/mathutils_euler.c b/source/blender/python/generic/mathutils_euler.c
index 5f1a6f44d84..034a51fb814 100644
--- a/source/blender/python/generic/mathutils_euler.c
+++ b/source/blender/python/generic/mathutils_euler.c
@@ -447,7 +447,7 @@ static PyObject *Euler_subscript(EulerObject *self, PyObject *item)
} else if (PySlice_Check(item)) {
Py_ssize_t start, stop, step, slicelength;
- if (PySlice_GetIndicesEx((PySliceObject*)item, EULER_SIZE, &start, &stop, &step, &slicelength) < 0)
+ if (PySlice_GetIndicesEx((void *)item, EULER_SIZE, &start, &stop, &step, &slicelength) < 0)
return NULL;
if (slicelength <= 0) {
@@ -481,7 +481,7 @@ static int Euler_ass_subscript(EulerObject *self, PyObject *item, PyObject *valu
else if (PySlice_Check(item)) {
Py_ssize_t start, stop, step, slicelength;
- if (PySlice_GetIndicesEx((PySliceObject*)item, EULER_SIZE, &start, &stop, &step, &slicelength) < 0)
+ if (PySlice_GetIndicesEx((void *)item, EULER_SIZE, &start, &stop, &step, &slicelength) < 0)
return -1;
if (step == 1)
diff --git a/source/blender/python/generic/mathutils_geometry.c b/source/blender/python/generic/mathutils_geometry.c
index 9280dc4093c..4a1993b00ef 100644
--- a/source/blender/python/generic/mathutils_geometry.c
+++ b/source/blender/python/generic/mathutils_geometry.c
@@ -332,7 +332,7 @@ static PyObject *M_Geometry_area_tri(PyObject *UNUSED(self), PyObject* args)
static char M_Geometry_tesselate_polygon_doc[] =
".. function:: tesselate_polygon(veclist_list)\n"
"\n"
-" Takes a list of polylines (each point a vector) and returns the point indicies for a polyline filled with triangles.\n"
+" Takes a list of polylines (each point a vector) and returns the point indices for a polyline filled with triangles.\n"
"\n"
" :arg veclist_list: list of polylines\n"
" :rtype: list\n"
diff --git a/source/blender/python/generic/mathutils_matrix.c b/source/blender/python/generic/mathutils_matrix.c
index c36341269db..22ee59f20a0 100644
--- a/source/blender/python/generic/mathutils_matrix.c
+++ b/source/blender/python/generic/mathutils_matrix.c
@@ -170,7 +170,7 @@ static PyObject *C_Matrix_Rotation(PyObject *cls, PyObject *args)
VectorObject *vec= NULL;
char *axis= NULL;
int matSize;
- double angle; /* use double because of precission problems at high values */
+ double angle; /* use double because of precision problems at high values */
float mat[16] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f,
0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f};
@@ -330,8 +330,7 @@ static PyObject *C_Matrix_Scale(PyObject *cls, PyObject *args)
float mat[16] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f,
0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f};
- if(!PyArg_ParseTuple(args, "fi|O!", &factor, &matSize, &vector_Type, &vec)) {
- PyErr_SetString(PyExc_TypeError, "mathutils.Matrix.Scale(): expected float int and optional vector");
+ if(!PyArg_ParseTuple(args, "fi|O!:Matrix.Scale", &factor, &matSize, &vector_Type, &vec)) {
return NULL;
}
if(matSize != 2 && matSize != 3 && matSize != 4) {
@@ -421,8 +420,7 @@ static PyObject *C_Matrix_OrthoProjection(PyObject *cls, PyObject *args)
float mat[16] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f,
0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f};
- if(!PyArg_ParseTuple(args, "si|O!", &plane, &matSize, &vector_Type, &vec)) {
- PyErr_SetString(PyExc_TypeError, "mathutils.Matrix.OrthoProjection(): expected string and int and optional vector");
+ if(!PyArg_ParseTuple(args, "si|O!:Matrix.OrthoProjection", &plane, &matSize, &vector_Type, &vec)) {
return NULL;
}
if(matSize != 2 && matSize != 3 && matSize != 4) {
@@ -506,25 +504,24 @@ static char C_Matrix_Shear_doc[] =
"\n"
" Create a matrix to represent an shear transformation.\n"
"\n"
-" :arg plane: Can be any of the following: ['X', 'Y', 'XY', 'XZ', 'YZ'], where a single axis is for a 2D matrix.\n"
+" :arg plane: Can be any of the following: ['X', 'Y', 'XY', 'XZ', 'YZ'], where a single axis is for a 2D matrix only.\n"
" :type plane: string\n"
-" :arg factor: The factor of shear to apply.\n"
-" :type factor: float\n"
+" :arg factor: The factor of shear to apply. For a 3 or 4 *size* matrix pass a pair of floats corrasponding with the *plane* axis.\n"
+" :type factor: float or float pair\n"
" :arg size: The size of the shear matrix to construct [2, 4].\n"
" :type size: int\n"
" :return: A new shear matrix.\n"
-" :rtype: :class:`Matrix`\n";
-
+" :rtype: :class:`Matrix`\n"
+;
static PyObject *C_Matrix_Shear(PyObject *cls, PyObject *args)
{
int matSize;
char *plane;
- float factor;
+ PyObject *fac;
float mat[16] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f,
0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f};
- if(!PyArg_ParseTuple(args, "sfi", &plane, &factor, &matSize)) {
- PyErr_SetString(PyExc_TypeError,"mathutils.Matrix.Shear(): expected string float and int");
+ if(!PyArg_ParseTuple(args, "sOi:Matrix.Shear", &plane, &fac, &matSize)) {
return NULL;
}
if(matSize != 2 && matSize != 3 && matSize != 4) {
@@ -532,36 +529,60 @@ static PyObject *C_Matrix_Shear(PyObject *cls, PyObject *args)
return NULL;
}
- if((strcmp(plane, "X") == 0)
- && matSize == 2) {
- mat[0] = 1.0f;
- mat[2] = factor;
- mat[3] = 1.0f;
- } else if((strcmp(plane, "Y") == 0) && matSize == 2) {
+ if(matSize == 2) {
+ float const factor= PyFloat_AsDouble(fac);
+
+ if(factor==-1.0 && PyErr_Occurred()) {
+ PyErr_SetString(PyExc_AttributeError, "mathutils.Matrix.Shear(): the factor to be a float");
+ return NULL;
+ }
+
+ /* unit */
mat[0] = 1.0f;
- mat[1] = factor;
mat[3] = 1.0f;
- } else if((strcmp(plane, "XY") == 0) && matSize > 2) {
- mat[0] = 1.0f;
- mat[4] = 1.0f;
- mat[6] = factor;
- mat[7] = factor;
- } else if((strcmp(plane, "XZ") == 0) && matSize > 2) {
- mat[0] = 1.0f;
- mat[3] = factor;
- mat[4] = 1.0f;
- mat[5] = factor;
- mat[8] = 1.0f;
- } else if((strcmp(plane, "YZ") == 0) && matSize > 2) {
+
+ if(strcmp(plane, "X") == 0) {
+ mat[2] = factor;
+ }
+ else if(strcmp(plane, "Y") == 0) {
+ mat[1] = factor;
+ }
+ else {
+ PyErr_SetString(PyExc_AttributeError, "Matrix.Shear(): expected: X, Y or wrong matrix size for shearing plane");
+ return NULL;
+ }
+ }
+ else {
+ /* 3 or 4, apply as 3x3, resize later if needed */
+ float factor[2];
+
+ if(mathutils_array_parse(factor, 2, 2, fac, "Matrix.Shear()") < 0) {
+ return NULL;
+ }
+
+ /* unit */
mat[0] = 1.0f;
- mat[1] = factor;
- mat[2] = factor;
mat[4] = 1.0f;
mat[8] = 1.0f;
- } else {
- PyErr_SetString(PyExc_AttributeError, "mathutils.Matrix.Shear(): expected: x, y, xy, xz, yz or wrong matrix size for shearing plane");
- return NULL;
+
+ if(strcmp(plane, "XY") == 0) {
+ mat[6] = factor[0];
+ mat[7] = factor[1];
+ }
+ else if(strcmp(plane, "XZ") == 0) {
+ mat[3] = factor[0];
+ mat[5] = factor[1];
+ }
+ else if(strcmp(plane, "YZ") == 0) {
+ mat[1] = factor[0];
+ mat[2] = factor[1];
+ }
+ else {
+ PyErr_SetString(PyExc_AttributeError, "mathutils.Matrix.Shear(): expected: X, Y, XY, XZ, YZ");
+ return NULL;
+ }
}
+
if(matSize == 4) {
//resize matrix
mat[10] = mat[8];
@@ -1556,7 +1577,7 @@ static PyObject *Matrix_subscript(MatrixObject* self, PyObject* item)
} else if (PySlice_Check(item)) {
Py_ssize_t start, stop, step, slicelength;
- if (PySlice_GetIndicesEx((PySliceObject*)item, self->rowSize, &start, &stop, &step, &slicelength) < 0)
+ if (PySlice_GetIndicesEx((void *)item, self->rowSize, &start, &stop, &step, &slicelength) < 0)
return NULL;
if (slicelength <= 0) {
@@ -1589,7 +1610,7 @@ static int Matrix_ass_subscript(MatrixObject* self, PyObject* item, PyObject* va
else if (PySlice_Check(item)) {
Py_ssize_t start, stop, step, slicelength;
- if (PySlice_GetIndicesEx((PySliceObject*)item, self->rowSize, &start, &stop, &step, &slicelength) < 0)
+ if (PySlice_GetIndicesEx((void *)item, self->rowSize, &start, &stop, &step, &slicelength) < 0)
return -1;
if (step == 1)
diff --git a/source/blender/python/generic/mathutils_quat.c b/source/blender/python/generic/mathutils_quat.c
index 9d79a86dbcc..7507318dfcb 100644
--- a/source/blender/python/generic/mathutils_quat.c
+++ b/source/blender/python/generic/mathutils_quat.c
@@ -545,7 +545,7 @@ static PyObject *Quaternion_subscript(QuaternionObject *self, PyObject *item)
} else if (PySlice_Check(item)) {
Py_ssize_t start, stop, step, slicelength;
- if (PySlice_GetIndicesEx((PySliceObject*)item, QUAT_SIZE, &start, &stop, &step, &slicelength) < 0)
+ if (PySlice_GetIndicesEx((void *)item, QUAT_SIZE, &start, &stop, &step, &slicelength) < 0)
return NULL;
if (slicelength <= 0) {
@@ -579,7 +579,7 @@ static int Quaternion_ass_subscript(QuaternionObject *self, PyObject *item, PyOb
else if (PySlice_Check(item)) {
Py_ssize_t start, stop, step, slicelength;
- if (PySlice_GetIndicesEx((PySliceObject*)item, QUAT_SIZE, &start, &stop, &step, &slicelength) < 0)
+ if (PySlice_GetIndicesEx((void *)item, QUAT_SIZE, &start, &stop, &step, &slicelength) < 0)
return -1;
if (step == 1)
@@ -901,7 +901,7 @@ static PyObject *Quaternion_new(PyTypeObject *type, PyObject *args, PyObject *kw
case 2:
if (mathutils_array_parse(quat, 3, 3, seq, "mathutils.Quaternion()") == -1)
return NULL;
- angle= fmod(angle + M_PI*2, M_PI*4) - M_PI*2; /* clamp because of precission issues */
+ angle= fmod(angle + M_PI*2, M_PI*4) - M_PI*2; /* clamp because of precision issues */
axis_angle_to_quat(quat, quat, angle);
break;
/* PyArg_ParseTuple assures no more then 2 */
diff --git a/source/blender/python/generic/mathutils_vector.c b/source/blender/python/generic/mathutils_vector.c
index b5ac197abee..a3bf1471813 100644
--- a/source/blender/python/generic/mathutils_vector.c
+++ b/source/blender/python/generic/mathutils_vector.c
@@ -1369,7 +1369,7 @@ static PyObject *Vector_subscript(VectorObject* self, PyObject* item)
} else if (PySlice_Check(item)) {
Py_ssize_t start, stop, step, slicelength;
- if (PySlice_GetIndicesEx((PySliceObject*)item, self->size, &start, &stop, &step, &slicelength) < 0)
+ if (PySlice_GetIndicesEx((void *)item, self->size, &start, &stop, &step, &slicelength) < 0)
return NULL;
if (slicelength <= 0) {
@@ -1402,7 +1402,7 @@ static int Vector_ass_subscript(VectorObject* self, PyObject* item, PyObject* va
else if (PySlice_Check(item)) {
Py_ssize_t start, stop, step, slicelength;
- if (PySlice_GetIndicesEx((PySliceObject*)item, self->size, &start, &stop, &step, &slicelength) < 0)
+ if (PySlice_GetIndicesEx((void *)item, self->size, &start, &stop, &step, &slicelength) < 0)
return -1;
if (step == 1)
diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c
index c50c37d0261..be5c9a8f1e0 100644
--- a/source/blender/python/intern/bpy.c
+++ b/source/blender/python/intern/bpy.c
@@ -98,7 +98,7 @@ static PyObject *bpy_blend_paths(PyObject *UNUSED(self), PyObject *args, PyObjec
list= PyList_New(0);
- for(BLI_bpathIterator_init(&bpi, G.main, NULL); !BLI_bpathIterator_isDone(bpi); BLI_bpathIterator_step(bpi)) {
+ for(BLI_bpathIterator_init(&bpi, G.main, NULL, 0); !BLI_bpathIterator_isDone(bpi); BLI_bpathIterator_step(bpi)) {
/* build the list */
if (absolute) {
BLI_bpathIterator_getPathExpanded(bpi, filepath_expanded);
diff --git a/source/blender/python/intern/bpy_driver.c b/source/blender/python/intern/bpy_driver.c
index 59f762a0658..161b56d39aa 100644
--- a/source/blender/python/intern/bpy_driver.c
+++ b/source/blender/python/intern/bpy_driver.c
@@ -225,7 +225,7 @@ float BPY_driver_exec(ChannelDriver *driver)
#else
/* evaluate the compiled expression */
if (expr_code)
- retval= PyEval_EvalCode((PyCodeObject *)expr_code, bpy_pydriver_Dict, driver_vars);
+ retval= PyEval_EvalCode((void *)expr_code, bpy_pydriver_Dict, driver_vars);
#endif
/* decref the driver vars first... */
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c
index f2ba9f604be..38efb4523c4 100644
--- a/source/blender/python/intern/bpy_interface.c
+++ b/source/blender/python/intern/bpy_interface.c
@@ -62,8 +62,7 @@
static int py_call_level= 0;
BPy_StructRNA *bpy_context_module= NULL; /* for fast access */
-// only for tests
-#define TIME_PY_RUN
+// #define TIME_PY_RUN // simple python tests. prints on exit.
#ifdef TIME_PY_RUN
#include "PIL_time.h"
diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c
index bdd1f0575bd..38d3c9161db 100644
--- a/source/blender/python/intern/bpy_props.c
+++ b/source/blender/python/intern/bpy_props.c
@@ -539,7 +539,7 @@ static PyObject *BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw
Py_RETURN_NONE;
}
-static EnumPropertyItem *enum_items_from_py(PyObject *value, PyObject *def, int *defvalue, const short is_enum_flag)
+static EnumPropertyItem *enum_items_from_py(PyObject *seq_fast, PyObject *def, int *defvalue, const short is_enum_flag)
{
EnumPropertyItem *items= NULL;
PyObject *item;
@@ -547,12 +547,7 @@ static EnumPropertyItem *enum_items_from_py(PyObject *value, PyObject *def, int
short def_used= 0;
const char *def_cmp= NULL;
- if(!PySequence_Check(value)) {
- PyErr_SetString(PyExc_TypeError, "EnumProperty(...): expected a sequence of tuples for the enum items");
- return NULL;
- }
-
- seq_len= PySequence_Size(value);
+ seq_len= PySequence_Fast_GET_SIZE(seq_fast);
if(is_enum_flag) {
if(seq_len > RNA_ENUM_BITFLAG_SIZE) {
@@ -580,17 +575,15 @@ static EnumPropertyItem *enum_items_from_py(PyObject *value, PyObject *def, int
for(i=0; i<seq_len; i++) {
EnumPropertyItem tmp= {0, "", 0, "", ""};
- item= PySequence_GetItem(value, i);
- if(item==NULL || PyTuple_Check(item)==0) {
+ item= PySequence_Fast_GET_ITEM(seq_fast, i);
+ if(PyTuple_Check(item)==0) {
PyErr_SetString(PyExc_TypeError, "EnumProperty(...): expected a sequence of tuples for the enum items");
if(items) MEM_freeN(items);
- Py_XDECREF(item);
return NULL;
}
if(!PyArg_ParseTuple(item, "sss", &tmp.identifier, &tmp.name, &tmp.description)) {
PyErr_SetString(PyExc_TypeError, "EnumProperty(...): expected an identifier, name and description in the tuple");
- Py_DECREF(item);
return NULL;
}
@@ -612,8 +605,6 @@ static EnumPropertyItem *enum_items_from_py(PyObject *value, PyObject *def, int
}
RNA_enum_item_add(&items, &totitem, &tmp);
-
- Py_DECREF(item);
}
RNA_enum_item_end(&items, &totitem);
@@ -635,6 +626,7 @@ static EnumPropertyItem *enum_items_from_py(PyObject *value, PyObject *def, int
return NULL;
}
}
+
return items;
}
@@ -661,7 +653,7 @@ static PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw)
PyObject *def= NULL;
int id_len;
int defvalue=0;
- PyObject *items= Py_None;
+ PyObject *items, *items_fast;
EnumPropertyItem *eitems;
PropertyRNA *prop;
PyObject *pyopts= NULL;
@@ -672,15 +664,23 @@ static PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw)
BPY_PROPDEF_CHECK(EnumProperty, property_flag_enum_items)
- eitems= enum_items_from_py(items, def, &defvalue, (opts & PROP_ENUM_FLAG)!=0);
+ if(!(items_fast= PySequence_Fast(items, "EnumProperty(...): expected a sequence of tuples for the enum items"))) {
+ return NULL;
+ }
+
+ eitems= enum_items_from_py(items_fast, def, &defvalue, (opts & PROP_ENUM_FLAG)!=0);
+
+ Py_DECREF(items_fast);
+
if(!eitems)
return NULL;
- prop= RNA_def_enum(srna, id, eitems, defvalue, name, description);
+ if(opts & PROP_ENUM_FLAG) prop= RNA_def_enum_flag(srna, id, eitems, defvalue, name, description);
+ else prop= RNA_def_enum(srna, id, eitems, defvalue, name, description);
+
if(pyopts) {
if(opts & PROP_HIDDEN) RNA_def_property_flag(prop, PROP_HIDDEN);
if((opts & PROP_ANIMATABLE)==0) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
- if(opts & PROP_ENUM_FLAG) RNA_def_property_flag(prop, PROP_ENUM_FLAG);
}
RNA_def_property_duplicate_pointers(srna, prop);
MEM_freeN(eitems);
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index d248499656a..8f745bc2756 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -1665,7 +1665,7 @@ static PyObject *pyrna_prop_array_subscript(BPy_PropertyArrayRNA *self, PyObject
int len= pyrna_prop_array_length(self);
Py_ssize_t start, stop, slicelength;
- if (PySlice_GetIndicesEx((PySliceObject*)key, len, &start, &stop, &step, &slicelength) < 0)
+ if (PySlice_GetIndicesEx((void *)key, len, &start, &stop, &step, &slicelength) < 0)
return NULL;
if (slicelength <= 0) {
@@ -1821,7 +1821,7 @@ static int pyrna_prop_array_ass_subscript( BPy_PropertyArrayRNA *self, PyObject
int len= RNA_property_array_length(&self->ptr, self->prop);
Py_ssize_t start, stop, step, slicelength;
- if (PySlice_GetIndicesEx((PySliceObject*)key, len, &start, &stop, &step, &slicelength) < 0) {
+ if (PySlice_GetIndicesEx((void *)key, len, &start, &stop, &step, &slicelength) < 0) {
ret= -1;
}
else if (slicelength <= 0) {
@@ -2213,7 +2213,7 @@ static char pyrna_struct_keyframe_insert_doc[] =
"\n"
" :arg data_path: path to the property to key, analogous to the fcurve's data path.\n"
" :type data_path: string\n"
-" :arg index: array index of the property to key. Defaults to -1 which will key all indicies or a single channel if the property is not an array.\n"
+" :arg index: array index of the property to key. Defaults to -1 which will key all indices or a single channel if the property is not an array.\n"
" :type index: int\n"
" :arg frame: The frame on which the keyframe is inserted, defaulting to the current frame.\n"
" :type frame: float\n"
@@ -2256,7 +2256,7 @@ static char pyrna_struct_keyframe_delete_doc[] =
"\n"
" :arg data_path: path to the property to remove a key, analogous to the fcurve's data path.\n"
" :type data_path: string\n"
-" :arg index: array index of the property to remove a key. Defaults to -1 removing all indicies or a single channel if the property is not an array.\n"
+" :arg index: array index of the property to remove a key. Defaults to -1 removing all indices or a single channel if the property is not an array.\n"
" :type index: int\n"
" :arg frame: The frame on which the keyframe is deleted, defaulting to the current frame.\n"
" :type frame: float\n"
@@ -2300,7 +2300,7 @@ static char pyrna_struct_driver_add_doc[] =
"\n"
" :arg path: path to the property to drive, analogous to the fcurve's data path.\n"
" :type path: string\n"
-" :arg index: array index of the property drive. Defaults to -1 for all indicies or a single channel if the property is not an array.\n"
+" :arg index: array index of the property drive. Defaults to -1 for all indices or a single channel if the property is not an array.\n"
" :type index: int\n"
" :return: The driver(s) added.\n"
" :rtype: :class:`FCurve` or list if index is -1 with an array property.";
@@ -2372,7 +2372,7 @@ static char pyrna_struct_driver_remove_doc[] =
"\n"
" :arg path: path to the property to drive, analogous to the fcurve's data path.\n"
" :type path: string\n"
-" :arg index: array index of the property drive. Defaults to -1 for all indicies or a single channel if the property is not an array.\n"
+" :arg index: array index of the property drive. Defaults to -1 for all indices or a single channel if the property is not an array.\n"
" :type index: int\n"
" :return: Success of driver removal.\n"
" :rtype: boolean";
@@ -3480,11 +3480,37 @@ static PyObject *foreach_getset(BPy_PropertyRNA *self, PyObject *args, int set)
Py_RETURN_NONE;
}
+static char pyrna_prop_collection_foreach_get_doc[] =
+".. method:: foreach_get(attr, seq)\n"
+"\n"
+" This is a function to give fast access to attribites within a collection.\n"
+"\n"
+" .. code-block:: python\n"
+"\n"
+" collection.foreach_get(someseq, attr)\n"
+"\n"
+" # Python equivelent\n"
+" for i in range(len(seq)): someseq[i] = getattr(collection, attr)\n"
+"\n"
+;
static PyObject *pyrna_prop_collection_foreach_get(BPy_PropertyRNA *self, PyObject *args)
{
return foreach_getset(self, args, 0);
}
+static char pyrna_prop_collection_foreach_set_doc[] =
+".. method:: foreach_set(attr, seq)\n"
+"\n"
+" This is a function to give fast access to attribites within a collection.\n"
+"\n"
+" .. code-block:: python\n"
+"\n"
+" collection.foreach_set(seq, attr)\n"
+"\n"
+" # Python equivelent\n"
+" for i in range(len(seq)): setattr(collection[i], attr, seq[i])\n"
+"\n"
+;
static PyObject *pyrna_prop_collection_foreach_set(BPy_PropertyRNA *self, PyObject *args)
{
return foreach_getset(self, args, 1);
@@ -3566,8 +3592,8 @@ static struct PyMethodDef pyrna_prop_array_methods[] = {
};
static struct PyMethodDef pyrna_prop_collection_methods[] = {
- {"foreach_get", (PyCFunction)pyrna_prop_collection_foreach_get, METH_VARARGS, NULL},
- {"foreach_set", (PyCFunction)pyrna_prop_collection_foreach_set, METH_VARARGS, NULL},
+ {"foreach_get", (PyCFunction)pyrna_prop_collection_foreach_get, METH_VARARGS, pyrna_prop_collection_foreach_get_doc},
+ {"foreach_set", (PyCFunction)pyrna_prop_collection_foreach_set, METH_VARARGS, pyrna_prop_collection_foreach_set_doc},
{"keys", (PyCFunction)pyrna_prop_collection_keys, METH_NOARGS, NULL},
{"items", (PyCFunction)pyrna_prop_collection_items, METH_NOARGS,NULL},
diff --git a/source/blender/render/intern/source/rayobject_octree.c b/source/blender/render/intern/source/rayobject_octree.c
index 2637643989e..8a8b102c6fa 100644
--- a/source/blender/render/intern/source/rayobject_octree.c
+++ b/source/blender/render/intern/source/rayobject_octree.c
@@ -974,10 +974,11 @@ static int RE_rayobject_octree_intersect(RayObject *tree, Isect *is)
ldz=0;
dz= 0;
}
-
+
xo=ocx1; yo=ocy1; zo=ocz1;
- labdao= ddalabda= MIN3(labdax,labday,labdaz);
-
+ ddalabda= MIN3(labdax,labday,labdaz);
+ /*labdao= ddalabda;*/ /*NEVER READ*/
+
vec2[0]= ox1;
vec2[1]= oy1;
vec2[2]= oz1;
diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c
index 1706d63064c..9563e802945 100644
--- a/source/blender/render/intern/source/texture.c
+++ b/source/blender/render/intern/source/texture.c
@@ -2690,7 +2690,7 @@ void do_sky_tex(float *rco, float *lo, float *dxyview, float *hor, float *zen, f
switch(mtex->texco) {
case TEXCO_ANGMAP:
/* only works with texture being "real" */
- /* use saacos(), fixes bug [#22398], float precission caused lo[2] to be slightly less then -1.0 */
+ /* use saacos(), fixes bug [#22398], float precision caused lo[2] to be slightly less then -1.0 */
if(lo[0] || lo[1]) { /* check for zero case [#24807] */
fact= (1.0/M_PI)*saacos(lo[2])/(sqrt(lo[0]*lo[0] + lo[1]*lo[1]));
tempvec[0]= lo[0]*fact;
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h
index a7aad83d471..c9d74cbb39d 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -81,7 +81,8 @@ void WM_window_open_temp (struct bContext *C, struct rcti *position, int type);
/* files */
-int WM_read_homefile (struct bContext *C, struct wmOperator *op);
+int WM_read_homefile_exec(struct bContext *C, struct wmOperator *op);
+int WM_read_homefile (struct bContext *C, struct ReportList *reports, short from_memory);
int WM_write_homefile (struct bContext *C, struct wmOperator *op);
void WM_read_file (struct bContext *C, const char *name, struct ReportList *reports);
int WM_write_file (struct bContext *C, const char *target, int fileflags, struct ReportList *reports, int copy);
diff --git a/source/blender/windowmanager/intern/wm_cursors.c b/source/blender/windowmanager/intern/wm_cursors.c
index 6034ddce1b5..f0a416e1c6e 100644
--- a/source/blender/windowmanager/intern/wm_cursors.c
+++ b/source/blender/windowmanager/intern/wm_cursors.c
@@ -116,6 +116,9 @@ void WM_cursor_set(wmWindow *win, int curs)
GHOST_SetCursorVisibility(win->ghostwin, 1);
+ if(curs == CURSOR_STD && win->modalcursor)
+ curs= win->modalcursor;
+
win->cursor= curs;
/* detect if we use system cursor or Blender cursor */
@@ -141,11 +144,13 @@ void WM_cursor_modal(wmWindow *win, int val)
{
if(win->lastcursor == 0)
win->lastcursor = win->cursor;
+ win->modalcursor = val;
WM_cursor_set(win, val);
}
void WM_cursor_restore(wmWindow *win)
{
+ win->modalcursor = 0;
if(win->lastcursor)
WM_cursor_set(win, win->lastcursor);
win->lastcursor = 0;
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index be6700f2ea1..3c312a0c2b3 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -1470,21 +1470,26 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers)
if(event->custom==EVT_DATA_LISTBASE) {
ListBase *lb= (ListBase *)event->customdata;
wmDrag *drag;
+
for(drag= lb->first; drag; drag= drag->next) {
if(drop->poll(C, drag, event)) {
+
drop->copy(drag, drop);
+ /* free the drags before calling operator */
+ BLI_freelistN(event->customdata);
+ event->customdata= NULL;
+ event->custom= 0;
+
WM_operator_name_call(C, drop->ot->idname, drop->opcontext, drop->ptr);
- //wm_operator_invoke(C, drop->ot, event, drop->ptr, NULL, FALSE);
action |= WM_HANDLER_BREAK;
/* XXX fileread case */
if(CTX_wm_window(C)==NULL)
return action;
- BLI_freelistN(event->customdata);
- event->customdata= NULL;
- event->custom= 0;
+ /* escape from drag loop, got freed */
+ break;
}
}
}
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 31cb3172013..80b88309883 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -352,11 +352,10 @@ void WM_read_file(bContext *C, const char *name, ReportList *reports)
/* called on startup, (context entirely filled with NULLs) */
/* or called for 'New File' */
/* op can be NULL */
-int WM_read_homefile(bContext *C, wmOperator *op)
+int WM_read_homefile(bContext *C, ReportList *reports, short from_memory)
{
ListBase wmbase;
char tstr[FILE_MAXDIR+FILE_MAXFILE];
- int from_memory= op && strcmp(op->type->idname, "WM_OT_read_factory_settings")==0;
int success= 0;
free_ttfont(); /* still weird... what does it here? */
@@ -369,9 +368,7 @@ int WM_read_homefile(bContext *C, wmOperator *op)
} else {
tstr[0] = '\0';
from_memory = 1;
- if (op) {
- BKE_report(op->reports, RPT_INFO, "Config directory with startup.blend file not found.");
- }
+ BKE_report(reports, RPT_INFO, "Config directory with "STRINGIFY(BLENDER_STARTUP_FILE)" file not found.");
}
}
@@ -385,7 +382,7 @@ int WM_read_homefile(bContext *C, wmOperator *op)
success = (BKE_read_file(C, tstr, NULL) != BKE_READ_FILE_FAIL);
if(U.themes.first==NULL) {
- printf("\nError: No valid startup.blend, fall back to built-in default.\n\n");
+ printf("\nError: No valid "STRINGIFY(BLENDER_STARTUP_FILE)", fall back to built-in default.\n\n");
success = 0;
}
}
@@ -436,9 +433,14 @@ int WM_read_homefile(bContext *C, wmOperator *op)
WM_event_add_notifier(C, NC_WM|ND_FILEREAD, NULL);
CTX_wm_window_set(C, NULL); /* exits queues */
- return OPERATOR_FINISHED;
+ return TRUE;
}
+int WM_read_homefile_exec(bContext *C, wmOperator *op)
+{
+ int from_memory= strcmp(op->type->idname, "WM_OT_read_factory_settings") == 0;
+ return WM_read_homefile(C, op->reports, from_memory) ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
+}
void read_history(void)
{
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c
index 19bb92d72e0..0d1dfd5fbba 100644
--- a/source/blender/windowmanager/intern/wm_init_exit.c
+++ b/source/blender/windowmanager/intern/wm_init_exit.c
@@ -136,7 +136,7 @@ void WM_init(bContext *C, int argc, char **argv)
BLF_lang_init();
/* get the default database, plus a wm */
- WM_read_homefile(C, NULL);
+ WM_read_homefile(C, NULL, G.factory_startup);
/* note: there is a bug where python needs initializing before loading the
* startup.blend because it may contain PyDrivers. It also needs to be after
@@ -177,8 +177,11 @@ void WM_init(bContext *C, int argc, char **argv)
read_history();
+ /* allow a path of "", this is what happens when making a new file */
+ /*
if(G.main->name[0] == 0)
BLI_make_file_string("/", G.main->name, BLI_getDefaultDocumentFolder(), "untitled.blend");
+ */
BLI_strncpy(G.lib, G.main->name, FILE_MAX);
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index f6b3cfed2eb..5aa2f6c1c50 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -981,25 +981,21 @@ static uiBlock *wm_operator_create_ui(bContext *C, ARegion *ar, void *userData)
return block;
}
+/* operator menu needs undo, for redo callback */
int WM_operator_props_popup(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
- int retval= OPERATOR_CANCELLED;
if((op->type->flag & OPTYPE_REGISTER)==0) {
BKE_reportf(op->reports, RPT_ERROR, "Operator '%s' does not have register enabled, incorrect invoke function.", op->type->idname);
return OPERATOR_CANCELLED;
}
- if(op->type->exec) {
- retval= op->type->exec(C, op);
+ ED_undo_push_op(C, op);
+ wm_operator_register(C, op);
- /* ED_undo_push_op(C, op), called by wm_operator_finished now. */
- }
-
- if(retval != OPERATOR_CANCELLED)
- uiPupBlock(C, wm_block_create_redo, op);
+ uiPupBlock(C, wm_block_create_redo, op);
- return retval;
+ return OPERATOR_RUNNING_MODAL;
}
int WM_operator_props_dialog_popup(bContext *C, wmOperator *op, int width, int height)
@@ -1353,7 +1349,7 @@ static void WM_OT_read_homefile(wmOperatorType *ot)
ot->description="Open the default file (doesn't save the current file)";
ot->invoke= WM_operator_confirm;
- ot->exec= WM_read_homefile;
+ ot->exec= WM_read_homefile_exec;
ot->poll= WM_operator_winactive;
}
@@ -1364,7 +1360,7 @@ static void WM_OT_read_factory_settings(wmOperatorType *ot)
ot->description="Load default file and user preferences";
ot->invoke= WM_operator_confirm;
- ot->exec= WM_read_homefile;
+ ot->exec= WM_read_homefile_exec;
ot->poll= WM_operator_winactive;
}