[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28410] trunk/blender/source/blender: Mesh Deform Modifier: fix problem with saving.

2010-04-25 Thread Brecht Van Lommel
Revision: 28410
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=28410
Author:   blendix
Date: 2010-04-25 12:27:45 +0200 (Sun, 25 Apr 2010)

Log Message:
---
Mesh Deform Modifier: fix problem with saving.

Modified Paths:
--
trunk/blender/source/blender/blenloader/intern/writefile.c
trunk/blender/source/blender/makesrna/intern/rna_modifier.c

Modified: trunk/blender/source/blender/blenloader/intern/writefile.c
===
--- trunk/blender/source/blender/blenloader/intern/writefile.c  2010-04-25 
04:06:34 UTC (rev 28409)
+++ trunk/blender/source/blender/blenloader/intern/writefile.c  2010-04-25 
10:27:45 UTC (rev 28410)
@@ -1231,8 +1231,8 @@
MeshDeformModifierData *mmd = (MeshDeformModifierData*) 
md;
int size = mmd-dyngridsize;
 
-   writedata(wd, DATA, 
sizeof(float)*mmd-totvert*mmd-totcagevert,
-   mmd-bindweights);
+   writestruct(wd, DATA, MDefInfluence, 
mmd-totinfluence, mmd-bindinfluences);
+   writedata(wd, DATA, sizeof(int)*(mmd-totvert+1), 
mmd-bindoffsets);
writedata(wd, DATA, sizeof(float)*3*mmd-totcagevert,
mmd-bindcagecos);
writestruct(wd, DATA, MDefCell, size*size*size, 
mmd-dyngrid);

Modified: trunk/blender/source/blender/makesrna/intern/rna_modifier.c
===
--- trunk/blender/source/blender/makesrna/intern/rna_modifier.c 2010-04-25 
04:06:34 UTC (rev 28409)
+++ trunk/blender/source/blender/makesrna/intern/rna_modifier.c 2010-04-25 
10:27:45 UTC (rev 28410)
@@ -465,7 +465,7 @@
 
 static int rna_MeshDeformModifier_is_bound_get(PointerRNA *ptr)
 {
-   return (((MeshDeformModifierData*)ptr-data)-bindcos != NULL);
+   return (((MeshDeformModifierData*)ptr-data)-bindcagecos != NULL);
 }
 
 static PointerRNA rna_SoftBodyModifier_settings_get(PointerRNA *ptr)


___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28411] trunk/blender/source/blender: Fix #22123 and #22124: some problems with mutex locks, also tweak to

2010-04-25 Thread Brecht Van Lommel
Revision: 28411
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=28411
Author:   blendix
Date: 2010-04-25 12:49:13 +0200 (Sun, 25 Apr 2010)

Log Message:
---
Fix #22123 and #22124: some problems with mutex locks, also tweak to
how removing opengl textures from outside main thread is done so it
happens as part of the main loop.

Modified Paths:
--
trunk/blender/source/blender/blenlib/BLI_threads.h
trunk/blender/source/blender/blenlib/intern/threads.c
trunk/blender/source/blender/gpu/GPU_draw.h
trunk/blender/source/blender/gpu/intern/gpu_draw.c
trunk/blender/source/blender/windowmanager/intern/wm_draw.c
trunk/blender/source/blender/windowmanager/intern/wm_init_exit.c

Modified: trunk/blender/source/blender/blenlib/BLI_threads.h
===
--- trunk/blender/source/blender/blenlib/BLI_threads.h  2010-04-25 10:27:45 UTC 
(rev 28410)
+++ trunk/blender/source/blender/blenlib/BLI_threads.h  2010-04-25 10:49:13 UTC 
(rev 28411)
@@ -65,7 +65,8 @@
 #define LOCK_PREVIEW   1
 #define LOCK_VIEWER2
 #define LOCK_CUSTOM1   3
-#define LOCK_RCACHE2
+#define LOCK_RCACHE4
+#define LOCK_OPENGL5
 
 void   BLI_lock_thread(int type);
 void   BLI_unlock_thread(int type);
@@ -73,7 +74,7 @@
 /* Mutex Lock */
 
 typedef pthread_mutex_t ThreadMutex;
-#define BLI_MUTEX_INITIALIZER  PTHREAD_MUTEX_INITIALIZER;
+#define BLI_MUTEX_INITIALIZER  PTHREAD_MUTEX_INITIALIZER
 
 void BLI_mutex_init(ThreadMutex *mutex);
 void BLI_mutex_lock(ThreadMutex *mutex);

Modified: trunk/blender/source/blender/blenlib/intern/threads.c
===
--- trunk/blender/source/blender/blenlib/intern/threads.c   2010-04-25 
10:27:45 UTC (rev 28410)
+++ trunk/blender/source/blender/blenlib/intern/threads.c   2010-04-25 
10:49:13 UTC (rev 28411)
@@ -108,6 +108,7 @@
 static pthread_mutex_t _viewer_lock = PTHREAD_MUTEX_INITIALIZER;
 static pthread_mutex_t _custom1_lock = PTHREAD_MUTEX_INITIALIZER;
 static pthread_mutex_t _rcache_lock = PTHREAD_MUTEX_INITIALIZER;
+static pthread_mutex_t _opengl_lock = PTHREAD_MUTEX_INITIALIZER;
 static pthread_t mainid;
 static int thread_levels= 0;   /* threads can be invoked inside threads */
 
@@ -344,6 +345,8 @@
pthread_mutex_lock(_custom1_lock);
else if (type==LOCK_RCACHE)
pthread_mutex_lock(_rcache_lock);
+   else if (type==LOCK_OPENGL)
+   pthread_mutex_lock(_opengl_lock);
 }
 
 void BLI_unlock_thread(int type)
@@ -356,8 +359,8 @@
pthread_mutex_unlock(_viewer_lock);
else if(type==LOCK_CUSTOM1)
pthread_mutex_unlock(_custom1_lock);
-   else if(type==LOCK_RCACHE)
-   pthread_mutex_unlock(_rcache_lock);
+   else if(type==LOCK_OPENGL)
+   pthread_mutex_unlock(_opengl_lock);
 }
 
 /* Mutex Locks */

Modified: trunk/blender/source/blender/gpu/GPU_draw.h
===
--- trunk/blender/source/blender/gpu/GPU_draw.h 2010-04-25 10:27:45 UTC (rev 
28410)
+++ trunk/blender/source/blender/gpu/GPU_draw.h 2010-04-25 10:49:13 UTC (rev 
28411)
@@ -122,6 +122,9 @@
 void GPU_free_smoke(struct SmokeModifierData *smd);
 void GPU_create_smoke(struct SmokeModifierData *smd, int highres);
 
