[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36762] trunk/blender/source/blender/ blenloader/intern/readfile.c: fix [#27437] Appending armatures with custom bone shapes brings no custom objects

2011-05-19 Thread Campbell Barton
Revision: 36762
  
http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=36762
Author:   campbellbarton
Date: 2011-05-19 06:17:44 + (Thu, 19 May 2011)
Log Message:
---
fix [#27437] Appending armatures with custom bone shapes brings no custom 
objects into scene.. impossible to edit

Modified Paths:
--
trunk/blender/source/blender/blenloader/intern/readfile.c

Modified: trunk/blender/source/blender/blenloader/intern/readfile.c
===
--- trunk/blender/source/blender/blenloader/intern/readfile.c   2011-05-19 
04:28:09 UTC (rev 36761)
+++ trunk/blender/source/blender/blenloader/intern/readfile.c   2011-05-19 
06:17:44 UTC (rev 36762)
@@ -4140,7 +4140,7 @@
bActuator *act;
int a;

-   /* weak weak... this was only meant as draw flag, now is used in 
give_base too */
+   /* weak weak... this was only meant as draw flag, now is used in 
give_base_to_objects too */
ob-flag = ~OB_FROMGROUP;
 
/* loading saved files with editmode enabled works, but for undo we like
@@ -12735,12 +12735,22 @@

int do_it= 0;

-   if(ob-id.us==0)
+   if(ob-id.us==0) {
do_it= 1;
-   else if(ob-id.us==1  lib)
-   if(ob-id.lib==lib  (ob-flag  
OB_FROMGROUP)  object_in_any_scene(mainvar, ob)==0)
+   }
+   else if (lib==NULL) { /* appending */
+   if(object_in_any_scene(mainvar, ob)==0) 
{
+   /* when appending, make sure 
any indirectly loaded objects
+* get a base else they cant be 
accessed at all [#27437] */
do_it= 1;
-   
+   }
+   }
+   else if(ob-id.us==1  lib) {
+   if(ob-id.lib==lib  (ob-flag  
OB_FROMGROUP)  object_in_any_scene(mainvar, ob)==0) {
+   do_it= 1;
+   }
+   }
+
if(do_it) {
base= MEM_callocN( sizeof(Base), 
add_ext_base);
BLI_addtail((sce-base), base);
@@ -13010,6 +13020,9 @@
give_base_to_objects(mainvar, scene, NULL, 0);
}
}
+   else {
+   printf(library_append_end, scene is NULL (objects wont get 
bases)\n);
+   }
/* has been removed... erm, why? s..ton) */
/* 20040907: looks like they are give base already in 
append_named_part(); -Nathan L */
/* 20041208: put back. It only linked direct, not indirect objects 
(ton) */

___
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 [36763] trunk/blender/release/scripts/ modules/bpy/path.py: fix [#27432] [2.57/scripts/modules/bpy/path.py:169] can't concat bytes to str

2011-05-19 Thread Campbell Barton
Revision: 36763
  
http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=36763
Author:   campbellbarton
Date: 2011-05-19 06:27:39 + (Thu, 19 May 2011)
Log Message:
---
fix [#27432] [2.57/scripts/modules/bpy/path.py:169] can't concat bytes to str

Modified Paths:
--
trunk/blender/release/scripts/modules/bpy/path.py

Modified: trunk/blender/release/scripts/modules/bpy/path.py
===
--- trunk/blender/release/scripts/modules/bpy/path.py   2011-05-19 06:17:44 UTC 
(rev 36762)
+++ trunk/blender/release/scripts/modules/bpy/path.py   2011-05-19 06:27:39 UTC 
(rev 36763)
@@ -135,7 +135,7 @@
 filename = os.path.basename(path)  # filename may be a directory or a 
file
 dirpath = os.path.dirname(path)
 
-suffix = 
+suffix = path[:0]  #  but ensure byte/str match
 if not filename:  # dir ends with a slash?
 if len(dirpath)  len(path):
 suffix = path[:len(path) - len(dirpath)]

___
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 [36764] branches/soc-2011-sven/: Private branch for Node Engine research project

2011-05-19 Thread Benoit Bolsee
Revision: 36764
  
http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=36764
Author:   ben2610
Date: 2011-05-19 07:26:43 + (Thu, 19 May 2011)
Log Message:
---
Private branch for Node Engine research project

Added Paths:
---
branches/soc-2011-sven/

___
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 [36765] trunk/blender/source/blender/ editors/gpencil/gpencil_edit.c: converting grease pencil now works in the camera view.

2011-05-19 Thread Campbell Barton
Revision: 36765
  
http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=36765
Author:   campbellbarton
Date: 2011-05-19 07:43:10 + (Thu, 19 May 2011)
Log Message:
---
converting grease pencil now works in the camera view.

Modified Paths:
--
trunk/blender/source/blender/editors/gpencil/gpencil_edit.c

Modified: trunk/blender/source/blender/editors/gpencil/gpencil_edit.c
===
--- trunk/blender/source/blender/editors/gpencil/gpencil_edit.c 2011-05-19 
07:26:43 UTC (rev 36764)
+++ trunk/blender/source/blender/editors/gpencil/gpencil_edit.c 2011-05-19 
07:43:10 UTC (rev 36765)
@@ -365,7 +365,7 @@
 /* convert the coordinates from the given stroke point into 3d-coordinates 
  * - assumes that the active space is the 3D-View
  */
-static void gp_strokepoint_convertcoords (bContext *C, bGPDstroke *gps, 
bGPDspoint *pt, float p3d[3])
+static void gp_strokepoint_convertcoords (bContext *C, bGPDstroke *gps, 
bGPDspoint *pt, float p3d[3], rctf *subrect)
 {
Scene *scene= CTX_data_scene(C);
View3D *v3d= CTX_wm_view3d(C);
@@ -377,7 +377,6 @@
}
else {
float *fp= give_cursor(scene, v3d);
-   int mval[2];
int mx, my;

/* get screen coordinate */
@@ -386,29 +385,33 @@
UI_view2d_view_to_region(v2d, pt-x, pt-y, mx, my);
}
else {
-   mx= (int)(pt-x / 100 * ar-winx);
-   my= (int)(pt-y / 100 * ar-winy);
+   if(subrect) {
+   mx= (int)((pt-x/100.0f) * (subrect-xmax - 
subrect-xmin)) + subrect-xmin;
+   my= (int)((pt-y/100.0f) * (subrect-ymax - 
subrect-ymin)) + subrect-ymin;
+   }
+   else {
+   mx= (int)(pt-x / 100 * ar-winx);
+   my= (int)(pt-y / 100 * ar-winy);
+   }
}
-   mval[0]= mx;
-   mval[1]= my;

/* convert screen coordinate to 3d coordinates 
 *  - method taken from editview.c - mouse_cursor() 
 */
-   window_to_3d(ar, p3d, fp, mval[0], mval[1]);
+   window_to_3d(ar, p3d, fp, mx, my);
}
 }
 
 /* --- */
 
 /* convert stroke to 3d path */
-static void gp_stroke_to_path (bContext *C, bGPDlayer *gpl, bGPDstroke *gps, 
Curve *cu)
+static void gp_stroke_to_path (bContext *C, bGPDlayer *gpl, bGPDstroke *gps, 
Curve *cu, rctf *subrect)
 {
bGPDspoint *pt;
Nurb *nu;
BPoint *bp;
int i;
-   
+
/* create new 'nurb' within the curve */
nu = (Nurb *)MEM_callocN(sizeof(Nurb), gpstroke_to_path(nurb));

@@ -425,7 +428,7 @@
float p3d[3];

/* get coordinates to add at */
-   gp_strokepoint_convertcoords(C, gps, pt, p3d);
+   gp_strokepoint_convertcoords(C, gps, pt, p3d, subrect);
copy_v3_v3(bp-vec, p3d);

/* set settings */
@@ -437,8 +440,27 @@
BLI_addtail(cu-nurb, nu);
 }
 
+static int gp_camera_view_subrect(bContext *C, rctf *subrect)
+{
+   Scene *scene= CTX_data_scene(C);
+   View3D *v3d= CTX_wm_view3d(C);
+   ARegion *ar= CTX_wm_region(C);
+
+   if (v3d) {
+   RegionView3D *rv3d= ar-regiondata;
+
+   /* for camera view set the subrect */
+   if (rv3d-persp == RV3D_CAMOB) {
+   view3d_calc_camera_border(scene, ar, NULL, v3d, 
subrect, -1); /* negative shift */
+   return 1;
+   }
+   }
+
+   return 0;
+}
+
 /* convert stroke to 3d bezier */
-static void gp_stroke_to_bezier (bContext *C, bGPDlayer *gpl, bGPDstroke *gps, 
Curve *cu)
+static void gp_stroke_to_bezier (bContext *C, bGPDlayer *gpl, bGPDstroke *gps, 
Curve *cu, rctf *subrect)
 {
bGPDspoint *pt;
Nurb *nu;
@@ -460,9 +482,9 @@
/* get initial coordinates */
pt=gps-points;
if (tot) {
-   gp_strokepoint_convertcoords(C, gps, pt, p3d_cur);
+   gp_strokepoint_convertcoords(C, gps, pt, p3d_cur, subrect);
if (tot  1) {
-   gp_strokepoint_convertcoords(C, gps, pt+1, p3d_next);
+   gp_strokepoint_convertcoords(C, gps, pt+1, p3d_next, 
subrect);
}
}
 
@@ -490,7 +512,7 @@
copy_v3_v3(p3d_cur, p3d_next);
 
if (i + 1  tot) {
-   gp_strokepoint_convertcoords(C, gps, pt+1, p3d_next);
+   gp_strokepoint_convertcoords(C, gps, pt+1, p3d_next, 
subrect);
}
}
 
@@ -509,7 +531,10 @@
bGPDstroke *gps;

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36766] trunk/blender/source/blender/ editors: change window_to_3d to take screen coords as floats.

2011-05-19 Thread Campbell Barton
Revision: 36766
  
http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=36766
Author:   campbellbarton
Date: 2011-05-19 07:55:48 + (Thu, 19 May 2011)
Log Message:
---
change window_to_3d to take screen coords as floats.

Modified Paths:
--
trunk/blender/source/blender/editors/gpencil/gpencil_edit.c
trunk/blender/source/blender/editors/include/ED_view3d.h
trunk/blender/source/blender/editors/space_view3d/view3d_edit.c
trunk/blender/source/blender/editors/space_view3d/view3d_view.c