+/* Delayed free of OpenGL buffers by main thread */
+void GPU_free_unused_buffers(void);
+
 #ifdef __cplusplus
 }
 #endif

Modified: trunk/blender/source/blender/gpu/intern/gpu_draw.c
===
--- trunk/blender/source/blender/gpu/intern/gpu_draw.c  2010-04-25 10:27:45 UTC 
(rev 28410)
+++ trunk/blender/source/blender/gpu/intern/gpu_draw.c  2010-04-25 10:49:13 UTC 
(rev 28411)
@@ -784,42 +784,36 @@
smd-domain-tex_shadow = GPU_texture_create_3D(smd-domain-res[0], 
smd-domain-res[1], smd-domain-res[2], smd-domain-shadow);
 }
 
-ListBase image_free_queue = {NULL, NULL};
-static ThreadMutex queuelock = BLI_MUTEX_INITIALIZER;
+static ListBase image_free_queue = {NULL, NULL};
 
-static void flush_queued_free(void)
+static void gpu_queue_image_for_free(Image *ima)
 {
-   Image *ima, *imanext;
+Image *cpy = MEM_dupallocN(ima);
 
-   BLI_mutex_lock(queuelock);
-
-   ima = image_free_queue.first;
-   image_free_queue.first = image_free_queue.last = NULL;
-   for (; ima; ima=imanext) {
-   imanext = (Image*)ima-id.next;
-   GPU_free_image(ima);
-   MEM_freeN(ima);
-   }
-
-   BLI_mutex_unlock(queuelock);
+   BLI_lock_thread(LOCK_OPENGL);
+   BLI_addtail(image_free_queue, cpy);
+   BLI_unlock_thread(LOCK_OPENGL);
 }
 
-static void queue_image_for_free(Image *ima)
+void GPU_free_unused_buffers(void)
 {
-Image *cpy = MEM_dupallocN(ima);
+   Image *ima;
 
-   

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28412] trunk/blender/source/blender: == Sequencer ==

2010-04-25 Thread Peter Schlaile
Revision: 28412
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=28412
Author:   schlaile
Date: 2010-04-25 14:53:39 +0200 (Sun, 25 Apr 2010)

Log Message:
---
== Sequencer ==

This adds MULTICAM-editing support for blender. (Well, the beginning of.)

There is now a new effect track, named MULTICAM, which just selects
one of the lower tracks.

Doesn't sound that exciting, but if you combine this with A/B-Trim (moving
split points of two directly connected tracks around, while magically
resizing both strips, something to be added), you just do:

* add several tracks for your camera angles
* (optionally) sync those tracks
* add one multicam track on top

Use that multicam-track to edit your movie. (Either using fcurves on the
multicam source selector or using knife-tool and A/B-Trim.)

Compare that to:

* add several tracks
* add cross fades between them
* do some python scripting to add several fcurves to make that beast
  somewhat work.
* cry out loud, using it, if you have to move cut points around

Alternatively, even harder:

* just edit the old way and put strip after strip

You might think, that this isn't really helpfull for animators, but
consider using scene-strips (in OpenGL-mode) for input, that are set for
different camera angles and can now be intercut a lot more easily...

Also: small fix on the way: the speed effect can now be used in cascade.
(Don't know, if anyone used it that way, but now it works.)

Modified Paths:
--
trunk/blender/source/blender/blenkernel/BKE_sequencer.h
trunk/blender/source/blender/blenkernel/intern/seqeffects.c
trunk/blender/source/blender/blenkernel/intern/sequencer.c
trunk/blender/source/blender/editors/space_sequencer/sequencer_draw.c
trunk/blender/source/blender/editors/space_sequencer/sequencer_edit.c
trunk/blender/source/blender/makesdna/DNA_sequence_types.h
trunk/blender/source/blender/makesrna/RNA_access.h
trunk/blender/source/blender/makesrna/intern/rna_sequencer.c

Modified: trunk/blender/source/blender/blenkernel/BKE_sequencer.h
===
--- trunk/blender/source/blender/blenkernel/BKE_sequencer.h 2010-04-25 
10:49:13 UTC (rev 28411)
+++ trunk/blender/source/blender/blenkernel/BKE_sequencer.h 2010-04-25 
12:53:39 UTC (rev 28412)
@@ -112,22 +112,22 @@

/* stores the y-range of the effect IPO */
void (*store_icu_yrange)(struct Sequence * seq,
-short adrcode, float 
*ymin, float *ymax);
+ short adrcode, float *ymin, float *ymax);

/* stores the default facf0 and facf1 if no IPO is present */
void (*get_default_fac)(struct Sequence *seq, int cfra,
-   float * facf0, float * 
facf1);
+float * facf0, float * facf1);

/* execute the effect
-   sequence effects are only required to either support
-   float-rects or byte-rects 
-   (mixed cases are handled one layer up...) */
+   sequence effects are only required to either support
+   float-rects or byte-rects 
+   (mixed cases are handled one layer up...) */

void (*execute)(struct Scene *scene, struct Sequence *seq, int cfra,
-   float facf0, float facf1,
-   int x, int y,
-   struct ImBuf *ibuf1, struct ImBuf 
*ibuf2,
-   struct ImBuf *ibuf3, struct ImBuf *out);
+float facf0, float facf1,
+int x, int y, int preview_render_size,
+struct ImBuf *ibuf1, struct ImBuf *ibuf2,
+struct ImBuf *ibuf3, struct ImBuf *out);
 };
 
 /* * prototypes *** */
@@ -149,6 +149,7 @@
 struct ImBuf *give_ibuf_seq(struct Scene *scene, int rectx, int recty, int 
cfra, int chanshown, int render_size);
 struct ImBuf *give_ibuf_seq_threaded(struct Scene *scene, int rectx, int 
recty, int cfra, int chanshown, int render_size);
 struct ImBuf *give_ibuf_seq_direct(struct Scene *scene, int rectx, int recty, 
int cfra, int render_size, struct Sequence *seq);
+struct ImBuf *give_ibuf_seqbase(struct Scene *scene, int rectx, int recty, int 
cfra, int chan_shown, int render_size, struct ListBase *seqbasep);
 void give_ibuf_prefetch_request(int rectx, int recty, int cfra, int chanshown, 
int render_size);
 void calc_sequence(struct Scene *scene, struct Sequence *seq);
 void calc_sequence_disp(struct Scene *scene, struct Sequence *seq);

Modified: trunk/blender/source/blender/blenkernel/intern/seqeffects.c
===
--- 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28413] trunk/blender/source/blender/ blenkernel/intern: bugfix [#22117] Memory Error messages with Spline IK

2010-04-25 Thread Campbell Barton
Revision: 28413
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=28413
Author:   campbellbarton
Date: 2010-04-25 15:27:52 +0200 (Sun, 25 Apr 2010)

Log Message:
---
bugfix [#22117] Memory Error messages with Spline IK
chainlen was initialized as 0

Modified Paths:
--
trunk/blender/source/blender/blenkernel/intern/armature.c
trunk/blender/source/blender/blenkernel/intern/constraint.c

Modified: trunk/blender/source/blender/blenkernel/intern/armature.c
===
--- trunk/blender/source/blender/blenkernel/intern/armature.c   2010-04-25 
12:53:39 UTC (rev 28412)
+++ trunk/blender/source/blender/blenkernel/intern/armature.c   2010-04-25 
13:27:52 UTC (rev 28413)
@@ -1773,20 +1773,13 @@
/* find the root bone and the chain of bones from the root to the tip 
 * NOTE: this assumes that the bones are connected, but that may not be 
true...
 */
-   for (pchan= pchan_tip; pchan; pchan= pchan-parent) {
+   for (pchan= pchan_tip; pchan  (segcount  ikData-chainlen); pchan= 
pchan-parent, segcount++) {
/* store this segment in the chain */
pchanChain[segcount]= pchan;

/* if performing rebinding, calculate the length of the bone */
boneLengths[segcount]= pchan-bone-length;
totLength += boneLengths[segcount];
-   
-   /* check if we've gotten the number of bones required yet 
(after incrementing the count first)
-* NOTE: the 255 limit here is rather ugly, but the standard IK 
does this too!
-*/
-   segcount++;
-   if ((segcount == ikData-chainlen) || (segcount  255))
-   break;
}

if (segcount == 0)

Modified: trunk/blender/source/blender/blenkernel/intern/constraint.c
===
--- trunk/blender/source/blender/blenkernel/intern/constraint.c 2010-04-25 
12:53:39 UTC (rev 28412)
+++ trunk/blender/source/blender/blenkernel/intern/constraint.c 2010-04-25 
13:27:52 UTC (rev 28413)
@@ -3750,8 +3750,19 @@

/* copy the binding array */
dst-points= MEM_dupallocN(src-points);
+   dst-numpoints= src-numpoints;
+   dst-chainlen= src-chainlen;
+   dst-flag= src-flag;
+   dst-xzScaleMode= src-xzScaleMode;
 }
 
+static void splineik_new_data (void *cdata)
+{
+   bSplineIKConstraint *data= (bSplineIKConstraint *)cdata;
+
+   data-chainlen= 1;
+}
+
 static void splineik_id_looper (bConstraint *con, ConstraintIDFunc func, void 
*userdata)
 {
bSplineIKConstraint *data= con-data;
@@ -3816,7 +3827,7 @@
NULL, /* relink data */
splineik_id_looper, /* id looper */
splineik_copy, /* copy data */
-   NULL, /* new data */
+   splineik_new_data, /* new data */
splineik_get_tars, /* get constraint targets */
splineik_flush_tars, /* flush constraint targets */
splineik_get_tarmat, /* get target matrix */


___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28414] trunk/blender/release/scripts/ modules/console/complete_import.py: py console autocomp.

2010-04-25 Thread Campbell Barton
Revision: 28414
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=28414
Author:   campbellbarton
Date: 2010-04-25 17:21:46 +0200 (Sun, 25 Apr 2010)

Log Message:
---
py console autocomp. fix
 import missing_mod
...would raise an error.

Modified Paths:
--
trunk/blender/release/scripts/modules/console/complete_import.py

Modified: trunk/blender/release/scripts/modules/console/complete_import.py
===
--- trunk/blender/release/scripts/modules/console/complete_import.py
2010-04-25 13:27:52 UTC (rev 28413)
+++ trunk/blender/release/scripts/modules/console/complete_import.py
2010-04-25 15:21:46 UTC (rev 28414)
@@ -32,6 +32,7 @@
 - limit list of modules to prefix in case of from w
 - sorted modules
 - added sphinx documentation
+- complete() returns a blank list of the module isnt found
 
 
 
@@ -183,3 +184,8 @@
 if len(words) = 3 and words[0] == 'from':
 mod = words[1]
 return filter_prefix(try_import(mod), words[-1])
+
+# get here if the import is not found
+# import invalidmodule
+#  ^, in this case return nothing
+return []


___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28415] trunk/blender/source: correct typo 's

2010-04-25 Thread Campbell Barton
Revision: 28415
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=28415
Author:   campbellbarton
Date: 2010-04-25 17:24:18 +0200 (Sun, 25 Apr 2010)

Log Message:
---
correct typo's

Modified Paths:
--
trunk/blender/source/blender/blenlib/intern/path_util.c
trunk/blender/source/blender/collada/DocumentImporter.cpp
trunk/blender/source/blender/editors/metaball/mball_edit.c
trunk/blender/source/blender/editors/object/object_hook.c
trunk/blender/source/blender/editors/screen/screen_edit.c
trunk/blender/source/blender/editors/space_file/filelist.c
trunk/blender/source/blender/makesdna/DNA_documentation.h
trunk/blender/source/blender/makesdna/DNA_modifier_types.h
trunk/blender/source/blender/makesrna/intern/rna_property.c
trunk/blender/source/gameengine/GamePlayer/common/unix/GPU_Engine.h
trunk/blender/source/gameengine/Ketsji/KX_RayCast.cpp
trunk/blender/source/gameengine/Ketsji/KX_Scene.cpp

Modified: trunk/blender/source/blender/blenlib/intern/path_util.c
===
--- trunk/blender/source/blender/blenlib/intern/path_util.c 2010-04-25 
15:21:46 UTC (rev 28414)
+++ trunk/blender/source/blender/blenlib/intern/path_util.c 2010-04-25 
15:24:18 UTC (rev 28415)
@@ -621,7 +621,7 @@
char *lslash= BLI_last_slash(base);
if (lslash) {
int baselen= (int) (lslash-base) + 1;
-   /* use path for for temp storage here, we copy back 
over it right away */
+   /* use path for temp storage here, we copy back over it 
right away */
BLI_strncpy(path, tmp+2, FILE_MAX);

memcpy(tmp, base, baselen);

Modified: trunk/blender/source/blender/collada/DocumentImporter.cpp
===
--- trunk/blender/source/blender/collada/DocumentImporter.cpp   2010-04-25 
15:21:46 UTC (rev 28414)
+++ trunk/blender/source/blender/collada/DocumentImporter.cpp   2010-04-25 
15:24:18 UTC (rev 28415)
@@ -3119,7 +3119,7 @@
}
 
/** This method will be called if an error in the loading process 
occurred and the loader cannot
-   continue to to load. The writer should undo all operations that 
have been performed.
+   continue to load. The writer should undo all operations that 
have been performed.
@param errorMessage A message containing informations about the 
error that occurred.
*/
virtual void cancel(const COLLADAFW::String errorMessage)

Modified: trunk/blender/source/blender/editors/metaball/mball_edit.c
===
--- trunk/blender/source/blender/editors/metaball/mball_edit.c  2010-04-25 
15:21:46 UTC (rev 28414)
+++ trunk/blender/source/blender/editors/metaball/mball_edit.c  2010-04-25 
15:24:18 UTC (rev 28415)
@@ -80,7 +80,7 @@
 
 /* This function is called, when MetaBall Object switched from
  * edit mode to object mode. List od MetaElements is copied
- * from object-data-edit_elems to to object-data-elems. */
+ * from object-data-edit_elems to object-data-elems. */
 void load_editMball(Object *obedit)
 {
MetaBall *mb = (MetaBall*)obedit-data;

Modified: trunk/blender/source/blender/editors/object/object_hook.c
===
--- trunk/blender/source/blender/editors/object/object_hook.c   2010-04-25 
15:21:46 UTC (rev 28414)
+++ trunk/blender/source/blender/editors/object/object_hook.c   2010-04-25 
15:24:18 UTC (rev 28415)
@@ -656,7 +656,7 @@

/* identifiers */
ot-name= Reset Hook;
-   ot-description= Recalculate and and clear offset transformation;
+   ot-description= Recalculate and clear offset transformation;
ot-idname= OBJECT_OT_hook_reset;

/* callbacks */

Modified: trunk/blender/source/blender/editors/screen/screen_edit.c
===
--- trunk/blender/source/blender/editors/screen/screen_edit.c   2010-04-25 
15:21:46 UTC (rev 28414)
+++ trunk/blender/source/blender/editors/screen/screen_edit.c   2010-04-25 
15:24:18 UTC (rev 28415)
@@ -1492,7 +1492,7 @@
wmWindow *win= CTX_wm_window(C);
SpaceLink *sl = sa-spacedata.first;

-   /* if fullscreen area has a secondary space (such as as file browser or 
fullscreen render 
+   /* if fullscreen area has a secondary space (such as a file browser or 
fullscreen render 
 * overlaid on top of a existing setup) then return to the previous 
space */

if (sl-next) {

Modified: trunk/blender/source/blender/editors/space_file/filelist.c
===
--- 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28416] trunk/blender: == Sequencer ==

2010-04-25 Thread Peter Schlaile
Revision: 28416
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=28416
Author:   schlaile
Date: 2010-04-25 17:39:04 +0200 (Sun, 25 Apr 2010)

Log Message:
---
== Sequencer ==

Forgot some changes for multicam support.

Modified Paths:
--
trunk/blender/release/scripts/ui/space_sequencer.py
trunk/blender/source/blender/blenkernel/intern/sequencer.c
trunk/blender/source/blender/editors/space_sequencer/sequencer_edit.c

Modified: trunk/blender/release/scripts/ui/space_sequencer.py
===
--- trunk/blender/release/scripts/ui/space_sequencer.py 2010-04-25 15:24:18 UTC 
(rev 28415)
+++ trunk/blender/release/scripts/ui/space_sequencer.py 2010-04-25 15:39:04 UTC 
(rev 28416)
@@ -217,6 +217,7 @@
 layout.operator(sequencer.effect_strip_add, text=Transform).type = 
'TRANSFORM'
 layout.operator(sequencer.effect_strip_add, text=Color).type = 
'COLOR'
 layout.operator(sequencer.effect_strip_add, text=Speed 
Control).type = 'SPEED'
+layout.operator(sequencer.effect_strip_add, text=Multicam 
Selector).type = 'MULTICAM'
 
 
 class SEQUENCER_MT_strip(bpy.types.Menu):
@@ -402,7 +403,8 @@
 return strip.type in ('ADD', 'SUBTRACT', 'ALPHA_OVER', 'ALPHA_UNDER',
   'CROSS', 'GAMMA_CROSS', 'MULTIPLY', 'OVER_DROP',
   'PLUGIN',
-  'WIPE', 'GLOW', 'TRANSFORM', 'COLOR', 'SPEED')
+  'WIPE', 'GLOW', 'TRANSFORM', 'COLOR', 'SPEED',
+  'MULTICAM')
 
 def draw(self, context):
 layout = self.layout
@@ -445,8 +447,10 @@
 
 elif strip.type == 'TRANSFORM':
 self.draw_panel_transform(strip)
+
+elif strip.type == MULTICAM:
+layout.prop(strip, multicam_source)
 
-
 col = layout.column(align=True)
 if strip.type == 'SPEED':
 col.prop(strip, speed_fader, text=Speed fader)
@@ -501,7 +505,8 @@
   'ADD', 'SUBTRACT', 'ALPHA_OVER', 'ALPHA_UNDER',
   'CROSS', 'GAMMA_CROSS', 'MULTIPLY', 'OVER_DROP',
   'PLUGIN',
-  'WIPE', 'GLOW', 'TRANSFORM', 'COLOR', 'SPEED')
+  'WIPE', 'GLOW', 'TRANSFORM', 'COLOR',
+  'MULTICAM','SPEED')
 
 def draw_filename(self, context):
 pass