Modified: trunk/blender/source/blender/editors/gpencil/gpencil_edit.c
===
--- trunk/blender/source/blender/editors/gpencil/gpencil_edit.c 2011-05-19 
07:43:10 UTC (rev 36765)
+++ trunk/blender/source/blender/editors/gpencil/gpencil_edit.c 2011-05-19 
07:55:48 UTC (rev 36766)
@@ -377,24 +377,27 @@
}
else {
float *fp= give_cursor(scene, v3d);
-   int mx, my;
+   float mx, my;

/* get screen coordinate */
if (gps-flag  GP_STROKE_2DSPACE) {
+   int mxi, myi;
View2D *v2d= ar-v2d;
-   UI_view2d_view_to_region(v2d, pt-x, pt-y, mx, my);
+   UI_view2d_view_to_region(v2d, pt-x, pt-y, mxi, myi);
+   mx= mxi;
+   my= myi;
}
else {
if(subrect) {
-   mx= (int)((pt-x/100.0f) * (subrect-xmax - 
subrect-xmin)) + subrect-xmin;
-   my= (int)((pt-y/100.0f) * (subrect-ymax - 
subrect-ymin)) + subrect-ymin;
+   mx= (((float)pt-x/100.0f) * (subrect-xmax - 
subrect-xmin)) + subrect-xmin;
+   my= (((float)pt-y/100.0f) * (subrect-ymax - 
subrect-ymin)) + subrect-ymin;
}
else {
-   mx= (int)(pt-x / 100 * ar-winx);
-   my= (int)(pt-y / 100 * ar-winy);
+   mx= (float)pt-x / 100.0f * ar-winx;
+   my= (float)pt-y / 100.0f * ar-winy;
}
}
-   
+
/* convert screen coordinate to 3d coordinates 
 *  - method taken from editview.c - mouse_cursor() 
 */

Modified: trunk/blender/source/blender/editors/include/ED_view3d.h
===
--- trunk/blender/source/blender/editors/include/ED_view3d.h2011-05-19 
07:43:10 UTC (rev 36765)
+++ trunk/blender/source/blender/editors/include/ED_view3d.h2011-05-19 
07:55:48 UTC (rev 36766)
@@ -80,9 +80,9 @@
 float *give_cursor(struct Scene *scene, struct View3D *v3d);
 
 int initgrabz(struct RegionView3D *rv3d, float x, float y, float z);
-void window_to_3d(struct ARegion *ar, float out[3], const float depth_pt[3], 
const int mx, const int my);
-void window_to_3d_delta(struct ARegion *ar, float out[3], const int mx, const 
int my);
-void window_to_3d_vector(struct ARegion *ar, float out[3], const int mx, const 
int my);
+void window_to_3d(struct ARegion *ar, float out[3], const float depth_pt[3], 
const float mx, const float my);
+void window_to_3d_delta(struct ARegion *ar, float out[3], const float mx, 
const float my);
+void window_to_3d_vector(struct ARegion *ar, float out[3], const float mx, 
const float my);
 void view3d_unproject(struct bglMats *mats, float out[3], const short x, const 
short y, const float z);
 
 /* Depth buffer */

Modified: trunk/blender/source/blender/editors/space_view3d/view3d_edit.c
===
--- trunk/blender/source/blender/editors/space_view3d/view3d_edit.c 
2011-05-19 07:43:10 UTC (rev 36765)
+++ trunk/blender/source/blender/editors/space_view3d/view3d_edit.c 
2011-05-19 07:55:48 UTC (rev 36766)
@@ -1074,7 +1074,7 @@
float tvec[3];
float tpos[3];
float new_dist;
-   short vb[2], mouseloc[2];
+   int vb[2], mouseloc[2];
 
mouseloc[0]= mx - ar-winrct.xmin;
mouseloc[1]= my - ar-winrct.ymin;
@@ -1087,7 +1087,7 @@
 
/* Project cursor position into 3D space */
initgrabz(rv3d, tpos[0], tpos[1], tpos[2]);
-   window_to_3d_delta(ar, dvec, mouseloc[0]-vb[0]/2, 
mouseloc[1]-vb[1]/2);
+   window_to_3d_delta(ar, dvec, mouseloc[0]-vb[0]/2.0f, 
mouseloc[1]-vb[1]/2.0f);
 
/* Calculate view target position for dolly */
add_v3_v3v3(tvec, tpos, dvec);

Modified: trunk/blender/source/blender/editors/space_view3d/view3d_view.c
===
--- 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36767] branches/soc-2011-sven: port initial node logic code from old nodelogic branch

2011-05-19 Thread Benoit Bolsee
Revision: 36767
  
http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=36767
Author:   ben2610
Date: 2011-05-19 08:50:32 + (Thu, 19 May 2011)
Log Message:
---
port initial node logic code from old nodelogic branch

Modified Paths:
--
branches/soc-2011-sven/source/blender/windowmanager/CMakeLists.txt
branches/soc-2011-sven/source/blender/windowmanager/SConscript
branches/soc-2011-sven/source/blender/windowmanager/intern/wm_init_exit.c
branches/soc-2011-sven/source/creator/CMakeLists.txt
branches/soc-2011-sven/source/gameengine/CMakeLists.txt
branches/soc-2011-sven/source/gameengine/SConscript

Added Paths:
---
branches/soc-2011-sven/release/scripts/modules/NodeLogic/
branches/soc-2011-sven/release/scripts/modules/NodeLogic/__init__.py
branches/soc-2011-sven/release/scripts/modules/NodeLogic/types.py
branches/soc-2011-sven/source/gameengine/NodeLogic/
branches/soc-2011-sven/source/gameengine/NodeLogic/CMakeLists.txt
branches/soc-2011-sven/source/gameengine/NodeLogic/NL_DList.h
branches/soc-2011-sven/source/gameengine/NodeLogic/NL_ILinkData.h
branches/soc-2011-sven/source/gameengine/NodeLogic/NL_INode.h
branches/soc-2011-sven/source/gameengine/NodeLogic/NL_INodePin.h
branches/soc-2011-sven/source/gameengine/NodeLogic/NL_IQueueItem.h
branches/soc-2011-sven/source/gameengine/NodeLogic/NL_Node.cpp
branches/soc-2011-sven/source/gameengine/NodeLogic/NL_Node.h
branches/soc-2011-sven/source/gameengine/NodeLogic/NL_NodeEngine.cpp
branches/soc-2011-sven/source/gameengine/NodeLogic/NL_NodeEngine.h
branches/soc-2011-sven/source/gameengine/NodeLogic/NL_NodeGraph.cpp
branches/soc-2011-sven/source/gameengine/NodeLogic/NL_NodeGraph.h
branches/soc-2011-sven/source/gameengine/NodeLogic/NL_NodeLink.cpp
branches/soc-2011-sven/source/gameengine/NodeLogic/NL_NodeLink.h
branches/soc-2011-sven/source/gameengine/NodeLogic/NL_NodeLogic.cpp
branches/soc-2011-sven/source/gameengine/NodeLogic/NL_NodeLogic.h
branches/soc-2011-sven/source/gameengine/NodeLogic/NL_NodePin.cpp
branches/soc-2011-sven/source/gameengine/NodeLogic/NL_NodePin.h
branches/soc-2011-sven/source/gameengine/NodeLogic/NL_NodePushInputPin.h
branches/soc-2011-sven/source/gameengine/NodeLogic/NL_QList.h
branches/soc-2011-sven/source/gameengine/NodeLogic/SConscript

Added: branches/soc-2011-sven/release/scripts/modules/NodeLogic/__init__.py
===
--- branches/soc-2011-sven/release/scripts/modules/NodeLogic/__init__.py
(rev 0)
+++ branches/soc-2011-sven/release/scripts/modules/NodeLogic/__init__.py
2011-05-19 08:50:32 UTC (rev 36767)
@@ -0,0 +1,48 @@
+# bring all the builtin functions in NodeLogic
+from _NodeLogic import *
+# type database for GUI
+from NodeLogic import types
+
+# load nodes
+from bpy import utils
+import sys
+DEBUG = (-d in sys.argv)
+
+def load_nodes(reload_nodes=False):
+import os
+import traceback
+import time
+t_main = time.time()
+
+def test_import(module_name):
+try:
+t = time.time()
+ret= __import__(module_name)
+if DEBUG:
+print(time %s %.4f % (module_name, time.time() - t))
+return ret
+except:
+traceback.print_exc()
+return None
+
+
+for base_path in utils.script_paths():
+for path_subdir in (nodes,):
+path = os.path.join(base_path, path_subdir)
+if os.path.isdir(path):
+sys.path.insert(0, path)
+for f in sorted(os.listdir(path)):
+if f.endswith(.py):
+# python module
+mod = test_import(f[0:-3])
+elif . not in f:
+# python package
+mod = test_import(f)
+else:
+mod = None
+
+if reload_nodes and mod:
+print(Reloading:, mod)
+reload(mod)
+
+load_nodes()


Property changes on: 
branches/soc-2011-sven/release/scripts/modules/NodeLogic/__init__.py
___
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Added: branches/soc-2011-sven/release/scripts/modules/NodeLogic/types.py
===
--- branches/soc-2011-sven/release/scripts/modules/NodeLogic/types.py   
(rev 0)
+++ branches/soc-2011-sven/release/scripts/modules/NodeLogic/types.py   
2011-05-19 08:50:32 UTC (rev 36767)
@@ -0,0 +1,29 @@
+# define data types for pins.
+# These are just placeholders, only the name is used in the UI to match
+# The poll function is used by the UI to determine which data types are 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36768] trunk/blender/release/scripts/ startup/bl_ui: py/ui edit: change InputKeyMapPanel to be a mix-in class only (not a subclass of Panel ), it mes

2011-05-19 Thread Campbell Barton
Revision: 36768
  
http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=36768
Author:   campbellbarton
Date: 2011-05-19 09:52:11 + (Thu, 19 May 2011)
Log Message:
---
py/ui edit: change InputKeyMapPanel to be a mix-in class only (not a subclass 
of Panel), it messes up re-registering panels.

Modified Paths:
--
trunk/blender/release/scripts/startup/bl_ui/space_userpref.py
trunk/blender/release/scripts/startup/bl_ui/space_userpref_keymap.py

Modified: trunk/blender/release/scripts/startup/bl_ui/space_userpref.py
===
--- trunk/blender/release/scripts/startup/bl_ui/space_userpref.py   
2011-05-19 08:50:32 UTC (rev 36767)
+++ trunk/blender/release/scripts/startup/bl_ui/space_userpref.py   
2011-05-19 09:52:11 UTC (rev 36768)
@@ -752,7 +752,7 @@
 from bl_ui.space_userpref_keymap import InputKeyMapPanel
 
 
-class USERPREF_PT_input(InputKeyMapPanel):
+class USERPREF_PT_input(bpy.types.Panel, InputKeyMapPanel):
 bl_space_type = 'USER_PREFERENCES'
 bl_label = Input
 

Modified: trunk/blender/release/scripts/startup/bl_ui/space_userpref_keymap.py
===
--- trunk/blender/release/scripts/startup/bl_ui/space_userpref_keymap.py
2011-05-19 08:50:32 UTC (rev 36767)
+++ trunk/blender/release/scripts/startup/bl_ui/space_userpref_keymap.py
2011-05-19 09:52:11 UTC (rev 36768)
@@ -138,7 +138,7 @@
 bpy.types.Menu.draw_preset(self, context)
 
 
-class InputKeyMapPanel(bpy.types.Panel):
+class InputKeyMapPanel:
 bl_space_type = 'USER_PREFERENCES'
 bl_label = Input
 bl_region_type = 'WINDOW'

___
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 [36769] trunk/blender/source/blender/ editors/interface/interface_handlers.c: UI: fix menus getting closed too quick when moving mouse not exactly tow

2011-05-19 Thread Brecht Van Lommel
Revision: 36769
  
http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=36769
Author:   blendix
Date: 2011-05-19 11:05:34 + (Thu, 19 May 2011)
Log Message:
---
UI: fix menus getting closed too quick when moving mouse not exactly towards
them, noticeable for the vertex groups or material slot utility menus.

Modified Paths:
--
trunk/blender/source/blender/editors/interface/interface_handlers.c

Modified: trunk/blender/source/blender/editors/interface/interface_handlers.c
===
--- trunk/blender/source/blender/editors/interface/interface_handlers.c 
2011-05-19 09:52:11 UTC (rev 36768)
+++ trunk/blender/source/blender/editors/interface/interface_handlers.c 
2011-05-19 11:05:34 UTC (rev 36769)
@@ -5534,10 +5534,6 @@
int closer;
 
if(!menu-dotowards) return 0;
-   if((block-direction  UI_TOP) || (block-direction  UI_DOWN)) {
-   menu-dotowards= 0;
-   return menu-dotowards;
-   }
 
/* verify that we are moving towards one of the edges of the
 * menu block, in other words, in the triangle formed by the

___
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 [36770] trunk/blender/source/blender/ editors/screen/screendump.c: screenshot operator can now be executed directly.

2011-05-19 Thread Campbell Barton
Revision: 36770
  
http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=36770
Author:   campbellbarton
Date: 2011-05-19 11:13:35 + (Thu, 19 May 2011)
Log Message:
---
screenshot operator can now be executed directly.
so python can screenshot with: 
bpy.ops.screen.screenshot(filepath=some_image.png):

Modified Paths:
--
trunk/blender/source/blender/editors/screen/screendump.c

Modified: trunk/blender/source/blender/editors/screen/screendump.c
===
--- trunk/blender/source/blender/editors/screen/screendump.c2011-05-19 
11:05:34 UTC (rev 36769)
+++ trunk/blender/source/blender/editors/screen/screendump.c2011-05-19 
11:13:35 UTC (rev 36770)
@@ -72,41 +72,6 @@
int dumpsx, dumpsy;
 } ScreenshotData;
 
-static int screenshot_exec(bContext *C, wmOperator *op)
-{
-   ScreenshotData *scd= op-customdata;
-   
-   if(scd) {
-   if(scd-dumprect) {
-   Scene *scene= CTX_data_scene(C);
-   ImBuf *ibuf;
-   char path[FILE_MAX];
-   
-   RNA_string_get(op-ptr, filepath, path);
-   
-   strcpy(G.ima, path);
-   BLI_path_abs(path, G.main-name);
-   
-   /* BKE_add_image_extension() checks for if extension 
was already set */
-   if(scene-r.scemode  R_EXTENSION) 
-   if(strlen(path)FILE_MAXDIR+FILE_MAXFILE-5)
-   BKE_add_image_extension(path, 
scene-r.imtype);
-   
-   ibuf= IMB_allocImBuf(scd-dumpsx, scd-dumpsy, 24, 0);
-   ibuf-rect= scd-dumprect;
-   
-   BKE_write_ibuf(ibuf, path, scene-r.imtype, 
scene-r.subimtype, scene-r.quality);
-
-   IMB_freeImBuf(ibuf);
-
-   MEM_freeN(scd-dumprect);
-   }
-   MEM_freeN(scd);
-   op-customdata= NULL;
-   }
-   return OPERATOR_FINISHED;
-}
-
 /* get shot from frontbuffer */
 static unsigned int *screenshot(bContext *C, int *dumpsx, int *dumpsy, int 
fscreen)
 {
@@ -140,8 +105,8 @@
return dumprect;
 }
 
-
-static int screenshot_invoke(bContext *C, wmOperator *op, wmEvent 
*UNUSED(event))
+/* call from both exec and invoke */
+static int screenshot_data_create(bContext *C, wmOperator *op)
 {
unsigned int *dumprect;
int dumpsx, dumpsy;
@@ -154,7 +119,68 @@
scd-dumpsy= dumpsy;
scd-dumprect= dumprect;
op-customdata= scd;
-   
+   return TRUE;
+   }
+   else {
+   op-customdata= NULL;
+   return FALSE;
+   }
+}
+
+static void screenshot_data_free(wmOperator *op)
+{
+   ScreenshotData *scd= op-customdata;
+
+   if(scd) {
+   if(scd-dumprect)
+   MEM_freeN(scd-dumprect);
+   MEM_freeN(scd);
+   op-customdata= NULL;
+   }
+}
+
+static int screenshot_exec(bContext *C, wmOperator *op)
+{
+   ScreenshotData *scd= op-customdata;
+
+   if(scd == NULL) {
+   /* when running exec directly */
+   screenshot_data_create(C, op);
+   scd= op-customdata;
+   }
+
+   if(scd) {
+   if(scd-dumprect) {
+   Scene *scene= CTX_data_scene(C);
+   ImBuf *ibuf;
+   char path[FILE_MAX];
+
+   RNA_string_get(op-ptr, filepath, path);
+
+   strcpy(G.ima, path);
+   BLI_path_abs(path, G.main-name);
+
+   /* BKE_add_image_extension() checks for if extension 
was already set */
+   if(scene-r.scemode  R_EXTENSION)
+   if(strlen(path)FILE_MAXDIR+FILE_MAXFILE-5)
+   BKE_add_image_extension(path, 
scene-r.imtype);
+
+   ibuf= IMB_allocImBuf(scd-dumpsx, scd-dumpsy, 24, 0);
+   ibuf-rect= scd-dumprect;
+
+   BKE_write_ibuf(ibuf, path, scene-r.imtype, 
scene-r.subimtype, scene-r.quality);
+
+   IMB_freeImBuf(ibuf);
+   }
+   }
+
+   screenshot_data_free(op);
+   return OPERATOR_FINISHED;
+}
+
+static int screenshot_invoke(bContext *C, wmOperator *op, wmEvent 
*UNUSED(event))
+{
+   if(screenshot_data_create(C, op)) {
if(RNA_property_is_set(op-ptr, filepath))
return screenshot_exec(C, op);

@@ -169,14 +195,7 @@
 
 static int screenshot_cancel(bContext *UNUSED(C), wmOperator *op)
 {
-   ScreenshotData *scd= op-customdata;
-
-   if(scd) {
-   if(scd-dumprect)
-

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36771] trunk/blender/source/blender/ editors/interface/interface_layout.c: UI: fix direction properties not showing the right direction editing widge

2011-05-19 Thread Brecht Van Lommel
Revision: 36771
  
http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=36771
Author:   blendix
Date: 2011-05-19 11:18:09 + (Thu, 19 May 2011)
Log Message:
---
UI: fix direction properties not showing the right direction editing widget,
code was there but in the wrong location. This makes the opengl lights in
the user preferences show that widget again as in 2.4.

Modified Paths:
--
trunk/blender/source/blender/editors/interface/interface_layout.c

Modified: trunk/blender/source/blender/editors/interface/interface_layout.c
===
--- trunk/blender/source/blender/editors/interface/interface_layout.c   
2011-05-19 11:13:35 UTC (rev 36770)
+++ trunk/blender/source/blender/editors/interface/interface_layout.c   
2011-05-19 11:18:09 UTC (rev 36771)
@@ -418,6 +418,9 @@
but-type= NUMSLI;
}
}
+   else if(subtype == PROP_DIRECTION) {
+   uiDefButR(block, BUT_NORMAL, 0, name, x, y, UI_UNIT_X*3, 
UI_UNIT_Y*3, ptr, RNA_property_identifier(prop), 0, 0, 0, -1, -1, NULL);
+   }
else {
if(ELEM(subtype, PROP_COLOR, PROP_COLOR_GAMMA)  !expand)
uiDefAutoButR(block, ptr, prop, -1, , ICON_NONE, 0, 
0, w, UI_UNIT_Y);
@@ -533,9 +536,6 @@
/* BUTTONS_OT_file_browse calls uiFileBrowseContextProperty */
but= uiDefIconButO(block, BUT, BUTTONS_OT_file_browse, 
WM_OP_INVOKE_DEFAULT, ICON_FILESEL, x, y, UI_UNIT_X, h, NULL);
}
-   else if(subtype == PROP_DIRECTION) {
-   uiDefButR(block, BUT_NORMAL, 0, name, x, y, 100, 100, ptr, 
RNA_property_identifier(prop), index, 0, 0, -1, -1, NULL);
-   }
else if(flag  UI_ITEM_R_EVENT) {
uiDefButR(block, KEYEVT, 0, name, x, y, w, h, ptr, 
RNA_property_identifier(prop), index, 0, 0, -1, -1, NULL);
}

___
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 [36772] trunk/blender/source/blender/ blenkernel: Add localize_lamp and localize_world functions as already existed for materials

2011-05-19 Thread Brecht Van Lommel
Revision: 36772
  
http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=36772
Author:   blendix
Date: 2011-05-19 11:21:37 + (Thu, 19 May 2011)
Log Message:
---
Add localize_lamp and localize_world functions as already existed for materials
and textures, unused still.

Modified Paths:
--
trunk/blender/source/blender/blenkernel/BKE_object.h
trunk/blender/source/blender/blenkernel/BKE_world.h
trunk/blender/source/blender/blenkernel/intern/material.c
trunk/blender/source/blender/blenkernel/intern/object.c
trunk/blender/source/blender/blenkernel/intern/world.c

Modified: trunk/blender/source/blender/blenkernel/BKE_object.h
===
--- trunk/blender/source/blender/blenkernel/BKE_object.h2011-05-19 
11:18:09 UTC (rev 36771)
+++ trunk/blender/source/blender/blenkernel/BKE_object.h2011-05-19 
11:21:37 UTC (rev 36772)
@@ -83,6 +83,7 @@

 void *add_lamp(const char *name);
 struct Lamp *copy_lamp(struct Lamp *la);
+struct Lamp *localize_lamp(struct Lamp *la);
 void make_local_lamp(struct Lamp *la);
 void free_camera(struct Camera *ca);
 void free_lamp(struct Lamp *la);

Modified: trunk/blender/source/blender/blenkernel/BKE_world.h
===
--- trunk/blender/source/blender/blenkernel/BKE_world.h 2011-05-19 11:18:09 UTC 
(rev 36771)
+++ trunk/blender/source/blender/blenkernel/BKE_world.h 2011-05-19 11:21:37 UTC 
(rev 36772)
@@ -40,6 +40,7 @@
 void free_world(struct World *sc); 
 struct World *add_world(const char *name);
 struct World *copy_world(struct World *wrld);
+struct World *localize_world(struct World *wrld);
 void make_local_world(struct World *wrld);
 
 #endif

Modified: trunk/blender/source/blender/blenkernel/intern/material.c
===
--- trunk/blender/source/blender/blenkernel/intern/material.c   2011-05-19 
11:18:09 UTC (rev 36771)
+++ trunk/blender/source/blender/blenkernel/intern/material.c   2011-05-19 
11:21:37 UTC (rev 36772)
@@ -258,9 +258,8 @@

man-preview = NULL;

-   if(ma-nodetree) {
+   if(ma-nodetree)
man-nodetree= ntreeLocalize(ma-nodetree);
-   }

man-gpumaterial.first= man-gpumaterial.last= NULL;


Modified: trunk/blender/source/blender/blenkernel/intern/object.c
===
--- trunk/blender/source/blender/blenkernel/intern/object.c 2011-05-19 
11:18:09 UTC (rev 36771)
+++ trunk/blender/source/blender/blenkernel/intern/object.c 2011-05-19 
11:21:37 UTC (rev 36772)
@@ -867,12 +867,33 @@

lan-curfalloff = curvemapping_copy(la-curfalloff);

-#if 0 // XXX old animation system
-   id_us_plus((ID *)lan-ipo);
-#endif // XXX old animation system
+   if(la-preview)
+   lan-preview = BKE_previewimg_copy(la-preview);
+   
+   return lan;
+}
 
-   if (la-preview) lan-preview = BKE_previewimg_copy(la-preview);
+Lamp *localize_lamp(Lamp *la)
+{
+   Lamp *lan;
+   int a;

+   lan= copy_libblock(la);
+   BLI_remlink(G.main-lamp, lan);
+
+   for(a=0; aMAX_MTEX; a++) {
+   if(lan-mtex[a]) {
+   lan-mtex[a]= MEM_mallocN(sizeof(MTex), 
localize_lamp);
+   memcpy(lan-mtex[a], la-mtex[a], sizeof(MTex));
+   /* free lamp decrements */
+   id_us_plus((ID *)lan-mtex[a]-tex);
+   }
+   }
+   
+   lan-curfalloff = curvemapping_copy(la-curfalloff);
+
+   lan-preview= NULL;
+   
return lan;
 }
 

Modified: trunk/blender/source/blender/blenkernel/intern/world.c
===
--- trunk/blender/source/blender/blenkernel/intern/world.c  2011-05-19 
11:18:09 UTC (rev 36771)
+++ trunk/blender/source/blender/blenkernel/intern/world.c  2011-05-19 
11:21:37 UTC (rev 36772)
@@ -117,18 +117,37 @@

for(a=0; aMAX_MTEX; a++) {
if(wrld-mtex[a]) {
-   wrldn-mtex[a]= MEM_mallocN(sizeof(MTex), 
copymaterial);
+   wrldn-mtex[a]= MEM_mallocN(sizeof(MTex), copy_world);
memcpy(wrldn-mtex[a], wrld-mtex[a], sizeof(MTex));
id_us_plus((ID *)wrldn-mtex[a]-tex);
}
}

-   if (wrld-preview) wrldn-preview = BKE_previewimg_copy(wrld-preview);
+   if(wrld-preview)
+   wrldn-preview = BKE_previewimg_copy(wrld-preview);
 
-#if 0 // XXX old animation system
-   id_us_plus((ID *)wrldn-ipo);
-#endif // XXX old animation system
+   return wrldn;
+}
+
+World *localize_world(World *wrld)
+{
+   World *wrldn;
+   int a;

+   wrldn= copy_libblock(wrld);
+   

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36773] trunk/blender/source/blender: Fix crash when accessing mesh from python while a mesh with a subsurf modifier

2011-05-19 Thread Brecht Van Lommel
Revision: 36773
  
http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=36773
Author:   blendix
Date: 2011-05-19 11:24:56 + (Thu, 19 May 2011)
Log Message:
---
Fix crash when accessing mesh from python while a mesh with a subsurf modifier
is in editmode.

Modified Paths:
--
trunk/blender/source/blender/blenkernel/BKE_subsurf.h
trunk/blender/source/blender/blenkernel/intern/multires.c
trunk/blender/source/blender/blenkernel/intern/shrinkwrap.c
trunk/blender/source/blender/blenkernel/intern/subsurf_ccg.c
trunk/blender/source/blender/modifiers/intern/MOD_subsurf.c

Modified: trunk/blender/source/blender/blenkernel/BKE_subsurf.h
===
--- trunk/blender/source/blender/blenkernel/BKE_subsurf.h   2011-05-19 
11:21:37 UTC (rev 36772)
+++ trunk/blender/source/blender/blenkernel/BKE_subsurf.h   2011-05-19 
11:24:56 UTC (rev 36773)
@@ -54,7 +54,7 @@
struct DerivedMesh *dm,
struct SubsurfModifierData *smd,
int useRenderParams, float 
(*vertCos)[3],
-   int isFinalCalc, int editMode);
+   int isFinalCalc, int 
forEditMode, int inEditMode);
 
 void subsurf_calculate_limit_positions(struct Mesh *me, float 
(*positions_r)[3]);
 

Modified: trunk/blender/source/blender/blenkernel/intern/multires.c
===
--- trunk/blender/source/blender/blenkernel/intern/multires.c   2011-05-19 
11:21:37 UTC (rev 36772)
+++ trunk/blender/source/blender/blenkernel/intern/multires.c   2011-05-19 
11:24:56 UTC (rev 36773)
@@ -465,7 +465,7 @@
return multires_dm_create_from_derived(mmd, 1, dm, ob, 0, 0);
 }
 
-static DerivedMesh *subsurf_dm_create_local(Object *UNUSED(ob), DerivedMesh 
*dm, int lvl, int simple, int optimal)
+static DerivedMesh *subsurf_dm_create_local(Object *ob, DerivedMesh *dm, int 
lvl, int simple, int optimal)
 {
SubsurfModifierData smd= {{NULL}};
 
@@ -476,7 +476,7 @@
if(optimal)
smd.flags |= eSubsurfModifierFlag_ControlEdges;
 
-   return subsurf_make_derived_from_derived(dm, smd, 0, NULL, 0, 0);
+   return subsurf_make_derived_from_derived(dm, smd, 0, NULL, 0, 0, 
(ob-mode  OB_MODE_EDIT));
 }
 
 

Modified: trunk/blender/source/blender/blenkernel/intern/shrinkwrap.c
===
--- trunk/blender/source/blender/blenkernel/intern/shrinkwrap.c 2011-05-19 
11:21:37 UTC (rev 36772)
+++ trunk/blender/source/blender/blenkernel/intern/shrinkwrap.c 2011-05-19 
11:24:56 UTC (rev 36773)
@@ -562,7 +562,7 @@
ssmd.subdivType = ME_CC_SUBSURF;
//catmull clark
ssmd.levels = smd-subsurfLevels;   //levels
 
-   ss_mesh = subsurf_make_derived_from_derived(dm, ssmd, 
FALSE, NULL, 0, 0);
+   ss_mesh = subsurf_make_derived_from_derived(dm, ssmd, 
FALSE, NULL, 0, 0, (ob-mode  OB_MODE_EDIT));
 
if(ss_mesh)
{

Modified: trunk/blender/source/blender/blenkernel/intern/subsurf_ccg.c
===
--- trunk/blender/source/blender/blenkernel/intern/subsurf_ccg.c
2011-05-19 11:21:37 UTC (rev 36772)
+++ trunk/blender/source/blender/blenkernel/intern/subsurf_ccg.c
2011-05-19 11:24:56 UTC (rev 36773)
@@ -2617,7 +2617,7 @@
struct DerivedMesh *dm,
struct SubsurfModifierData *smd,
int useRenderParams, float 
(*vertCos)[3],
-   int isFinalCalc, int editMode)
+   int isFinalCalc, int 
forEditMode, int inEditMode)
 {
int useSimple = smd-subdivType == ME_SIMPLE_SUBSURF;
int useAging = smd-flags  eSubsurfModifierFlag_DebugIncr;
@@ -2625,7 +2625,7 @@
int drawInteriorEdges = !(smd-flags  
eSubsurfModifierFlag_ControlEdges);
CCGDerivedMesh *result;
 
-   if(editMode) {
+   if(forEditMode) {
int levels= (smd-modifier.scene)? 
get_render_subsurf_level(smd-modifier.scene-r, smd-levels): smd-levels;
 
smd-emCache = _getSubSurf(smd-emCache, levels, useAging, 0,
@@ -2656,7 +2656,7 @@
int useAging = smd-flags  eSubsurfModifierFlag_DebugIncr;
int levels= (smd-modifier.scene)? 
get_render_subsurf_level(smd-modifier.scene-r, smd-levels): smd-levels;
CCGSubSurf *ss;
-   
+
/* It is quite possible there is a much better place to do 
this. 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36775] trunk/blender/source/blender/ editors/render/render_preview.c: Fix for preview render, lamp and world now also get localized like material and

2011-05-19 Thread Brecht Van Lommel
Revision: 36775
  
http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=36775
Author:   blendix
Date: 2011-05-19 11:37:08 + (Thu, 19 May 2011)
Log Message:
---
Fix for preview render, lamp and world now also get localized like material and 
texture.

Modified Paths:
--
trunk/blender/source/blender/editors/render/render_preview.c

Modified: trunk/blender/source/blender/editors/render/render_preview.c
===
--- trunk/blender/source/blender/editors/render/render_preview.c
2011-05-19 11:34:11 UTC (rev 36774)
+++ trunk/blender/source/blender/editors/render/render_preview.c
2011-05-19 11:37:08 UTC (rev 36775)
@@ -74,7 +74,9 @@
 #include BKE_main.h
 #include BKE_material.h
 #include BKE_node.h
+#include BKE_object.h
 #include BKE_texture.h
+#include BKE_world.h
 
 #include IMB_imbuf.h
 #include IMB_imbuf_types.h
@@ -149,9 +151,11 @@
ID *parent;
MTex *slot;

-   /* node materials/texture need full copy during preview render, glsl 
uses it too */
+   /* datablocks with nodes need full copy during preview render, glsl 
uses it too */
Material *matcopy;
Tex *texcopy;
+   Lamp *lampcopy;
+   World *worldcopy;

float col[4];   /* active object color */

@@ -259,7 +263,7 @@
if(id_type==ID_MA) {
Material *mat= NULL, *origmat= (Material *)id;

-   if(id) {
+   if(origmat) {
/* work on a copy */
mat= localize_material(origmat);
sp-matcopy= mat;
@@ -389,7 +393,14 @@
}
}
else if(id_type==ID_LA) {
-   Lamp *la= (Lamp *)id;
+   Lamp *la= NULL, *origla= (Lamp *)id;
+
+   /* work on a copy */
+   if(origla) {
+   la= localize_lamp(origla);
+   sp-lampcopy= la;
+   BLI_addtail(pr_main-lamp, la);
+   }

if(la  la-type==LA_SUN  (la-sun_effect_type  
LA_SUN_EFFECT_SKY)) {
sce-lay= 1MA_ATMOS;
@@ -411,8 +422,16 @@
}
}
else if(id_type==ID_WO) {
+   World *wrld= NULL, *origwrld= (World *)id;
+
+   if(origwrld) {
+   wrld= localize_world(origwrld);
+   sp-worldcopy= wrld;
+   BLI_addtail(pr_main-world, wrld);
+   }
+
sce-lay= 1MA_SKY;
-   sce-world= (World *)id;
+   sce-world= wrld;
}

return sce;
@@ -707,6 +726,38 @@
}
MEM_freeN(sp-texcopy);
}
+   if(sp-worldcopy) {
+   struct IDProperty *properties;
+   /* node previews */
+   shader_preview_updatejob(sp);
+   
+   /* get rid of copied world */
+   BLI_remlink(pr_main-world, sp-worldcopy);
+   free_world(sp-worldcopy);
+   
+   properties= IDP_GetProperties((ID *)sp-worldcopy, FALSE);
+   if (properties) {
+   IDP_FreeProperty(properties);
+   MEM_freeN(properties);
+   }
+   MEM_freeN(sp-worldcopy);
+   }
+   if(sp-lampcopy) {
+   struct IDProperty *properties;
+   /* node previews */
+   shader_preview_updatejob(sp);
+   
+   /* get rid of copied lamp */
+   BLI_remlink(pr_main-lamp, sp-lampcopy);
+   free_lamp(sp-lampcopy);
+   
+   properties= IDP_GetProperties((ID *)sp-lampcopy, FALSE);
+   if (properties) {
+   IDP_FreeProperty(properties);
+   MEM_freeN(properties);
+   }
+   MEM_freeN(sp-lampcopy);
+   }

MEM_freeN(sp);
 }

___
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 [36776] trunk/blender/source/blender/ editors/space_buttons: UI tweak: properties editor header now has same size as other headers again.

2011-05-19 Thread Brecht Van Lommel
Revision: 36776
  
http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=36776
Author:   blendix
Date: 2011-05-19 11:45:06 + (Thu, 19 May 2011)
Log Message:
---
UI tweak: properties editor header now has same size as other headers again.

Modified Paths:
--
trunk/blender/source/blender/editors/space_buttons/buttons_header.c
trunk/blender/source/blender/editors/space_buttons/buttons_intern.h
trunk/blender/source/blender/editors/space_buttons/space_buttons.c

Modified: trunk/blender/source/blender/editors/space_buttons/buttons_header.c
===
--- trunk/blender/source/blender/editors/space_buttons/buttons_header.c 
2011-05-19 11:37:08 UTC (rev 36775)
+++ trunk/blender/source/blender/editors/space_buttons/buttons_header.c 
2011-05-19 11:45:06 UTC (rev 36776)
@@ -98,11 +98,13 @@
sbuts-mainbuser= sbuts-mainb;
 }
 
+#define BUT_UNIT_X (UI_UNIT_X+2)
+
 void buttons_header_buttons(const bContext *C, ARegion *ar)
 {
SpaceButs *sbuts= CTX_wm_space_buts(C);
uiBlock *block;
-   int xco, yco= 3;
+   int xco, yco= 1;
 
buttons_context_compute(C, sbuts);

@@ -118,32 +120,32 @@
// Default panels
uiBlockBeginAlign(block);
if(sbuts-pathflag  (1BCONTEXT_RENDER))
-   uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, ICON_SCENE, 
xco+=BUTS_UI_UNIT, yco, BUTS_UI_UNIT, BUTS_UI_UNIT, 
(sbuts-mainb), 0.0, (float)BCONTEXT_RENDER, 0, 0, Render);
+   uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, ICON_SCENE, 
xco+=BUT_UNIT_X, yco, BUT_UNIT_X, UI_UNIT_Y, (sbuts-mainb), 
0.0, (float)BCONTEXT_RENDER, 0, 0, Render);
if(sbuts-pathflag  (1BCONTEXT_SCENE))
-   uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, 
ICON_SCENE_DATA,xco+=BUTS_UI_UNIT, yco, BUTS_UI_UNIT, 
BUTS_UI_UNIT, (sbuts-mainb), 0.0, (float)BCONTEXT_SCENE, 0, 0, Scene);
+   uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, 
ICON_SCENE_DATA,xco+=BUT_UNIT_X, yco, BUT_UNIT_X, 
UI_UNIT_Y, (sbuts-mainb), 0.0, (float)BCONTEXT_SCENE, 0, 0, Scene);
if(sbuts-pathflag  (1BCONTEXT_WORLD))
-   uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, ICON_WORLD, 
xco+=BUTS_UI_UNIT, yco, BUTS_UI_UNIT, BUTS_UI_UNIT, (sbuts-mainb), 
0.0, (float)BCONTEXT_WORLD, 0, 0, World);
+   uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, ICON_WORLD, 
xco+=BUT_UNIT_X, yco, BUT_UNIT_X, UI_UNIT_Y, (sbuts-mainb), 0.0, 
(float)BCONTEXT_WORLD, 0, 0, World);
if(sbuts-pathflag  (1BCONTEXT_OBJECT))
-   uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, 
ICON_OBJECT_DATA,   xco+=BUTS_UI_UNIT, yco, BUTS_UI_UNIT, BUTS_UI_UNIT, 
(sbuts-mainb), 0.0, (float)BCONTEXT_OBJECT, 0, 0, Object);
+   uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, 
ICON_OBJECT_DATA,   xco+=BUT_UNIT_X, yco, BUT_UNIT_X, UI_UNIT_Y, 
(sbuts-mainb), 0.0, (float)BCONTEXT_OBJECT, 0, 0, Object);
if(sbuts-pathflag  (1BCONTEXT_CONSTRAINT))
-   uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, 
ICON_CONSTRAINT,xco+=BUTS_UI_UNIT, yco, BUTS_UI_UNIT, BUTS_UI_UNIT, 
(sbuts-mainb), 0.0, (float)BCONTEXT_CONSTRAINT, 0, 0, Object Constraints);
+   uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, 
ICON_CONSTRAINT,xco+=BUT_UNIT_X, yco, BUT_UNIT_X, UI_UNIT_Y, 
(sbuts-mainb), 0.0, (float)BCONTEXT_CONSTRAINT, 0, 0, Object Constraints);
if(sbuts-pathflag  (1BCONTEXT_MODIFIER))
-   uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, ICON_MODIFIER,  
xco+=BUTS_UI_UNIT, yco, BUTS_UI_UNIT, BUTS_UI_UNIT, (sbuts-mainb), 0.0, 
(float)BCONTEXT_MODIFIER, 0, 0, Modifiers);
+   uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, ICON_MODIFIER,  
xco+=BUT_UNIT_X, yco, BUT_UNIT_X, UI_UNIT_Y, (sbuts-mainb), 0.0, 
(float)BCONTEXT_MODIFIER, 0, 0, Modifiers);
if(sbuts-pathflag  (1BCONTEXT_DATA))
-   uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, 
sbuts-dataicon,xco+=BUTS_UI_UNIT, yco, BUTS_UI_UNIT, BUTS_UI_UNIT, 
(sbuts-mainb), 0.0, (float)BCONTEXT_DATA, 0, 0, Object Data);
+   uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, 
sbuts-dataicon,xco+=BUT_UNIT_X, yco, BUT_UNIT_X, UI_UNIT_Y, 
(sbuts-mainb), 0.0, (float)BCONTEXT_DATA, 0, 0, Object Data);
if(sbuts-pathflag  (1BCONTEXT_BONE))
-   uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, ICON_BONE_DATA, 
xco+=BUTS_UI_UNIT, yco, BUTS_UI_UNIT, BUTS_UI_UNIT, (sbuts-mainb), 0.0, 
(float)BCONTEXT_BONE, 0, 0, Bone);
+   uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, ICON_BONE_DATA, 
xco+=BUT_UNIT_X, yco, BUT_UNIT_X, UI_UNIT_Y, (sbuts-mainb), 0.0, 
(float)BCONTEXT_BONE, 0, 0, Bone);
if(sbuts-pathflag  (1BCONTEXT_BONE_CONSTRAINT))
-   uiDefIconButS(block, ROW, 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36777] trunk/blender/source/blender: Fix some compile warnings.

2011-05-19 Thread Brecht Van Lommel
Revision: 36777
  
http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=36777
Author:   blendix
Date: 2011-05-19 11:54:03 + (Thu, 19 May 2011)
Log Message:
---
Fix some compile warnings.

Modified Paths:
--
trunk/blender/source/blender/blenkernel/intern/world.c
trunk/blender/source/blender/imbuf/intern/png.c
trunk/blender/source/blender/modifiers/intern/MOD_subsurf.c

Modified: trunk/blender/source/blender/blenkernel/intern/world.c
===
--- trunk/blender/source/blender/blenkernel/intern/world.c  2011-05-19 
11:45:06 UTC (rev 36776)
+++ trunk/blender/source/blender/blenkernel/intern/world.c  2011-05-19 
11:54:03 UTC (rev 36777)
@@ -43,6 +43,7 @@
 #include DNA_scene_types.h
 #include DNA_texture_types.h
 
+#include BLI_listbase.h
 #include BLI_utildefines.h
 
 #include BKE_world.h

Modified: trunk/blender/source/blender/imbuf/intern/png.c
===
--- trunk/blender/source/blender/imbuf/intern/png.c 2011-05-19 11:45:06 UTC 
(rev 36776)
+++ trunk/blender/source/blender/imbuf/intern/png.c 2011-05-19 11:54:03 UTC 
(rev 36777)
@@ -391,7 +391,7 @@
 
if (png_get_valid (png_ptr, info_ptr, PNG_INFO_pHYs)) {
int unit_type;
-   unsigned int xres, yres;
+   png_uint_32 xres, yres;
 
if(png_get_pHYs(png_ptr, info_ptr, xres, yres, 
unit_type))
if(unit_type == PNG_RESOLUTION_METER) {

Modified: trunk/blender/source/blender/modifiers/intern/MOD_subsurf.c
===
--- trunk/blender/source/blender/modifiers/intern/MOD_subsurf.c 2011-05-19 
11:45:06 UTC (rev 36776)
+++ trunk/blender/source/blender/modifiers/intern/MOD_subsurf.c 2011-05-19 
11:54:03 UTC (rev 36777)
@@ -111,7 +111,7 @@
return result;
 }
 
-static DerivedMesh *applyModifierEM(ModifierData *md, Object *ob,
+static DerivedMesh *applyModifierEM(ModifierData *md, Object *UNUSED(ob),
struct EditMesh 
*UNUSED(editData),
DerivedMesh *derivedData)
 {

___
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 [36778] branches/cycles: Cycles: svn merge -r36747:36777 https://svn.blender.org/svnroot/bf-blender/trunk/ blender/

2011-05-19 Thread Brecht Van Lommel
Revision: 36778
  
http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=36778
Author:   blendix
Date: 2011-05-19 12:37:26 + (Thu, 19 May 2011)
Log Message:
---
Cycles: svn merge -r36747:36777 
https://svn.blender.org/svnroot/bf-blender/trunk/blender/

Revision Links:
--

http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=36747

Modified Paths:
--
branches/cycles/release/scripts/modules/bpy/path.py
branches/cycles/release/scripts/modules/bpy_extras/view3d_utils.py
branches/cycles/release/scripts/startup/bl_ui/space_userpref.py
branches/cycles/release/scripts/startup/bl_ui/space_userpref_keymap.py
branches/cycles/source/blender/blenkernel/BKE_icons.h
branches/cycles/source/blender/blenkernel/intern/icons.c
branches/cycles/source/blender/blenkernel/intern/object.c
branches/cycles/source/blender/blenkernel/intern/world.c
branches/cycles/source/blender/blenlib/BLI_math_geom.h
branches/cycles/source/blender/blenlib/intern/math_geom.c
branches/cycles/source/blender/blenloader/BLO_readfile.h
branches/cycles/source/blender/blenloader/intern/readblenentry.c
branches/cycles/source/blender/blenloader/intern/readfile.c
branches/cycles/source/blender/editors/armature/editarmature.c
branches/cycles/source/blender/editors/gpencil/gpencil_edit.c
branches/cycles/source/blender/editors/include/ED_view3d.h
branches/cycles/source/blender/editors/interface/interface_layout.c
branches/cycles/source/blender/editors/screen/screendump.c
branches/cycles/source/blender/editors/space_file/filelist.c
branches/cycles/source/blender/editors/space_view3d/drawmesh.c
branches/cycles/source/blender/editors/space_view3d/view3d_edit.c
branches/cycles/source/blender/editors/space_view3d/view3d_view.c
branches/cycles/source/blender/imbuf/intern/png.c
branches/cycles/source/blender/makesdna/DNA_view3d_types.h
branches/cycles/source/blender/makesrna/intern/rna_space.c
branches/cycles/source/blender/python/generic/mathutils_Matrix.c
branches/cycles/source/blender/python/generic/mathutils_geometry.c

Property Changed:

branches/cycles/
branches/cycles/source/blender/editors/datafiles/startup.blend.c
branches/cycles/source/blender/editors/render/render_shading.c
branches/cycles/source/blender/editors/render/render_update.c
branches/cycles/source/blender/editors/uvedit/uvedit_buttons.c


Property changes on: branches/cycles
___
Modified: svn:mergeinfo
   - /trunk/blender:36353-36747
   + /trunk/blender:36353-36777

Modified: branches/cycles/release/scripts/modules/bpy/path.py
===
--- branches/cycles/release/scripts/modules/bpy/path.py 2011-05-19 11:54:03 UTC 
(rev 36777)
+++ branches/cycles/release/scripts/modules/bpy/path.py 2011-05-19 12:37:26 UTC 
(rev 36778)
@@ -135,7 +135,7 @@
 filename = os.path.basename(path)  # filename may be a directory or a 
file
 dirpath = os.path.dirname(path)
 
-suffix = 
+suffix = path[:0]  #  but ensure byte/str match
 if not filename:  # dir ends with a slash?
 if len(dirpath)  len(path):
 suffix = path[:len(path) - len(dirpath)]

Modified: branches/cycles/release/scripts/modules/bpy_extras/view3d_utils.py
===
--- branches/cycles/release/scripts/modules/bpy_extras/view3d_utils.py  
2011-05-19 11:54:03 UTC (rev 36777)
+++ branches/cycles/release/scripts/modules/bpy_extras/view3d_utils.py  
2011-05-19 12:37:26 UTC (rev 36778)
@@ -36,14 +36,19 @@
 
 from mathutils import Vector
 
-dx = (2.0 * coord[0] / region.width) - 1.0
-dy = (2.0 * coord[1] / region.height) - 1.0
+viewvec = rv3d.view_matrix.inverted()[2].xyz.normalized()
 
-viewvec = rv3d.view_matrix.inverted()[2].to_3d().normalized()
-perspinv_x, perspinv_y = rv3d.perspective_matrix.inverted().to_3x3()[0:2]
-return ((perspinv_x * dx + perspinv_y * dy) - viewvec).normalized()
+if rv3d.is_perspective:
+dx = (2.0 * coord[0] / region.width) - 1.0
+dy = (2.0 * coord[1] / region.height) - 1.0
 
+persmat = rv3d.perspective_matrix.copy()
+perspinv_x, perspinv_y = persmat.inverted().to_3x3()[0:2]
+return ((perspinv_x * dx + perspinv_y * dy) - viewvec).normalized()
+else:
+return viewvec
 
+
 def region_2d_to_location_3d(region, rv3d, coord, depth_location):
 
 Return a 3d location from the region relative 2d coords, aligned with
@@ -62,12 +67,30 @@
 :return: normalized 3d vector.
 :rtype: :class:`Vector`
 
+from mathutils import Vector
 from mathutils.geometry import intersect_point_line
-origin_start = rv3d.view_matrix.inverted()[3].to_3d()
-origin_end = 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36779] trunk/blender/source/blender/ blenkernel/intern/fcurve.c: modify fcurve evaluation for bool/enum/ int values.

2011-05-19 Thread Campbell Barton
Revision: 36779
  
http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=36779
Author:   campbellbarton
Date: 2011-05-19 12:39:57 + (Thu, 19 May 2011)
Log Message:
---
modify fcurve evaluation for bool/enum/int values. was converting from a float 
to an int which means 0.9x evaluates to 0.0, negative numbers are also rounded 
up.

Round at 0.5 instead  treat negative numbers the same.

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

Modified: trunk/blender/source/blender/blenkernel/intern/fcurve.c
===
--- trunk/blender/source/blender/blenkernel/intern/fcurve.c 2011-05-19 
12:37:26 UTC (rev 36778)
+++ trunk/blender/source/blender/blenkernel/intern/fcurve.c 2011-05-19 
12:39:57 UTC (rev 36779)
@@ -2039,7 +2039,7 @@
 * here so that the curve can be sampled correctly
 */
if (fcu-flag  FCURVE_INT_VALUES)
-   cvalue= (float)((int)cvalue);
+   cvalue= floorf(cvalue + 0.5f);

/* return evaluated value */
return cvalue;

___
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 [36780] trunk/blender/intern/tools/ ui_snapshot.py: script to automate taking screenshots of blenders UI.

2011-05-19 Thread Campbell Barton
Revision: 36780
  
http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=36780
Author:   campbellbarton
Date: 2011-05-19 13:05:50 + (Thu, 19 May 2011)
Log Message:
---
script to automate taking screenshots of blenders UI. currenly only works with 
object/scene/render/world panels.

Added Paths:
---
trunk/blender/intern/tools/ui_snapshot.py

Added: trunk/blender/intern/tools/ui_snapshot.py
===
--- trunk/blender/intern/tools/ui_snapshot.py   (rev 0)
+++ trunk/blender/intern/tools/ui_snapshot.py   2011-05-19 13:05:50 UTC (rev 
36780)
@@ -0,0 +1,155 @@
+# $Id: bpy_introspect_ui.py 34890 2011-02-16 02:51:56Z campbellbarton $
+# * BEGIN GPL LICENSE BLOCK *
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# Contributor(s): Campbell Barton
+#
+# * END GPL LICENSE BLOCK *
+
+# screenshot panels, corrently only works for render, scene and world.
+# needs some further work to setup blender contexts for all possible panels.
+
+import os
+
+REMOVE_CMP_IMAGES = True
+TEMP_DIR = /tmp
+
+PROPERTY_MAPPING = {
+armature_edit: '',
+bone: '',
+bone_constraint: '',
+constraint: '',
+curve_edit: '',
+data: '',
+imagepaint: '',
+lattice_edit: '',
+material: '',
+mball_edit: '',
+mesh_edit: '',
+modifier: '',
+object: 'OBJECT',
+objectmode: '',
+particle: '',
+particlemode: '',
+physics: '',
+posemode: '',
+render: 'RENDER',
+scene: 'SCENE',
+surface_edit: '',
+text_edit: '',
+texture: '',
+vertexpaint: '',
+weightpaint: '',
+world: 'WORLD',
+}
+
+# toolbar, todo
+PROPERTY_SKIP = {imagepaint}
+
+# format: % (new, blank, out)
+magick_command = 'convert %s %s \( -clone 0 -clone 1 -compose difference 
-composite -threshold 0 \) -delete 1 -alpha off -compose copy_opacity 
-composite -trim %s '
+
+import bpy
+
+def force_redraw():
+bpy.ops.wm.redraw_timer(type='DRAW_WIN_SWAP', iterations=1)
+
+def fake_poll(cls, context):
+return True
+
+def screenshot(path):
+force_redraw()
+bpy.ops.screen.screenshot(filepath=path)
+
+
+def main():
+panel_subclasses = []
+
+for cls_name in dir(bpy.types):
+cls = getattr(bpy.types, cls_name)
+if issubclass(cls, bpy.types.Panel):
+if bpy.types.Panel is cls:
+continue
+
+panel_subclasses.append((cls, getattr(cls, poll, None)))
+
+for cls, poll in panel_subclasses:
+cls.poll = classmethod(fake_poll)
+cls.bl_options = set()  # so we dont get 'DEFAULT_CLOSED'
+bpy.utils.unregister_class(cls)
+
+# collect context types
+button_contexts = {None}
+for cls, poll in panel_subclasses:
+button_contexts.add(getattr(cls, bl_context, None))
+button_contexts.remove(None)
+
+# get the properties space
+space_props = None
+for sa in bpy.context.screen.areas:
+space = sa.active_space
+if space.type == 'PROPERTIES':
+space_props = space
+break
+if space_props is None:
+raise Exception(no properties space type found)
+
+for bl_context in sorted(button_contexts):
+print(list(sorted(button_contexts)))
+# TODO
+if bl_context in PROPERTY_SKIP:
+continue
+
+prop_context = PROPERTY_MAPPING[bl_context]
+if not prop_context:
+print(TODO, skipping, bl_context)
+continue
+
+space_props.context = prop_context
+
+for cls, poll in panel_subclasses:
+if cls.bl_space_type == 'PROPERTIES':
+if cls.bl_region_type == 'WINDOW':
+if cls.bl_context == bl_context:
+file_base = os.path.join(TEMP_DIR, %s_%s % 
(bl_context, _ + cls.__name__.replace(., _)))
+file_old = file_base + _old.png
+file_new = file_base + _new.png
+file_crop = file_base + .png
+
+screenshot(file_old)
+
+# we need a new unique name so old 'closed' settings 
dont get applied
+idname = 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36781] trunk/blender/source/blender/ blenlib/intern/bpath.c: formatting changes only.

2011-05-19 Thread Campbell Barton
Revision: 36781
  
http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=36781
Author:   campbellbarton
Date: 2011-05-19 13:50:53 + (Thu, 19 May 2011)
Log Message:
---
formatting changes only.

Modified Paths:
--
trunk/blender/source/blender/blenlib/intern/bpath.c

Modified: trunk/blender/source/blender/blenlib/intern/bpath.c
===
--- trunk/blender/source/blender/blenlib/intern/bpath.c 2011-05-19 13:05:50 UTC 
(rev 36780)
+++ trunk/blender/source/blender/blenlib/intern/bpath.c 2011-05-19 13:50:53 UTC 
(rev 36781)
@@ -68,21 +68,16 @@
 #include BKE_utildefines.h
 #include BKE_report.h
 
-//XXX #include BIF_screen.h /* only for wait cursor */
-//
-/* for sequence */
-//XXX #include BSE_sequence.h
-//XXX define below from BSE_sequence.h - otherwise potentially odd behaviour
-
-
-typedef struct BPathIteratorSeqData {
+typedef struct BPathIteratorSeqData
+{
int totseq;
int seq;
-   struct Sequence **seqar; /* Sequence */
-   struct Scene *scene;/* Current scene */
+   struct Sequence **seqar;/* Sequence */
+   struct Scene *scene;/* Current scene */
 } BPathIteratorSeqData;
 
-typedef struct BPathIterator {
+typedef struct BPathIterator
+{
char*   _path; /* never access directly, use BLI_bpathIterator_getPath 
*/
const char* _lib;
const char* _name;
@@ -94,7 +89,7 @@
void (*setpath_callback)(struct BPathIterator *, const char *);
void (*getpath_callback)(struct BPathIterator *, char *);
 
-   const char* base_path; /* base path, the directry the blend file is 
in - normally bmain-name */
+   const char* base_path; /* base path, the directory the blend file 
is in - normally bmain-name */
 
Main *bmain;
 
@@ -116,7 +111,7 @@
BPATH_SEQ,
BPATH_CDATA,
 
-BPATH_DONE
+   BPATH_DONE
 };
 
 void BLI_bpathIterator_init(struct BPathIterator **bpi_pt, Main *bmain, const 
char *basedir, const int flag)
@@ -128,10 +123,10 @@
 
bpi-type= BPATH_IMAGE;
bpi-data= NULL;
-   
+
bpi-getpath_callback= NULL;
bpi-setpath_callback= NULL;
-   
+
/* Sequencer specific */
bpi-seqdata.totseq= 0;
bpi-seqdata.seq= 0;
@@ -147,62 +142,75 @@
 }
 
 #if 0
-static void BLI_bpathIterator_alloc(struct BPathIterator **bpi) {
+static void BLI_bpathIterator_alloc(struct BPathIterator **bpi)
+{
*bpi= MEM_mallocN(sizeof(BPathIterator), BLI_bpathIterator_alloc);
 }
 #endif
 
-void BLI_bpathIterator_free(struct BPathIterator *bpi) {
+void BLI_bpathIterator_free(struct BPathIterator *bpi)
+{
if (bpi-seqdata.seqar)
MEM_freeN((void *)bpi-seqdata.seqar);
bpi-seqdata.seqar= NULL;
bpi-seqdata.scene= NULL;
-   
+
MEM_freeN(bpi);
 }
 
-void BLI_bpathIterator_getPath(struct BPathIterator *bpi, char *path) {
+void BLI_bpathIterator_getPath(struct BPathIterator *bpi, char *path)
+{
if (bpi-getpath_callback) {
bpi-getpath_callback(bpi, path);
-   } else {
+   }
+   else {
strcpy(path, bpi-_path); /* warning, we assume 'path' are long 
enough */
}
 }
 
-void BLI_bpathIterator_setPath(struct BPathIterator *bpi, const char *path) {
+void BLI_bpathIterator_setPath(struct BPathIterator *bpi, const char *path)
+{
if (bpi-setpath_callback) {
bpi-setpath_callback(bpi, path);
-   } else {
+   }
+   else {
strcpy(bpi-_path, path); /* warning, we assume 'path' are long 
enough */
}
 }
 
-void BLI_bpathIterator_getPathExpanded(struct BPathIterator *bpi, char 
*path_expanded) {
+void BLI_bpathIterator_getPathExpanded(struct BPathIterator *bpi, char 
*path_expanded)
+{
const char *libpath;
-   
+
BLI_bpathIterator_getPath(bpi, path_expanded);
libpath= BLI_bpathIterator_getLib(bpi);
-   
+
if (libpath) { /* check the files location relative to its library path 
*/
BLI_path_abs(path_expanded, libpath);
-   } else { /* local data, use the blend files path */
+   }
+   else { /* local data, use the blend files path */
BLI_path_abs(path_expanded, bpi-base_path);
}
BLI_cleanup_file(NULL, path_expanded);
 }
-const char* BLI_bpathIterator_getLib(struct BPathIterator *bpi) {
+const char* BLI_bpathIterator_getLib(struct BPathIterator *bpi)
+{
return bpi-_lib;
 }
-const char* BLI_bpathIterator_getName(struct BPathIterator *bpi) {
+const char* BLI_bpathIterator_getName(struct BPathIterator *bpi)
+{
return bpi-_name;
 }
-intBLI_bpathIterator_getType(struct BPathIterator *bpi) {
+intBLI_bpathIterator_getType(struct BPathIterator *bpi)
+{
return bpi-type;
 }
-unsigned int   BLI_bpathIterator_getPathMaxLen(struct BPathIterator *bpi) {

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36782] trunk/blender: move rna property area.active_space -- area.spaces.active

2011-05-19 Thread Campbell Barton
Revision: 36782
  
http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=36782
Author:   campbellbarton
Date: 2011-05-19 15:18:40 + (Thu, 19 May 2011)
Log Message:
---
move rna property area.active_space -- area.spaces.active

Modified Paths:
--
trunk/blender/intern/tools/ui_snapshot.py
trunk/blender/source/blender/makesrna/intern/rna_screen.c

Modified: trunk/blender/intern/tools/ui_snapshot.py
===
--- trunk/blender/intern/tools/ui_snapshot.py   2011-05-19 13:50:53 UTC (rev 
36781)
+++ trunk/blender/intern/tools/ui_snapshot.py   2011-05-19 15:18:40 UTC (rev 
36782)
@@ -56,9 +56,6 @@
 world: 'WORLD',
 }
 
-# toolbar, todo
-PROPERTY_SKIP = {imagepaint}
-
 # format: % (new, blank, out)
 magick_command = 'convert %s %s \( -clone 0 -clone 1 -compose difference 
-composite -threshold 0 \) -delete 1 -alpha off -compose copy_opacity 
-composite -trim %s '
 
@@ -100,7 +97,7 @@
 # get the properties space
 space_props = None
 for sa in bpy.context.screen.areas:
-space = sa.active_space
+space = sa.spaces.active
 if space.type == 'PROPERTIES':
 space_props = space
 break

Modified: trunk/blender/source/blender/makesrna/intern/rna_screen.c
===
--- trunk/blender/source/blender/makesrna/intern/rna_screen.c   2011-05-19 
13:50:53 UTC (rev 36781)
+++ trunk/blender/source/blender/makesrna/intern/rna_screen.c   2011-05-19 
15:18:40 UTC (rev 36782)
@@ -82,7 +82,7 @@
 static void rna_Screen_redraw_update(Main *bmain, Scene *scene, PointerRNA 
*ptr)
 {
bScreen *screen= (bScreen*)ptr-data;
-   
+
/* the settings for this are currently only available from a menu in 
the TimeLine, hence refresh=SPACE_TIME */
ED_screen_animation_timer_update(screen, screen-redraws_flag, 
SPACE_TIME);
 }
@@ -116,12 +116,29 @@
 
 #else
 
+/* Area.spaces */
+static void rna_def_area_spaces(BlenderRNA *brna, PropertyRNA *cprop)
+{
+   StructRNA *srna;
+   PropertyRNA *prop;
+
+   RNA_def_property_srna(cprop, AreaSpaces);
+   srna= RNA_def_struct(brna, AreaSpaces, NULL);
+   RNA_def_struct_sdna(srna, ScrArea);
+   RNA_def_struct_ui_text(srna, Area Spaces, Collection of spaces);
+
+   prop= RNA_def_property(srna, active, PROP_POINTER, PROP_NONE);
+   RNA_def_property_pointer_sdna(prop, NULL, spacedata.first);
+   RNA_def_property_struct_type(prop, Space);
+   RNA_def_property_ui_text(prop, Active Space, Space currently being 
displayed in this area);
+}
+
 static void rna_def_area(BlenderRNA *brna)
 {
StructRNA *srna;
PropertyRNA *prop;
FunctionRNA *func;
-   
+
srna= RNA_def_struct(brna, Area, NULL);
RNA_def_struct_ui_text(srna, Area, Area in a subdivided screen, 
containing an editor);
RNA_def_struct_sdna(srna, ScrArea);
@@ -130,12 +147,8 @@
RNA_def_property_collection_sdna(prop, NULL, spacedata, NULL);
RNA_def_property_struct_type(prop, Space);
RNA_def_property_ui_text(prop, Spaces, Spaces contained in this 
area, the first being the active space. NOTE: Useful for example to restore a 
previously used 3d view space in a certain area to get the old view 
orientation.);
+   rna_def_area_spaces(brna, prop);
 
-   prop= RNA_def_property(srna, active_space, PROP_POINTER, PROP_NONE);
-   RNA_def_property_pointer_sdna(prop, NULL, spacedata.first);
-   RNA_def_property_struct_type(prop, Space);
-   RNA_def_property_ui_text(prop, Active Space, Space currently being 
displayed in this area);
-
prop= RNA_def_property(srna, regions, PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, regionbase, NULL);
RNA_def_property_struct_type(prop, Region);
@@ -144,7 +157,7 @@
prop= RNA_def_property(srna, show_menus, PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, flag, 
HEADER_NO_PULLDOWN);
RNA_def_property_ui_text(prop, Show Menus, Show menus in the 
header);
-   
+
prop= RNA_def_property(srna, type, PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, spacetype);
RNA_def_property_enum_items(prop, space_type_items);
@@ -174,11 +187,11 @@
 {
StructRNA *srna;
PropertyRNA *prop;
-   
+
srna= RNA_def_struct(brna, Region, NULL);
RNA_def_struct_ui_text(srna, Region, Region in a subdivided screen 
area);
RNA_def_struct_sdna(srna, ARegion);
-   
+
prop= RNA_def_property(srna, id, PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, swinid);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
@@ -199,7 +212,7 @@
RNA_def_property_int_sdna(prop, NULL, winy);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36783] trunk/blender/source/blender/ editors/space_view3d/view3d_edit.c: - mousewheel zoom now zooms camera area when the camera is locked and in ort

2011-05-19 Thread Campbell Barton
Revision: 36783
  
http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=36783
Author:   campbellbarton
Date: 2011-05-19 17:19:05 + (Thu, 19 May 2011)
Log Message:
---
- mousewheel zoom now zooms camera area when the camera is locked and in ortho 
view.
- remove secret apricot feature now dolly is its own operator.

Modified Paths:
--
trunk/blender/source/blender/editors/space_view3d/view3d_edit.c

Modified: trunk/blender/source/blender/editors/space_view3d/view3d_edit.c
===
--- trunk/blender/source/blender/editors/space_view3d/view3d_edit.c 
2011-05-19 15:18:40 UTC (rev 36782)
+++ trunk/blender/source/blender/editors/space_view3d/view3d_edit.c 
2011-05-19 17:19:05 UTC (rev 36783)
@@ -1165,25 +1165,10 @@
zfac * vod-rv3d-dist  10.0f * vod-far)
view_zoom_mouseloc(vod-ar, zfac, vod-oldx, vod-oldy);
 
+   /* these limits were in old code too */
+   if(vod-rv3d-dist0.001f * vod-grid) vod-rv3d-dist= 0.001f * 
vod-grid;
+   if(vod-rv3d-dist10.0f * vod-far) vod-rv3d-dist=10.0f * vod-far;
 
-   if ((U.uiflag  USER_ORBIT_ZBUF)  (viewzoom==USER_ZOOM_CONT)  
(vod-rv3d-persp==RV3D_PERSP)) {
-   float upvec[3], mat[3][3];
-
-   /* Secret apricot feature, translate the view when in continues 
mode */
-   upvec[0] = upvec[1] = 0.0f;
-   upvec[2] = (vod-dist0 - vod-rv3d-dist) * vod-grid;
-   vod-rv3d-dist = vod-dist0;
-   copy_m3_m4(mat, vod-rv3d-viewinv);
-   mul_m3_v3(mat, upvec);
-   add_v3_v3(vod-rv3d-ofs, upvec);
-   } else {
-   /* these limits were in old code too */
-   if(vod-rv3d-dist0.001f * vod-grid) vod-rv3d-dist= 0.001f 
* vod-grid;
-   if(vod-rv3d-dist10.0f * vod-far) vod-rv3d-dist=10.0f * 
vod-far;
-   }
-
-// XXX if(vod-rv3d-persp==RV3D_ORTHO || vod-rv3d-persp==RV3D_CAMOB) 
preview3d_event= 0;
-
if(vod-rv3d-viewlock  RV3D_BOXVIEW)
view3d_boxview_sync(vod-sa, vod-ar);
 
@@ -1244,6 +1229,7 @@
RegionView3D *rv3d;
ScrArea *sa;
ARegion *ar;
+   short use_cam_zoom;
 
int delta= RNA_int_get(op-ptr, delta);
int mx, my;
@@ -1265,9 +1251,11 @@
mx= RNA_property_is_set(op-ptr, mx) ? RNA_int_get(op-ptr, mx) : 
ar-winx / 2;
my= RNA_property_is_set(op-ptr, my) ? RNA_int_get(op-ptr, my) : 
ar-winy / 2;
 
+   use_cam_zoom= (rv3d-persp==RV3D_CAMOB)  !((v3d-flag2  
V3D_LOCK_CAMERA)  rv3d-is_persp);
+
if(delta  0) {
/* this min and max is also in viewmove() */
-   if((rv3d-persp==RV3D_CAMOB)  !(v3d-flag2  
V3D_LOCK_CAMERA)) {
+   if(use_cam_zoom) {
rv3d-camzoom-= 10;
if(rv3d-camzoom  RV3D_CAMZOOM_MIN) rv3d-camzoom= 
RV3D_CAMZOOM_MIN;
}
@@ -1276,7 +1264,7 @@
}
}
else {
-   if((rv3d-persp==RV3D_CAMOB)  !(v3d-flag2  
V3D_LOCK_CAMERA)) {
+   if(use_cam_zoom) {
rv3d-camzoom+= 10;
if(rv3d-camzoom  RV3D_CAMZOOM_MAX) rv3d-camzoom= 
RV3D_CAMZOOM_MAX;
}

___
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 [36784] trunk/blender: SVN maintenance.

2011-05-19 Thread gsr b3d
Revision: 36784
  
http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=36784
Author:   gsrb3d
Date: 2011-05-19 20:22:35 + (Thu, 19 May 2011)
Log Message:
---
SVN maintenance.

Modified Paths:
--
trunk/blender/intern/tools/ui_snapshot.py
trunk/blender/release/scripts/modules/bpy_extras/__init__.py

Property Changed:

trunk/blender/intern/tools/ui_snapshot.py

Modified: trunk/blender/intern/tools/ui_snapshot.py
===
--- trunk/blender/intern/tools/ui_snapshot.py   2011-05-19 17:19:05 UTC (rev 
36783)
+++ trunk/blender/intern/tools/ui_snapshot.py   2011-05-19 20:22:35 UTC (rev 
36784)
@@ -1,4 +1,4 @@
-# $Id: bpy_introspect_ui.py 34890 2011-02-16 02:51:56Z campbellbarton $
+# $Id$
 # * BEGIN GPL LICENSE BLOCK *
 #
 # This program is free software; you can redistribute it and/or


Property changes on: trunk/blender/intern/tools/ui_snapshot.py
___
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Modified: trunk/blender/release/scripts/modules/bpy_extras/__init__.py
===
--- trunk/blender/release/scripts/modules/bpy_extras/__init__.py
2011-05-19 17:19:05 UTC (rev 36783)
+++ trunk/blender/release/scripts/modules/bpy_extras/__init__.py
2011-05-19 20:22:35 UTC (rev 36784)
@@ -28,4 +28,4 @@
 image_utils,
 mesh_utils,
 view3d_utils,
-)
\ No newline at end of file
+)

___
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 [36785] trunk/blender/release/scripts/ modules/bpy/utils.py: [#27439] Console window doesn' t hide on startup when presets are used (Windows)

2011-05-19 Thread Campbell Barton
Revision: 36785
  
http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=36785
Author:   campbellbarton
Date: 2011-05-20 00:21:38 + (Fri, 20 May 2011)
Log Message:
---
[#27439] Console window doesn't hide on startup when presets are used (Windows)
only print preset load messages in when debug is enabled.

Modified Paths:
--
trunk/blender/release/scripts/modules/bpy/utils.py

Modified: trunk/blender/release/scripts/modules/bpy/utils.py
===
--- trunk/blender/release/scripts/modules/bpy/utils.py  2011-05-19 20:22:35 UTC 
(rev 36784)
+++ trunk/blender/release/scripts/modules/bpy/utils.py  2011-05-20 00:21:38 UTC 
(rev 36785)
@@ -379,7 +379,9 @@
 def keyconfig_set(filepath):
 from os.path import basename, splitext
 
-print(loading preset:, filepath)
+if _bpy.app.debug:
+print(loading preset:, filepath)
+
 keyconfigs = _bpy.context.window_manager.keyconfigs
 
 keyconfigs_old = keyconfigs[:]

___
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 [36786] trunk/blender/source/blender/ editors/space_graph/graph_draw.c: int values were not drawing curve handles , yet the handles could still be sel

2011-05-19 Thread Campbell Barton
Revision: 36786
  
http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=36786
Author:   campbellbarton
Date: 2011-05-20 01:02:00 + (Fri, 20 May 2011)
Log Message:
---
int values were not drawing curve handles, yet the handles could still be 
selected and transformed, and different handle types set. disable this check 
and draw curve handles for int fcurves.

Modified Paths:
--
trunk/blender/source/blender/editors/space_graph/graph_draw.c

Modified: trunk/blender/source/blender/editors/space_graph/graph_draw.c
===
--- trunk/blender/source/blender/editors/space_graph/graph_draw.c   
2011-05-20 00:21:38 UTC (rev 36785)
+++ trunk/blender/source/blender/editors/space_graph/graph_draw.c   
2011-05-20 01:02:00 UTC (rev 36786)
@@ -320,7 +320,9 @@
/* don't draw handle lines if handles are not to be shown */
if ((sipo-flag  SIPO_NOHANDLES) || /* handles shouldn't be shown 
anywhere */
(fcu-flag  FCURVE_PROTECTED) || /* keyframes aren't 
editable */
+#if 0  /* handles can still be selected and handle types set, better 
draw - campbell */
(fcu-flag  FCURVE_INT_VALUES) || /* editing the 
handles here will cause weird/incorrect interpolation issues */
+#endif
((fcu-grp)  (fcu-grp-flag  AGRP_PROTECTED)) || /* 
group that curve belongs to is not editable */
(fcu-totvert = 1) /* do not show handles if there is 
only 1 keyframe, otherwise they all clump together in an ugly ball */
) 

___
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 [36787] trunk/blender/source: make api functions for converting rv3d-camzoom, so the odd logic for this isn't inlined all over.

2011-05-19 Thread Campbell Barton
Revision: 36787
  
http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=36787
Author:   campbellbarton
Date: 2011-05-20 04:14:29 + (Fri, 20 May 2011)
Log Message:
---
make api functions for converting rv3d-camzoom, so the odd logic for this 
isn't inlined all over.

Modified Paths:
--
trunk/blender/source/blender/blenkernel/BKE_screen.h
trunk/blender/source/blender/blenkernel/intern/screen.c
trunk/blender/source/blender/editors/space_view3d/view3d_draw.c
trunk/blender/source/blender/editors/space_view3d/view3d_edit.c
trunk/blender/source/blender/editors/space_view3d/view3d_view.c
trunk/blender/source/blender/makesdna/DNA_view3d_types.h
trunk/blender/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp

Modified: trunk/blender/source/blender/blenkernel/BKE_screen.h
===
--- trunk/blender/source/blender/blenkernel/BKE_screen.h2011-05-20 
01:02:00 UTC (rev 36786)
+++ trunk/blender/source/blender/blenkernel/BKE_screen.h2011-05-20 
04:14:29 UTC (rev 36787)
@@ -246,6 +246,9 @@
 void BKE_screen_view3d_scene_sync(struct bScreen *sc);
 void BKE_screen_view3d_main_sync(ListBase *screen_lb, struct Scene *scene);
 
+/* zoom factor conversion */
+float BKE_screen_view3d_zoom_to_fac(float camzoom);
+float BKE_screen_view3d_zoom_from_fac(float zoomfac);
 
 /* screen */
 void free_screen(struct bScreen *sc); 

Modified: trunk/blender/source/blender/blenkernel/intern/screen.c
===
--- trunk/blender/source/blender/blenkernel/intern/screen.c 2011-05-20 
01:02:00 UTC (rev 36786)
+++ trunk/blender/source/blender/blenkernel/intern/screen.c 2011-05-20 
04:14:29 UTC (rev 36787)
@@ -416,3 +416,20 @@
}
 }
 
+/* magic zoom calculation, no idea what
+ * it signifies, if you find out, tell me! -zr
+ */
+
+/* simple, its magic dude!
+ * well, to be honest, this gives a natural feeling zooming
+ * with multiple keypad presses (ton)
+ */
+float BKE_screen_view3d_zoom_to_fac(float camzoom)
+{
+   return powf(((float)M_SQRT2 + camzoom/50.0f), 2.0f) / 4.0f;
+}
+
+float BKE_screen_view3d_zoom_from_fac(float zoomfac)
+{
+   return ((sqrtf(4.0f * zoomfac) - (float)M_SQRT2) * 50.0f);
+}

Modified: trunk/blender/source/blender/editors/space_view3d/view3d_draw.c
===
--- trunk/blender/source/blender/editors/space_view3d/view3d_draw.c 
2011-05-20 01:02:00 UTC (rev 36786)
+++ trunk/blender/source/blender/editors/space_view3d/view3d_draw.c 
2011-05-20 04:14:29 UTC (rev 36787)
@@ -61,6 +61,7 @@
 #include BKE_global.h
 #include BKE_paint.h
 #include BKE_scene.h
+#include BKE_screen.h
 #include BKE_unit.h
 
 #include RE_pipeline.h   // make_stars
@@ -870,25 +871,15 @@
 
 void view3d_calc_camera_border(Scene *scene, ARegion *ar, RegionView3D *rv3d, 
View3D *v3d, rctf *viewborder_r, short do_shift)
 {
-   float zoomfac, size[2];
+   const float zoomfac= 
BKE_screen_view3d_zoom_to_fac((float)rv3d-camzoom);
+   float size[2];
float dx= 0.0f, dy= 0.0f;

view3d_viewborder_size_get(scene, ar, size);

if (rv3d == NULL)
rv3d = ar-regiondata;
-   
-   /* magic zoom calculation, no idea what
-   * it signifies, if you find out, tell me! -zr
-   */
-   /* simple, its magic dude!
-   * well, to be honest, this gives a natural feeling zooming
-   * with multiple keypad presses (ton)
-   */
-   
-   zoomfac= ((float)M_SQRT2 + rv3d-camzoom/50.0f);
-   zoomfac= (zoomfac*zoomfac) * 0.25f;
-   
+
size[0]= size[0]*zoomfac;
size[1]= size[1]*zoomfac;


Modified: trunk/blender/source/blender/editors/space_view3d/view3d_edit.c
===
--- trunk/blender/source/blender/editors/space_view3d/view3d_edit.c 
2011-05-20 01:02:00 UTC (rev 36786)
+++ trunk/blender/source/blender/editors/space_view3d/view3d_edit.c 
2011-05-20 04:14:29 UTC (rev 36787)
@@ -56,6 +56,7 @@
 #include BKE_paint.h
 #include BKE_report.h
 #include BKE_scene.h
+#include BKE_screen.h
 #include BKE_depsgraph.h /* for ED_view3d_camera_lock_sync */
 
 
@@ -919,14 +920,11 @@
 static void viewmove_apply(ViewOpsData *vod, int x, int y)
 {
if((vod-rv3d-persp==RV3D_CAMOB)  !(vod-v3d-flag2  
V3D_LOCK_CAMERA)) {
-   float zoomfac= ((float)M_SQRT2 + (float)vod-rv3d-camzoom / 
50.0f);
-   zoomfac= (zoomfac * zoomfac) * 0.5f;
-
+   const float zoomfac= 
BKE_screen_view3d_zoom_to_fac((float)vod-rv3d-camzoom) * 2.0f;
vod-rv3d-camdx += (vod-oldx - x)/(vod-ar-winx * zoomfac);
vod-rv3d-camdy += (vod-oldy - y)/(vod-ar-winy * zoomfac);
CLAMP(vod-rv3d-camdx, -1.0f, 1.0f);
  

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36788] trunk/blender/source/blender: use BKE_area_find_region_type in place of inline loops ( no functional changes).

2011-05-19 Thread Campbell Barton
Revision: 36788
  
http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=36788
Author:   campbellbarton
Date: 2011-05-20 05:27:31 + (Fri, 20 May 2011)
Log Message:
---
use BKE_area_find_region_type in place of inline loops (no functional changes).

Modified Paths:
--
trunk/blender/source/blender/editors/interface/view2d.c
trunk/blender/source/blender/editors/screen/area.c
trunk/blender/source/blender/editors/screen/screen_ops.c
trunk/blender/source/blender/editors/space_graph/space_graph.c
trunk/blender/source/blender/editors/space_image/space_image.c
trunk/blender/source/blender/editors/space_logic/space_logic.c
trunk/blender/source/blender/editors/space_nla/space_nla.c
trunk/blender/source/blender/editors/space_node/space_node.c
trunk/blender/source/blender/editors/space_sequencer/space_sequencer.c
trunk/blender/source/blender/editors/space_text/text_header.c
trunk/blender/source/blender/editors/space_time/space_time.c
trunk/blender/source/blender/editors/space_view3d/space_view3d.c
trunk/blender/source/blender/editors/space_view3d/view3d_draw.c
trunk/blender/source/blender/makesrna/intern/rna_space.c
trunk/blender/source/blender/windowmanager/intern/wm_init_exit.c
trunk/blender/source/blender/windowmanager/intern/wm_keymap.c

Modified: trunk/blender/source/blender/editors/interface/view2d.c
===
--- trunk/blender/source/blender/editors/interface/view2d.c 2011-05-20 
04:14:29 UTC (rev 36787)
+++ trunk/blender/source/blender/editors/interface/view2d.c 2011-05-20 
05:27:31 UTC (rev 36788)
@@ -44,6 +44,7 @@
 #include BLI_utildefines.h
 
 #include BKE_context.h
+#include BKE_screen.h
 #include BKE_global.h
 
 
@@ -1959,17 +1960,14 @@
 /* same as above, but it returns regionwindow. Utility for pulldowns or 
buttons */
 View2D *UI_view2d_fromcontext_rwin(const bContext *C)
 {
-   ScrArea *area= CTX_wm_area(C);
+   ScrArea *sa= CTX_wm_area(C);
ARegion *region= CTX_wm_region(C);
 
-   if (area == NULL) return NULL;
+   if (sa == NULL) return NULL;
if (region == NULL) return NULL;
if (region-regiontype!=RGN_TYPE_WINDOW) {
-   ARegion *ar= area-regionbase.first;
-   for(; ar; ar= ar-next)
-   if(ar-regiontype==RGN_TYPE_WINDOW)
-   return (ar-v2d);
-   return NULL;
+   ARegion *ar= BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
+   return ar ? (ar-v2d) : NULL;
}
return (region-v2d);
 }

Modified: trunk/blender/source/blender/editors/screen/area.c
===
--- trunk/blender/source/blender/editors/screen/area.c  2011-05-20 04:14:29 UTC 
(rev 36787)
+++ trunk/blender/source/blender/editors/screen/area.c  2011-05-20 05:27:31 UTC 
(rev 36788)
@@ -873,12 +873,10 @@
if(sa-spacetype!=SPACE_TIME) {
ARegion *ar;
static rcti rect= {0, 1, 0, 30};/* same local 
check for all areas */
-
-   for(ar= sa-regionbase.first; ar; ar= ar-next)
-   if(ar-regiontype == RGN_TYPE_WINDOW)
-   break;
-   if(ar)
+   ar= BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
+   if(ar) {
WM_event_add_keymap_handler_bb(handlers, 
keymap, rect, ar-winrct);
+   }
}
else
WM_event_add_keymap_handler(handlers, keymap);

Modified: trunk/blender/source/blender/editors/screen/screen_ops.c
===
--- trunk/blender/source/blender/editors/screen/screen_ops.c2011-05-20 
04:14:29 UTC (rev 36787)
+++ trunk/blender/source/blender/editors/screen/screen_ops.c2011-05-20 
05:27:31 UTC (rev 36788)
@@ -2616,13 +2616,8 @@
 */
if((ar == NULL) || (ar-regiontype != RGN_TYPE_HEADER)) {
ScrArea *sa= CTX_wm_area(C);
-   
-   /* loop over all regions until a matching one is found */
-   for (ar= sa-regionbase.first; ar; ar= ar-next) {
-   if(ar-regiontype == RGN_TYPE_HEADER)
-   break;
-   }
-   
+   ARegion *ar= BKE_area_find_region_type(sa, RGN_TYPE_HEADER);
+
/* don't do anything if no region */
if(ar == NULL)
return OPERATOR_CANCELLED;

Modified: trunk/blender/source/blender/editors/space_graph/space_graph.c
===
--- trunk/blender/source/blender/editors/space_graph/space_graph.c  
2011-05-20 04:14:29 UTC (rev 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36789] trunk/blender/source/blender/ editors/armature/editarmature.c: renaming bones didnt update update the view3d lock bone name.

2011-05-19 Thread Campbell Barton
Revision: 36789
  
http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=36789
Author:   campbellbarton
Date: 2011-05-20 05:39:56 + (Fri, 20 May 2011)
Log Message:
---
renaming bones didnt update update the view3d lock bone name.

Modified Paths:
--
trunk/blender/source/blender/editors/armature/editarmature.c

Modified: trunk/blender/source/blender/editors/armature/editarmature.c
===
--- trunk/blender/source/blender/editors/armature/editarmature.c
2011-05-20 05:27:31 UTC (rev 36788)
+++ trunk/blender/source/blender/editors/armature/editarmature.c
2011-05-20 05:39:56 UTC (rev 36789)
@@ -5530,6 +5530,26 @@
BKE_animdata_fix_paths_rename(ob-id, ob-adt, 
pose.bones, oldname, newname, 0, 0, 1);
}
}
+
+   {
+   /* correct view locking */
+   bScreen *screen;
+   for(screen= G.main-screen.first; screen; screen= 
screen-id.next) {
+   ScrArea *sa;
+   /* add regions */
+   for(sa= screen-areabase.first; sa; sa= 
sa-next) {
+   SpaceLink *sl= sa-spacedata.first;
+   if(sl-spacetype == SPACE_VIEW3D) {
+   View3D *v3d= (View3D *)sl;
+   if(v3d-ob_centre  
v3d-ob_centre-data == arm) {
+   if 
(!strcmp(v3d-ob_centre_bone, oldname)) {
+   
BLI_strncpy(v3d-ob_centre_bone, newname, MAXBONENAME);
+   }
+   }
+   }
+   }
+   }
+   }
}
 }
 

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