@@ -683,7 +688,8 @@
   'ADD', 'SUBTRACT', 'ALPHA_OVER', 'ALPHA_UNDER',
   'CROSS', 'GAMMA_CROSS', 'MULTIPLY', 'OVER_DROP',
   'PLUGIN',
-  'WIPE', 'GLOW', 'TRANSFORM', 'COLOR', 'SPEED')
+  'WIPE', 'GLOW', 'TRANSFORM', 'COLOR',
+  'MULTICAM', 'SPEED')
 
 def draw(self, context):
 layout = self.layout
@@ -738,7 +744,7 @@
 if not strip:
 return False
 
-return strip.type in ('MOVIE', 'IMAGE', 'SCENE', 'META')
+return strip.type in ('MOVIE', 'IMAGE', 'SCENE', 'META', 'MULTICAM')
 
 def draw_header(self, context):
 strip = act_strip(context)

Modified: trunk/blender/source/blender/blenkernel/intern/sequencer.c
===
--- trunk/blender/source/blender/blenkernel/intern/sequencer.c  2010-04-25 
15:24:18 UTC (rev 28415)
+++ trunk/blender/source/blender/blenkernel/intern/sequencer.c  2010-04-25 
15:39:04 UTC (rev 28416)
@@ -795,6 +795,7 @@
case SEQ_GLOW:   return Glow;
case SEQ_TRANSFORM:  return Transform;
case SEQ_COLOR:  return Color;
+   case SEQ_MULTICAM:   return Multicam;
case SEQ_SPEED:  return Speed;
default:
return 0;
@@ -3449,7 +3450,8 @@
since they work a bit differently to normal image seq's (during transform) 
*/
 int seq_single_check(Sequence *seq)
 {
-   if ( seq-len==1  (seq-type == SEQ_IMAGE || seq-type == SEQ_COLOR))
+   if ( seq-len==1  (seq-type == SEQ_IMAGE || seq-type == SEQ_COLOR
+|| seq-type == SEQ_MULTICAM))
return 1;
else
return 0;

Modified: trunk/blender/source/blender/editors/space_sequencer/sequencer_edit.c
===
--- trunk/blender/source/blender/editors/space_sequencer/sequencer_edit.c   
2010-04-25 15:24:18 UTC (rev 28415)
+++ trunk/blender/source/blender/editors/space_sequencer/sequencer_edit.c   
2010-04-25 15:39:04 UTC (rev 28416)
@@ -2539,9 +2539,9 @@
if(seq) {

/* disallow effect strips */
-   if ((seq-type!=SEQ_COLOR)  (seq-effectdata || seq-seq1 || 
seq-seq2 || seq-seq3))
+   if 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28417] trunk/blender: py api

2010-04-25 Thread Campbell Barton
Revision: 28417
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=28417
Author:   campbellbarton
Date: 2010-04-25 21:27:59 +0200 (Sun, 25 Apr 2010)

Log Message:
---
py api
- mathutils.Color.hsv attribute. eg. material.diffuse_color.hsv = 0.2, 0.8, 0.4
- Vector/Euler/Quaternion/Color now only take a single seq arg.
- internal function for parsing arrays. (cleanup messy internal 
list/vector/tuple/seq parsing)
- didnt update rigify yet.

Modified Paths:
--
trunk/blender/release/scripts/io/export_fbx.py
trunk/blender/release/scripts/io/import_anim_bvh.py
trunk/blender/release/scripts/modules/bpy_types.py
trunk/blender/release/scripts/op/add_mesh_torus.py
trunk/blender/release/scripts/op/object.py
trunk/blender/release/scripts/op/uvcalc_smart_project.py
trunk/blender/release/scripts/op/vertexpaint_dirt.py
trunk/blender/source/blender/python/generic/mathutils.c
trunk/blender/source/blender/python/generic/mathutils.h
trunk/blender/source/blender/python/generic/mathutils_color.c
trunk/blender/source/blender/python/generic/mathutils_euler.c
trunk/blender/source/blender/python/generic/mathutils_quat.c
trunk/blender/source/blender/python/generic/mathutils_vector.c

Modified: trunk/blender/release/scripts/io/export_fbx.py
===
--- trunk/blender/release/scripts/io/export_fbx.py  2010-04-25 15:39:04 UTC 
(rev 28416)
+++ trunk/blender/release/scripts/io/export_fbx.py  2010-04-25 19:27:59 UTC 
(rev 28417)
@@ -54,50 +54,11 @@
 import math # math.pi
 import shutil # for file copying
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-# import Blender
 import bpy
-import mathutils
+from mathutils import Vector, Euler, Matrix, RotationMatrix
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 def copy_file(source, dest):
+# XXX - remove, can use shutil
 file = open(source, 'rb')
 data = file.read()
 file.close()
@@ -135,7 +96,7 @@
 # I guess FBX uses degrees instead of radians (Arystan).
 # Call this function just before writing to FBX.
 def eulerRadToDeg(eul):
-ret = mathutils.Euler()
+ret = Euler()
 
 ret.x = 180 / math.pi * eul[0]
 ret.y = 180 / math.pi * eul[1]
@@ -143,10 +104,10 @@
 
 return ret
 
-mtx4_identity = mathutils.Matrix()
+mtx4_identity = Matrix()
 
 # testing
-mtx_x90= mathutils.RotationMatrix( math.pi/2, 3, 'X') # used
+mtx_x90= RotationMatrix( math.pi/2, 3, 'X') # used
 #mtx_x90n  = RotationMatrix(-90, 3, 'x')
 #mtx_y90   = RotationMatrix( 90, 3, 'y')
 #mtx_y90n  = RotationMatrix(-90, 3, 'y')
@@ -154,11 +115,11 @@
 #mtx_z90n  = RotationMatrix(-90, 3, 'z')
 
 #mtx4_x90  = RotationMatrix( 90, 4, 'x')
-mtx4_x90n  = mathutils.RotationMatrix(-math.pi/2, 4, 'X') # used
+mtx4_x90n  = RotationMatrix(-math.pi/2, 4, 'X') # used
 #mtx4_y90  = RotationMatrix( 90, 4, 'y')
-mtx4_y90n  = mathutils.RotationMatrix(-math.pi/2, 4, 'Y') # used
-mtx4_z90   = mathutils.RotationMatrix( math.pi/2, 4, 'Z') # used
-mtx4_z90n  = mathutils.RotationMatrix(-math.pi/2, 4, 'Z') # used
+mtx4_y90n  = RotationMatrix(-math.pi/2, 4, 'Y') # used
+mtx4_z90   = RotationMatrix( math.pi/2, 4, 'Z') # used
+mtx4_z90n  = RotationMatrix(-math.pi/2, 4, 'Z') # used
 
 # def strip_path(p):
 #  return p.split('\\')[-1].split('/')[-1]
@@ -333,7 +294,7 @@
 EXP_CAMERA =   True,
 EXP_EMPTY =True,
 EXP_IMAGE_COPY =   False,
-GLOBAL_MATRIX =mathutils.Matrix(),
+GLOBAL_MATRIX =Matrix(),
 ANIM_ENABLE =  True,
 ANIM_OPTIMIZE =True,
 ANIM_OPTIMIZE_PRECISSION = 6,
@@ -600,8 +561,8 @@
 matrix_rot = matrix_rot * mtx_x90
 elif type =='CAMERA':
 #  elif ob and type =='Camera':
-y = matrix_rot * mathutils.Vector(0,1,0)
-matrix_rot = mathutils.RotationMatrix(math.pi/2, 3, y) * 
matrix_rot
+y = matrix_rot * Vector((0.0, 1.0, 0.0))
+matrix_rot = RotationMatrix(math.pi/2, 3, y) * matrix_rot
 
 return matrix_rot
 
@@ -702,8 +663,8 @@
 matrix_rot = matrix_rot * mtx_x90
 rot = tuple(matrix_rot.to_euler())
 elif ob and ob.type =='Camera':
-y = matrix_rot * mathutils.Vector(0,1,0)
-matrix_rot = mathutils.RotationMatrix(math.pi/2, 3, y) * 
matrix_rot
+y = matrix_rot * Vector((0.0, 1.0, 0.0))
+matrix_rot = RotationMatrix(math.pi/2, 3, y) * matrix_rot
 rot = tuple(matrix_rot.to_euler())
 else:
 rot = 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28418] trunk/blender/source/blender/ python/intern/bpy_rna.c: [#22151] Modifier UI crash

2010-04-25 Thread Campbell Barton
Revision: 28418
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=28418
Author:   campbellbarton
Date: 2010-04-25 21:56:43 +0200 (Sun, 25 Apr 2010)

Log Message:
---
[#22151] Modifier UI crash
own error when editing context return values. r28401

Modified Paths:
--
trunk/blender/source/blender/python/intern/bpy_rna.c

Modified: trunk/blender/source/blender/python/intern/bpy_rna.c
===
--- trunk/blender/source/blender/python/intern/bpy_rna.c2010-04-25 
19:27:59 UTC (rev 28417)
+++ trunk/blender/source/blender/python/intern/bpy_rna.c2010-04-25 
19:56:43 UTC (rev 28418)
@@ -2243,7 +2243,13 @@
if(done==1) { /* found */
switch(newtype) {
case CTX_DATA_TYPE_POINTER:
-   ret = 
pyrna_struct_CreatePyObject(newptr); /* can return a bpy_struct or None */
+   if(newptr.data == NULL) {
+   ret= Py_None;
+   Py_INCREF(ret);
+   }
+   else {
+   ret= 
pyrna_struct_CreatePyObject(newptr);
+   }
break;
case CTX_DATA_TYPE_COLLECTION:
{
@@ -3906,7 +3912,8 @@
 PyObject *pyrna_struct_CreatePyObject( PointerRNA *ptr )
 {
BPy_StructRNA *pyrna= NULL;
-   
+
+   /* note: don't rely on this to return None since NULL data with a valid 
type can often crash */
if (ptr-data==NULL  ptr-type==NULL) { /* Operator RNA has NULL data 
*/
Py_RETURN_NONE;
}


___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28419] trunk/blender/source/blender/ python/intern/bpy_rna.c: hash function for property-rna.

2010-04-25 Thread Campbell Barton
Revision: 28419
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=28419
Author:   campbellbarton
Date: 2010-04-25 23:13:42 +0200 (Sun, 25 Apr 2010)

Log Message:
---
hash function for property-rna. eg. hash(bpy.context.object.modifiers)

Modified Paths:
--
trunk/blender/source/blender/python/intern/bpy_rna.c

Modified: trunk/blender/source/blender/python/intern/bpy_rna.c
===
--- trunk/blender/source/blender/python/intern/bpy_rna.c2010-04-25 
19:56:43 UTC (rev 28418)
+++ trunk/blender/source/blender/python/intern/bpy_rna.c2010-04-25 
21:13:42 UTC (rev 28419)
@@ -431,9 +431,29 @@
 
 static long pyrna_struct_hash( BPy_StructRNA *self )
 {
-   return (long)self-ptr.data;
+   return _Py_HashPointer(self-ptr.data);
 }
 
+/* from python's meth_hash v3.1.2 */
+static long pyrna_prop_hash(BPy_PropertyRNA *self)
+{  
+   long x,y;
+   if (self-ptr.data == NULL)
+   x = 0;
+   else {
+   x = _Py_HashPointer(self-ptr.data);
+   if (x == -1)
+   return -1;
+   }
+   y = _Py_HashPointer((void*)(self-prop));
+   if (y == -1)
+   return -1;
+   x ^= y;
+   if (x == -1)
+   x = -2;
+   return x;
+}
+
 /* use our own dealloc so we can free a property if we use one */
 static void pyrna_struct_dealloc( BPy_StructRNA *self )
 {
@@ -3490,7 +3510,7 @@
 
/* More standard operations (here for binary compatibility) */
 
-   NULL,   /* hashfunc tp_hash; */
+   ( hashfunc ) pyrna_prop_hash,   /* hashfunc tp_hash; */
NULL,   /* ternaryfunc tp_call; */
NULL,   /* reprfunc tp_str; */
 


___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28420] trunk/blender/source/blender/ python: rna/python mathutils module

2010-04-25 Thread Campbell Barton
Revision: 28420
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=28420
Author:   campbellbarton
Date: 2010-04-26 01:33:09 +0200 (Mon, 26 Apr 2010)

Log Message:
---
rna/python mathutils module
- return euler rotation values from rna now have correct rotation order.
- mathutils.Euler stored rotation order off by 1. (didnt work at all)
- Euler/Quat/Color sliceing working again.

Modified Paths:
--
trunk/blender/source/blender/python/generic/mathutils_color.c
trunk/blender/source/blender/python/generic/mathutils_euler.c
trunk/blender/source/blender/python/generic/mathutils_matrix.c
trunk/blender/source/blender/python/generic/mathutils_quat.c
trunk/blender/source/blender/python/intern/bpy_rna.c

Modified: trunk/blender/source/blender/python/generic/mathutils_color.c
===
--- trunk/blender/source/blender/python/generic/mathutils_color.c   
2010-04-25 21:13:42 UTC (rev 28419)
+++ trunk/blender/source/blender/python/generic/mathutils_color.c   
2010-04-25 23:33:09 UTC (rev 28420)
@@ -27,6 +27,8 @@
 #include BLI_math.h
 #include BKE_utildefines.h
 
+#define COLOR_SIZE 3
+
 //--mathutils.Color() ---
 //makes a new color for you to play with
 static PyObject *Color_new(PyTypeObject * type, PyObject * args, PyObject * 
kwargs)
@@ -37,7 +39,7 @@
case 0:
break;
case 1:
-   if((mathutils_array_parse(col, 3, 3, PyTuple_GET_ITEM(args, 0), 
mathutils.Color())) == -1)
+   if((mathutils_array_parse(col, COLOR_SIZE, COLOR_SIZE, 
PyTuple_GET_ITEM(args, 0), mathutils.Color())) == -1)
return NULL;
break;
default:
@@ -55,15 +57,15 @@
PyObject *ret;
int i;
 
-   ret= PyTuple_New(3);
+   ret= PyTuple_New(COLOR_SIZE);
 
if(ndigits = 0) {
-   for(i= 0; i  3; i++) {
+   for(i= 0; i  COLOR_SIZE; i++) {
PyTuple_SET_ITEM(ret, i, 
PyFloat_FromDouble(double_round((double)self-col[i], ndigits)));
}
}
else {
-   for(i= 0; i  3; i++) {
+   for(i= 0; i  COLOR_SIZE; i++) {
PyTuple_SET_ITEM(ret, i, 
PyFloat_FromDouble(self-col[i]));
}
}
@@ -137,10 +139,10 @@
 
switch (comparison_type){
case Py_EQ:
-   result = EXPP_VectorsAreEqual(colA-col, colB-col, 3, 
1);
+   result = EXPP_VectorsAreEqual(colA-col, colB-col, 
COLOR_SIZE, 1);
break;
case Py_NE:
-   result = !EXPP_VectorsAreEqual(colA-col, colB-col, 3, 
1);
+   result = !EXPP_VectorsAreEqual(colA-col, colB-col, 
COLOR_SIZE, 1);
break;
default:
printf(The result of the comparison could not be 
evaluated);
@@ -158,15 +160,15 @@
 //sequence length
 static int Color_len(ColorObject * self)
 {
-   return 3;
+   return COLOR_SIZE;
 }
 //object[]---
 //sequence accessor (get)
 static PyObject *Color_item(ColorObject * self, int i)
 {
-   if(i0) i= 3-i;
+   if(i0) i= COLOR_SIZE-i;
 
-   if(i  0 || i = 3) {
+   if(i  0 || i = COLOR_SIZE) {
PyErr_SetString(PyExc_IndexError, color[attribute]: array 
index out of range);
return NULL;
}
@@ -188,9 +190,9 @@
return -1;
}
 
-   if(i0) i= 3-i;
+   if(i0) i= COLOR_SIZE-i;
 
-   if(i  0 || i = 3){
+   if(i  0 || i = COLOR_SIZE){
PyErr_SetString(PyExc_IndexError, color[attribute] = x: array 
assignment index out of range\n);
return -1;
}
@@ -212,9 +214,9 @@
if(!BaseMath_ReadCallback(self))
return NULL;
 
-   CLAMP(begin, 0, 3);
-   if (end0) end= 4+end;
-   CLAMP(end, 0, 3);
+   CLAMP(begin, 0, COLOR_SIZE);
+   if (end0) end= (COLOR_SIZE + 1) + end;
+   CLAMP(end, 0, COLOR_SIZE);
begin = MIN2(begin,end);
 
list = PyList_New(end - begin);
@@ -227,61 +229,116 @@
 }
 //object[z:y]
 //sequence slice (set)
-static int Color_ass_slice(ColorObject * self, int begin, int end,
-PyObject * seq)
+static int Color_ass_slice(ColorObject * self, int begin, int end, PyObject * 
seq)
 {
-   int i, y, size = 0;
-   float col[3];
-   PyObject *e;
+   int i, size;
+   float col[COLOR_SIZE];
 
if(!BaseMath_ReadCallback(self))
return -1;
 
-   CLAMP(begin, 0, 3);
-   if (end0) end= 4+end;
-   CLAMP(end, 0, 3);
+   CLAMP(begin, 0, COLOR_SIZE);
+   if (end0) end= (COLOR_SIZE + 1) + end;
+

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28421] trunk/blender/source/blender/ blenkernel/intern: Fix [#22160] blender 2.5 alpha2 can't open file grass. blend from blenderguru

2010-04-25 Thread Matt Ebb
Revision: 28421
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=28421
Author:   broken
Date: 2010-04-26 04:23:13 +0200 (Mon, 26 Apr 2010)

Log Message:
---
Fix  [#22160] blender 2.5 alpha2 can't open file grass.blend from blenderguru

Textures were being called with multitex_ext with osatex enabled, but NULL 
derivates.
Fixed this for texture effectors and a couple of other places.

Modified Paths:
--
trunk/blender/source/blender/blenkernel/intern/brush.c
trunk/blender/source/blender/blenkernel/intern/effect.c

Modified: trunk/blender/source/blender/blenkernel/intern/brush.c
===
--- trunk/blender/source/blender/blenkernel/intern/brush.c  2010-04-25 
23:33:09 UTC (rev 28420)
+++ trunk/blender/source/blender/blenkernel/intern/brush.c  2010-04-26 
02:23:13 UTC (rev 28421)
@@ -930,7 +930,7 @@
co[2]= 0.0f;

/* This is copied from displace modifier code */
-   hasrgb = multitex_ext(mtex-tex, co, NULL, 
NULL, 1, texres);
+   hasrgb = multitex_ext(mtex-tex, co, NULL, 
NULL, 0, texres);

/* if the texture gave an RGB value, we assume 
it didn't give a valid
 * intensity, so calculate one (formula from 
do_material_tex).

Modified: trunk/blender/source/blender/blenkernel/intern/effect.c
===
--- trunk/blender/source/blender/blenkernel/intern/effect.c 2010-04-25 
23:33:09 UTC (rev 28420)
+++ trunk/blender/source/blender/blenkernel/intern/effect.c 2010-04-26 
02:23:13 UTC (rev 28421)
@@ -780,7 +780,7 @@
mul_mat3_m4_v3(eff-ob-obmat, tex_co);
}
 
-   hasrgb = multitex_ext(eff-pd-tex, tex_co, NULL,NULL, 1, result);
+   hasrgb = multitex_ext(eff-pd-tex, tex_co, NULL,NULL, 0, result);
 
if(hasrgb  mode==PFIELD_TEX_RGB) {
force[0] = (0.5f - result-tr) * strength;
@@ -791,15 +791,15 @@
strength/=nabla;
 
tex_co[0] += nabla;
-   multitex_ext(eff-pd-tex, tex_co, NULL, NULL, 1, result+1);
+   multitex_ext(eff-pd-tex, tex_co, NULL, NULL, 0, result+1);
 
tex_co[0] -= nabla;
tex_co[1] += nabla;
-   multitex_ext(eff-pd-tex, tex_co, NULL, NULL, 1, result+2);
+   multitex_ext(eff-pd-tex, tex_co, NULL, NULL, 0, result+2);
 
tex_co[1] -= nabla;
tex_co[2] += nabla;
-   multitex_ext(eff-pd-tex, tex_co, NULL, NULL, 1, result+3);
+   multitex_ext(eff-pd-tex, tex_co, NULL, NULL, 0, result+3);
 
if(mode == PFIELD_TEX_GRAD || !hasrgb) { /* if we dont have rgb 
fall back to grad */
force[0] = (result[0].tin - result[1].tin) * strength;


___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28422] trunk/blender/source/blender: Pass constraint names as operator properties in constraint operators

2010-04-25 Thread Matt Ebb
Revision: 28422
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=28422
Author:   broken
Date: 2010-04-26 05:42:38 +0200 (Mon, 26 Apr 2010)

Log Message:
---
Pass constraint names as operator properties in constraint operators

This is similar to commit revision 22078, but for constraint operators rather 
than modifiers, making it possible to use them from scripting.

Revision Links:
--

http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=22078

Modified Paths:
--
trunk/blender/source/blender/blenkernel/BKE_constraint.h
trunk/blender/source/blender/blenkernel/intern/constraint.c
trunk/blender/source/blender/editors/object/object_constraint.c

Modified: trunk/blender/source/blender/blenkernel/BKE_constraint.h
===
--- trunk/blender/source/blender/blenkernel/BKE_constraint.h2010-04-26 
02:23:13 UTC (rev 28421)
+++ trunk/blender/source/blender/blenkernel/BKE_constraint.h2010-04-26 
03:42:38 UTC (rev 28422)
@@ -130,7 +130,8 @@
 /* Constraint API function prototypes */
 struct bConstraint *constraints_get_active(struct ListBase *list);
 void constraints_set_active(ListBase *list, struct bConstraint *con);
-
+struct bConstraint *constraints_findByName(struct ListBase *list, const char 
*name);
+   
 struct bConstraint *add_ob_constraint(struct Object *ob, const char *name, 
short type);
 struct bConstraint *add_pose_constraint(struct Object *ob, struct bPoseChannel 
*pchan, const char *name, short type);
 

Modified: trunk/blender/source/blender/blenkernel/intern/constraint.c
===
--- trunk/blender/source/blender/blenkernel/intern/constraint.c 2010-04-26 
02:23:13 UTC (rev 28421)
+++ trunk/blender/source/blender/blenkernel/intern/constraint.c 2010-04-26 
03:42:38 UTC (rev 28422)
@@ -36,6 +36,7 @@
 #include MEM_guardedalloc.h
 
 #include BLI_blenlib.h
+#include BLI_listbase.h
 #include BLI_math.h
 #include BLI_editVert.h
 
@@ -4162,6 +4163,11 @@
 
 /* . */
 
+bConstraint *constraints_findByName(ListBase *list, const char *name)
+{
+   return BLI_findstring(list, name, offsetof(bConstraint, name));
+}
+
 /* finds the 'active' constraint in a constraint stack */
 bConstraint *constraints_get_active (ListBase *list)
 {

Modified: trunk/blender/source/blender/editors/object/object_constraint.c
===
--- trunk/blender/source/blender/editors/object/object_constraint.c 
2010-04-26 02:23:13 UTC (rev 28421)
+++ trunk/blender/source/blender/editors/object/object_constraint.c 
2010-04-26 03:42:38 UTC (rev 28422)
@@ -430,28 +430,121 @@
}
 }
 
+
+/ generic functions for operators using constraint 
names and data context */
+
+#define EDIT_CONSTRAINT_OWNER_OBJECT   0
+#define EDIT_CONSTRAINT_OWNER_BONE 1
+
+static EnumPropertyItem constraint_owner_items[] = {
+{EDIT_CONSTRAINT_OWNER_OBJECT, OBJECT, 0, Object, Edit a constraint on 
the active object},
+{EDIT_CONSTRAINT_OWNER_BONE, BONE, 0, Bone, Edit a constraint on the 
active bone},
+{0, NULL, 0, NULL, NULL}};
+
+
+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);
+   
+   if (!ob || ob-id.lib) return 0;
+   if (ptr.data  ((ID*)ptr.id.data)-lib) return 0;
+   
+   return 1;
+}
+
+static int edit_constraint_poll(bContext *C)
+{
+   return edit_constraint_poll_generic(C, RNA_Constraint);
+}
+
+static void edit_constraint_properties(wmOperatorType *ot)
+{
+   RNA_def_string(ot-srna, constraint, , 32, Constraint, Name of 
the constraint to edit);
+   RNA_def_enum(ot-srna, owner, constraint_owner_items, 0, Owner, 
The owner of this constraint);
+}
+
+static int edit_constraint_invoke_properties(bContext *C, wmOperator *op)
+{
+   PointerRNA ptr= CTX_data_pointer_get_type(C, constraint, 
RNA_Constraint);
+   Object *ob= (ptr.id.data)?ptr.id.data:ED_object_active_context(C);
+   bConstraint *con;
+   ListBase *list;
+   
+   if (RNA_property_is_set(op-ptr, constraint)  
RNA_property_is_set(op-ptr, owner))
+   return 1;
+   
+   if (ptr.data) {
+   con = ptr.data;
+   RNA_string_set(op-ptr, constraint, con-name);
+   
+   list = get_constraint_lb(ob, con, NULL);
+   
+   if (ob-constraints == list)
+   RNA_enum_set(op-ptr, owner, 
EDIT_CONSTRAINT_OWNER_OBJECT);
+   else
+   RNA_enum_set(op-ptr, owner, 
EDIT_CONSTRAINT_OWNER_BONE);
+   
+   return 1;
+   }
+   
+   

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28423] trunk/blender/source/blender/ editors/space_text/text_ops.c: Add operator undo flags to text datablock related operators

2010-04-25 Thread Matt Ebb
Revision: 28423
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=28423
Author:   broken
Date: 2010-04-26 06:49:33 +0200 (Mon, 26 Apr 2010)

Log Message:
---
Add operator undo flags to text datablock related operators

Modified Paths:
--
trunk/blender/source/blender/editors/space_text/text_ops.c

Modified: trunk/blender/source/blender/editors/space_text/text_ops.c
===
--- trunk/blender/source/blender/editors/space_text/text_ops.c  2010-04-26 
03:42:38 UTC (rev 28422)
+++ trunk/blender/source/blender/editors/space_text/text_ops.c  2010-04-26 
04:49:33 UTC (rev 28423)
@@ -190,6 +190,9 @@
/* api callbacks */
ot-exec= new_exec;
ot-poll= text_new_poll;
+   
+   /* flags */
+   ot-flag= OPTYPE_UNDO;
 }
 
 /*** open operator */
@@ -288,6 +291,9 @@
ot-cancel= open_cancel;
ot-poll= text_new_poll;
 
+   /* flags */
+   ot-flag= OPTYPE_UNDO;
+   
/* properties */
WM_operator_properties_filesel(ot, FOLDERFILE|TEXTFILE|PYSCRIPTFILE, 
FILE_SPECIAL, FILE_OPENFILE);
RNA_def_boolean(ot-srna, internal, 0, Make internal, Make text 
file internal after loading);
@@ -369,6 +375,9 @@
ot-exec= unlink_exec;
ot-invoke= WM_operator_confirm;
ot-poll= text_edit_poll;
+   
+   /* flags */
+   ot-flag= OPTYPE_UNDO;
 }
 
 /*** make internal operator */
@@ -400,6 +409,9 @@
/* api callbacks */
ot-exec= make_internal_exec;
ot-poll= text_edit_poll;
+   
+   /* flags */
+   ot-flag= OPTYPE_UNDO;
 }
 
 /*** save operator */
@@ -749,7 +761,7 @@
/* api callbacks */
ot-exec= paste_exec;
ot-poll= text_edit_poll;
-
+   
/* properties */
RNA_def_boolean(ot-srna, selection, 0, Selection, Paste text 
selected elsewhere rather than copied, X11 only.);
 }


___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs