[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18415] branches/blender2.5/blender/source /blender/makesrna/intern/rna_action.c: RNA - Action Wrapping

2009-01-08 Thread Joshua Leung
Revision: 18415
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=18415
Author:   aligorith
Date: 2009-01-08 12:14:58 +0100 (Thu, 08 Jan 2009)

Log Message:
---
RNA - Action Wrapping

Removed flags used for Action Editor from wrapping for Action. These do not 
belong here!

Modified Paths:
--
branches/blender2.5/blender/source/blender/makesrna/intern/rna_action.c

Modified: 
branches/blender2.5/blender/source/blender/makesrna/intern/rna_action.c
===
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_action.c 
2009-01-08 02:50:37 UTC (rev 18414)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_action.c 
2009-01-08 11:14:58 UTC (rev 18415)
@@ -157,39 +157,10 @@
RNA_def_property_struct_type(prop, ActionGroup);
RNA_def_property_ui_text(prop, Action Groups, Convenient groupings 
of Action Channels.);
 
-   prop= RNA_def_property(srna, timeline_markers, PROP_COLLECTION, 
PROP_NONE);
+   prop= RNA_def_property(srna, pose_markers, PROP_COLLECTION, 
PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, markers, NULL);
RNA_def_property_struct_type(prop, UnknownType); /* implement when 
timeline rna is wrapped */
-   RNA_def_property_ui_text(prop, Timeline Markers, Markers specific to 
this Action, for labeling poses.);
-
-   prop= RNA_def_property(srna, action_show_sliders, PROP_BOOLEAN, 
PROP_NONE);
-   RNA_def_property_boolean_sdna(prop, NULL, flag, SACTION_SLIDERS);
-   RNA_def_property_ui_text(prop, Show Sliders, Show Shape Key 
sliders.);
-
-   prop= RNA_def_property(srna, action_time_units, PROP_BOOLEAN, 
PROP_NONE);
-   RNA_def_property_boolean_sdna(prop, NULL, flag, SACTION_DRAWTIME);
-   RNA_def_property_ui_text(prop, Time Units, Show seconds or frames in 
the timeline.);
-
-   prop= RNA_def_property(srna, action_show_all, PROP_BOOLEAN, 
PROP_NONE);
-   RNA_def_property_boolean_sdna(prop, NULL, flag, SACTION_NOHIDE);
-   RNA_def_property_ui_text(prop, Show All, Show all channels 
regardless of hidden status.);
-
-   prop= RNA_def_property(srna, action_kill_overlapping_keys, 
PROP_BOOLEAN, PROP_NONE);
-   RNA_def_property_boolean_sdna(prop, NULL, flag, 
SACTION_NOTRANSKEYCULL);
-   RNA_def_property_ui_text(prop, Kill Overlapping Keys, Remove 
overlapping keys after a transform.);
-
-   prop= RNA_def_property(srna, action_key_cull_to_view, PROP_BOOLEAN, 
PROP_NONE);
-   RNA_def_property_boolean_sdna(prop, NULL, flag, 
SACTION_HORIZOPTIMISEON);
-   RNA_def_property_ui_text(prop, Cull Keys to View, Only consider keys 
that are within the view.);
-
-   prop= RNA_def_property(srna, action_group_colors, PROP_BOOLEAN, 
PROP_NONE);
-   RNA_def_property_boolean_sdna(prop, NULL, flag, 
SACTION_NODRAWGCOLORS);
-   RNA_def_property_ui_text(prop, Group Color, Use custom color 
grouping and instead of default color scheme.);
-
-   prop= RNA_def_property(srna, action_current_frame_number, 
PROP_BOOLEAN, PROP_NONE);
-   RNA_def_property_boolean_sdna(prop, NULL, flag, 
SACTION_NODRAWCFRANUM);
-   RNA_def_property_ui_text(prop, Current Frame Number, Draw the frame 
number beside the current frame indicator.);
-
+   RNA_def_property_ui_text(prop, Pose Markers, Markers specific to 
this Action, for labeling poses.);
 }
 
 #endif


___
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 [18416] branches/blender2.5/blender: 2.5: make and cmake fixes for recent changes.

2009-01-08 Thread Brecht Van Lommel
Revision: 18416
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=18416
Author:   blendix
Date: 2009-01-08 14:54:39 +0100 (Thu, 08 Jan 2009)

Log Message:
---
2.5: make and cmake fixes for recent changes.

Modified Paths:
--
branches/blender2.5/blender/intern/ghost/Makefile
branches/blender2.5/blender/source/Makefile
branches/blender2.5/blender/source/blender/blenkernel/CMakeLists.txt

Modified: branches/blender2.5/blender/intern/ghost/Makefile
===
--- branches/blender2.5/blender/intern/ghost/Makefile   2009-01-08 11:14:58 UTC 
(rev 18415)
+++ branches/blender2.5/blender/intern/ghost/Makefile   2009-01-08 13:54:39 UTC 
(rev 18416)
@@ -38,7 +38,7 @@
 
 include nan_subdirs.mk
 
-install: all
+install: all debug
@[ -d $(NAN_GHOST) ] || mkdir $(NAN_GHOST)
@[ -d $(NAN_GHOST)/include ] || mkdir $(NAN_GHOST)/include
@[ -d $(NAN_GHOST)/lib ] || mkdir $(NAN_GHOST)/lib

Modified: branches/blender2.5/blender/source/Makefile
===
--- branches/blender2.5/blender/source/Makefile 2009-01-08 11:14:58 UTC (rev 
18415)
+++ branches/blender2.5/blender/source/Makefile 2009-01-08 13:54:39 UTC (rev 
18416)
@@ -237,8 +237,8 @@
 PULIB += $(OCGDIR)/blender/ed_view3d/libed_view3d.a
 PULIB += $(OCGDIR)/blender/ed_interface/libed_interface.a
 PULIB += $(OCGDIR)/blender/ed_object/libed_object.a
+PULIB += $(OCGDIR)/blender/ed_armature/libed_armature.a
 PULIB += $(OCGDIR)/blender/ed_mesh/libed_mesh.a
-PULIB += $(OCGDIR)/blender/ed_armature/libed_armature.a
 PULIB += $(OCGDIR)/blender/ed_animation/libed_animation.a
 PULIB += $(OCGDIR)/blender/ed_transform/libed_transform.a
 PULIB += $(OCGDIR)/blender/ed_util/libed_util.a

Modified: branches/blender2.5/blender/source/blender/blenkernel/CMakeLists.txt
===
--- branches/blender2.5/blender/source/blender/blenkernel/CMakeLists.txt
2009-01-08 11:14:58 UTC (rev 18415)
+++ branches/blender2.5/blender/source/blender/blenkernel/CMakeLists.txt
2009-01-08 13:54:39 UTC (rev 18416)
@@ -33,6 +33,7 @@
   ../../../intern/iksolver/extern ../blenloader ../quicktime
   ../../../intern/bmfont ../../../extern/bullet2/src
   ../nodes ../../../extern/glew/include ../gpu ../makesrna
+  ../../../intern/bsp/extern
   ${SDL_INC}
   ${ZLIB_INC}
 )


___
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 [18417] branches/blender2.5/blender/source /blender/makesrna: RNA

2009-01-08 Thread Brecht Van Lommel
Revision: 18417
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=18417
Author:   blendix
Date: 2009-01-08 14:57:29 +0100 (Thu, 08 Jan 2009)

Log Message:
---
RNA
* The generated code is now split into multiple files instead
  of a single big one. Scons, make and cmake are updated to
  deal with this.

Modified Paths:
--
branches/blender2.5/blender/source/blender/makesrna/RNA_types.h
branches/blender2.5/blender/source/blender/makesrna/intern/CMakeLists.txt
branches/blender2.5/blender/source/blender/makesrna/intern/Makefile
branches/blender2.5/blender/source/blender/makesrna/intern/SConscript
branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_ID.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_internal.h
branches/blender2.5/blender/source/blender/makesrna/intern/rna_lattice.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_meta.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_modifier.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_object.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_rna.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_scene.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_text.c

Modified: branches/blender2.5/blender/source/blender/makesrna/RNA_types.h
===
--- branches/blender2.5/blender/source/blender/makesrna/RNA_types.h 
2009-01-08 13:54:39 UTC (rev 18416)
+++ branches/blender2.5/blender/source/blender/makesrna/RNA_types.h 
2009-01-08 13:57:29 UTC (rev 18417)
@@ -132,7 +132,8 @@
STRUCT_ID = 1,
 
/* internal flags */
-   STRUCT_RUNTIME = 2
+   STRUCT_RUNTIME = 2,
+   STRUCT_GENERATED = 4
 } StructFlag;
 
 typedef struct StructRNA StructRNA;

Modified: 
branches/blender2.5/blender/source/blender/makesrna/intern/CMakeLists.txt
===
--- branches/blender2.5/blender/source/blender/makesrna/intern/CMakeLists.txt   
2009-01-08 13:54:39 UTC (rev 18416)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/CMakeLists.txt   
2009-01-08 13:57:29 UTC (rev 18417)
@@ -24,8 +24,7 @@
 #
 # * END GPL LICENSE BLOCK *
 
-SET(SRC
- makesrna.c
+SET(DEFSRC
  rna_action.c
  rna_actuator.c
  rna_armature.c
@@ -36,7 +35,6 @@
  rna_constraint.c
  rna_controller.c
  rna_curve.c
- rna_define.c
  rna_fluidsim.c
  rna_group.c
  rna_ID.c
@@ -70,7 +68,58 @@
  rna_userdef.c
  rna_vfont.c
  rna_wm.c
- rna_world.c
+ rna_world.c)
+
+SET(GENSRC
+ rna_action_gen.c
+ rna_actuator_gen.c
+ rna_armature_gen.c
+ rna_brush_gen.c
+ rna_camera_gen.c
+ rna_cloth_gen.c
+ rna_color_gen.c
+ rna_constraint_gen.c
+ rna_controller_gen.c
+ rna_curve_gen.c
+ rna_fluidsim_gen.c
+ rna_group_gen.c
+ rna_ID_gen.c
+ rna_image_gen.c
+ rna_ipo_gen.c
+ rna_key_gen.c
+ rna_lamp_gen.c
+ rna_lattice_gen.c
+ rna_main_gen.c
+ rna_material_gen.c
+ rna_mesh_gen.c
+ rna_meta_gen.c
+ rna_modifier_gen.c
+ rna_nodetree_gen.c
+ rna_object_gen.c
+ rna_object_force_gen.c
+ rna_packedfile_gen.c
+ rna_particle_gen.c
+ rna_pose_gen.c
+ rna_property_gen.c
+ rna_radio_gen.c
+ rna_rna_gen.c
+ rna_scene_gen.c
+ rna_screen_gen.c
+ rna_scriptlink_gen.c
+ rna_sensor_gen.c
+ rna_sequence_gen.c
+ rna_sound_gen.c
+ rna_text_gen.c
+ rna_texture_gen.c
+ rna_userdef_gen.c
+ rna_vfont_gen.c
+ rna_wm_gen.c
+ rna_world_gen.c)
+
+SET(SRC
+ makesrna.c
+ rna_define.c
+ ${DEFSRC}
  ../../../../intern/guardedalloc/intern/mallocn.c
  ../../../../intern/guardedalloc/intern/mmap_win.c)
 
@@ -81,15 +130,16 @@
 ADD_EXECUTABLE(makesrna ${SRC} ${INC_FILES})
 TARGET_LINK_LIBRARIES(makesrna bf_dna)
 
-# Output rna.c
+# Output rna_*_gen.c
 ADD_CUSTOM_COMMAND(
-  OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/rna.c
-  COMMAND ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/makesrna 
${CMAKE_CURRENT_BINARY_DIR}/rna.c ${CMAKE_SOURCE_DIR}/source/blender/makesrna/
+  OUTPUT ${GENSRC}
+  COMMAND ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/makesrna 
${CMAKE_CURRENT_BINARY_DIR}/ ${CMAKE_SOURCE_DIR}/source/blender/makesrna/
   DEPENDS makesrna
 )
 
 # Build bf_rna
-SET(SRC rna_access.c rna_dependency.c rna.c)
+SET(SRC rna_access.c rna_dependency.c ${GENSRC})
 BLENDERLIB(bf_rna ${SRC} ${INC})
 
 MESSAGE(STATUS Configuring makesrna)
+

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/Makefile
===
--- branches/blender2.5/blender/source/blender/makesrna/intern/Makefile 
2009-01-08 13:54:39 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18419] branches/blender2.5/blender/source /blender: RNA: don't pass RNA type in RNA_id_pointer_create, can be found automatically.

2009-01-08 Thread Brecht Van Lommel
Revision: 18419
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=18419
Author:   blendix
Date: 2009-01-08 16:33:34 +0100 (Thu, 08 Jan 2009)

Log Message:
---
RNA: don't pass RNA type in RNA_id_pointer_create, can be found automatically.

Modified Paths:
--
branches/blender2.5/blender/source/blender/editors/space_outliner/outliner.c
branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
branches/blender2.5/blender/source/blender/makesrna/intern/rna_access.c

branches/blender2.5/blender/source/blender/windowmanager/intern/wm_event_system.c

branches/blender2.5/blender/source/blender/windowmanager/intern/wm_operators.c

Modified: 
branches/blender2.5/blender/source/blender/editors/space_outliner/outliner.c
===
--- 
branches/blender2.5/blender/source/blender/editors/space_outliner/outliner.c
2009-01-08 15:29:09 UTC (rev 18418)
+++ 
branches/blender2.5/blender/source/blender/editors/space_outliner/outliner.c
2009-01-08 15:33:34 UTC (rev 18419)
@@ -1357,7 +1357,7 @@
else if(soops-outlinevis==SO_USERDEF) {
PointerRNA userdefptr;
 
-   RNA_pointer_create(NULL, NULL, RNA_UserPreferences, U, 
userdefptr);
+   RNA_pointer_create(NULL, RNA_UserPreferences, U, userdefptr);
 
ten= outliner_add_element(soops, soops-tree, 
(void*)userdefptr, NULL, TSE_RNA_STRUCT, -1);
 

Modified: branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
===
--- branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
2009-01-08 15:29:09 UTC (rev 18418)
+++ branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
2009-01-08 15:33:34 UTC (rev 18419)
@@ -270,8 +270,8 @@
  */
 
 void RNA_main_pointer_create(struct Main *main, PointerRNA *r_ptr);
-void RNA_id_pointer_create(StructRNA *idtype, struct ID *id, PointerRNA 
*r_ptr);
-void RNA_pointer_create(StructRNA *idtype, struct ID *id, StructRNA *type, 
void *data, PointerRNA *r_ptr);
+void RNA_id_pointer_create(struct ID *id, PointerRNA *r_ptr);
+void RNA_pointer_create(struct ID *id, StructRNA *type, void *data, PointerRNA 
*r_ptr);
 
 void RNA_blender_rna_pointer_create(PointerRNA *r_ptr);
 

Modified: 
branches/blender2.5/blender/source/blender/makesrna/intern/rna_access.c
===
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_access.c 
2009-01-08 15:29:09 UTC (rev 18418)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_access.c 
2009-01-08 15:33:34 UTC (rev 18419)
@@ -61,16 +61,34 @@
r_ptr-data= main;
 }
 
-void RNA_id_pointer_create(StructRNA *idtype, ID *id, PointerRNA *r_ptr)
+void RNA_id_pointer_create(ID *id, PointerRNA *r_ptr)
 {
+   PointerRNA tmp;
+   StructRNA *idtype= NULL;
+
+   if(id) {
+   memset(tmp, 0, sizeof(tmp));
+   tmp.data= id;
+   idtype= rna_ID_refine(tmp);
+   }
+
r_ptr-id.type= idtype;
r_ptr-id.data= id;
r_ptr-type= idtype;
r_ptr-data= id;
 }
 
-void RNA_pointer_create(StructRNA *idtype, ID *id, StructRNA *type, void 
*data, PointerRNA *r_ptr)
+void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
 {
+   PointerRNA tmp;
+   StructRNA *idtype= NULL;
+
+   if(id) {
+   memset(tmp, 0, sizeof(tmp));
+   tmp.data= id;
+   idtype= rna_ID_refine(tmp);
+   }
+
r_ptr-id.type= idtype;
r_ptr-id.data= id;
r_ptr-type= type;

Modified: 
branches/blender2.5/blender/source/blender/windowmanager/intern/wm_event_system.c
===
--- 
branches/blender2.5/blender/source/blender/windowmanager/intern/wm_event_system.c
   2009-01-08 15:29:09 UTC (rev 18418)
+++ 
branches/blender2.5/blender/source/blender/windowmanager/intern/wm_event_system.c
   2009-01-08 15:33:34 UTC (rev 18419)
@@ -392,7 +392,7 @@
IDPropertyTemplate val = {0};
op-properties= IDP_New(IDP_GROUP, val, 
wmOperatorProperties);
}
-   RNA_pointer_create(RNA_WindowManager, wm-id, ot-srna, 
op-properties, op-ptr);
+   RNA_pointer_create(wm-id, ot-srna, op-properties, op-ptr);
 
/* initialize error reports */
if (reports) {

Modified: 
branches/blender2.5/blender/source/blender/windowmanager/intern/wm_operators.c
===
--- 
branches/blender2.5/blender/source/blender/windowmanager/intern/wm_operators.c  
2009-01-08 15:29:09 UTC (rev 18418)
+++ 
branches/blender2.5/blender/source/blender/windowmanager/intern/wm_operators.c  
2009-01-08 15:33:34 UTC 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18420] branches/blender2.5/blender/source /blender/blenkernel/intern/blender.c: 2.5

2009-01-08 Thread Martin Poirier
Revision: 18420
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=18420
Author:   theeth
Date: 2009-01-08 17:52:30 +0100 (Thu, 08 Jan 2009)

Log Message:
---
2.5

Crash when loading certain files with armature. Use scene from context instead 
of local var (which can be null).

Modified Paths:
--
branches/blender2.5/blender/source/blender/blenkernel/intern/blender.c

Modified: branches/blender2.5/blender/source/blender/blenkernel/intern/blender.c
===
--- branches/blender2.5/blender/source/blender/blenkernel/intern/blender.c  
2009-01-08 15:33:34 UTC (rev 18419)
+++ branches/blender2.5/blender/source/blender/blenkernel/intern/blender.c  
2009-01-08 16:52:30 UTC (rev 18420)
@@ -378,7 +378,7 @@
/* last stage of do_versions actually, that sets recalc flags for 
recalc poses */
for(ob= G.main-object.first; ob; ob= ob-id.next) {
if(ob-type==OB_ARMATURE)
-   if(ob-recalc) object_handle_update(curscene, ob);
+   if(ob-recalc) object_handle_update(CTX_data_scene(C), 
ob);
}

/* now tag update flags, to ensure deformers get calculated on redraw */


___
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 [18421] branches/blender2.5/blender/source /blender/editors: 2.5

2009-01-08 Thread Martin Poirier
Revision: 18421
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=18421
Author:   theeth
Date: 2009-01-08 18:12:50 +0100 (Thu, 08 Jan 2009)

Log Message:
---
2.5

Transform editbones

Modified Paths:
--
branches/blender2.5/blender/source/blender/editors/armature/editarmature.c
branches/blender2.5/blender/source/blender/editors/include/ED_armature.h

branches/blender2.5/blender/source/blender/editors/transform/transform_conversions.c

branches/blender2.5/blender/source/blender/editors/transform/transform_generics.c

Modified: 
branches/blender2.5/blender/source/blender/editors/armature/editarmature.c
===
--- branches/blender2.5/blender/source/blender/editors/armature/editarmature.c  
2009-01-08 16:52:30 UTC (rev 18420)
+++ branches/blender2.5/blender/source/blender/editors/armature/editarmature.c  
2009-01-08 17:12:50 UTC (rev 18421)
@@ -1830,7 +1830,7 @@
 /* adjust bone roll to align Z axis with vector
  * vec is in local space and is normalized
  */
-float rollBoneToVector(EditBone *bone, float new_up_axis[3])
+float ED_rollBoneToVector(EditBone *bone, float new_up_axis[3])
 {
float mat[3][3], nor[3], up_axis[3], vec[3];
float roll;

Modified: 
branches/blender2.5/blender/source/blender/editors/include/ED_armature.h
===
--- branches/blender2.5/blender/source/blender/editors/include/ED_armature.h
2009-01-08 16:52:30 UTC (rev 18420)
+++ branches/blender2.5/blender/source/blender/editors/include/ED_armature.h
2009-01-08 17:12:50 UTC (rev 18421)
@@ -92,7 +92,10 @@
short hits, short 
extend);
 void mouse_armature(struct bContext *C, short mval[2], int extend);
 
+float ED_rollBoneToVector(EditBone *bone, float new_up_axis[3]);
 
+void transform_armature_mirror_update(struct Object *obedit);
+
 /* poseobject.c */
 void ED_armature_exit_posemode(struct Base *base);
 void ED_armature_enter_posemode(struct Base *base);

Modified: 
branches/blender2.5/blender/source/blender/editors/transform/transform_conversions.c
===
--- 
branches/blender2.5/blender/source/blender/editors/transform/transform_conversions.c
2009-01-08 16:52:30 UTC (rev 18420)
+++ 
branches/blender2.5/blender/source/blender/editors/transform/transform_conversions.c
2009-01-08 17:12:50 UTC (rev 18421)
@@ -1021,25 +1021,29 @@
 
 static void createTransArmatureVerts(bContext *C, TransInfo *t)
 {
-   // TRANSFORM_FIX_ME
-#if 0
EditBone *ebo;
bArmature *arm= t-obedit-data;
+   ListBase *edbo = arm-edbo;
TransData *td;
float mtx[3][3], smtx[3][3], delta[3], bonemat[3][3];
 
t-total = 0;
-   for (ebo=G.edbo.first;ebo;ebo=ebo-next) {
-   if(ebo-layer  arm-layer) {
-   if (t-mode==TFM_BONESIZE) {
+   for (ebo = edbo-first; ebo; ebo = ebo-next)
+   {
+   if(ebo-layer  arm-layer)
+   {
+   if (t-mode==TFM_BONESIZE)
+   {
if (ebo-flag  BONE_SELECTED)
t-total++;
}
-   else if (t-mode==TFM_BONE_ROLL) {
+   else if (t-mode==TFM_BONE_ROLL)
+   {
if (ebo-flag  BONE_SELECTED)
t-total++;
}
-   else {
+   else
+   {
if (ebo-flag  BONE_TIPSEL)
t-total++;
if (ebo-flag  BONE_ROOTSEL)
@@ -1055,13 +1059,15 @@
 
 td = t-data = MEM_callocN(t-total*sizeof(TransData), TransEditBone);

-   for (ebo=G.edbo.first;ebo;ebo=ebo-next){
-   ebo-oldlength= ebo-length;// length==0.0 on extrude, used 
for scaling radius of bone points
+   for (ebo = edbo-first; ebo; ebo = ebo-next)
+   {
+   ebo-oldlength = ebo-length;   // length==0.0 on extrude, used 
for scaling radius of bone points

if(ebo-layer  arm-layer) {
-   if (t-mode==TFM_BONE_ENVELOPE) {
-   
-   if (ebo-flag  BONE_ROOTSEL){
+   if (t-mode==TFM_BONE_ENVELOPE)
+   {
+   if (ebo-flag  BONE_ROOTSEL)
+   {
td-val= ebo-rad_head;
td-ival= *td-val;

@@ -1077,7 +1083,8 @@

   

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18423] branches/etch-a-ton/source/blender /src/editarmature_sketch.c: display overdrawn stroke in gray, to easily see what is being replaced.

2009-01-08 Thread Martin Poirier
Revision: 18423
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=18423
Author:   theeth
Date: 2009-01-08 19:23:48 +0100 (Thu, 08 Jan 2009)

Log Message:
---
display overdrawn stroke in gray, to easily see what is being replaced.

Modified Paths:
--
branches/etch-a-ton/source/blender/src/editarmature_sketch.c

Modified: branches/etch-a-ton/source/blender/src/editarmature_sketch.c
===
--- branches/etch-a-ton/source/blender/src/editarmature_sketch.c
2009-01-08 18:20:47 UTC (rev 18422)
+++ branches/etch-a-ton/source/blender/src/editarmature_sketch.c
2009-01-08 18:23:48 UTC (rev 18423)
@@ -96,6 +96,7 @@
 {
SK_Stroke *target;
int start, end;
+   int count;
 } SK_Adjustment;
 
 #define SK_Stroke_BUFFER_INIT_SIZE 20
@@ -200,6 +201,9 @@
 void sk_applyConvertGesture(SK_Gesture *gest, SK_Sketch *sketch);
 
 
+void sk_resetAdjust(SK_Sketch *sketch);
+int sk_hasAdjust(SK_Sketch *sketch, SK_Stroke *stk);
+
 / GESTURE ACTIONS **/
 
 SK_GestureAction GESTURE_ACTIONS[] =
@@ -1013,6 +1017,7 @@
 {
if (sketch-active_stroke != NULL)
{
+   sk_resetAdjust(sketch);
sk_removeStroke(sketch, sketch-active_stroke);
}
 }
@@ -1122,7 +1127,7 @@
return pt;
 }
 
-void sk_drawStroke(SK_Stroke *stk, int id, float color[3])
+void sk_drawStroke(SK_Stroke *stk, int id, float color[3], int start, int end)
 {
float rgb[3];
int i;
@@ -1153,7 +1158,14 @@
 
for (i = 0; i  stk-nb_points; i++)
{
-   glColor3fv(rgb);
+   if (i = start  i = end)
+   {
+   glColor3f(0.3, 0.3, 0.3);
+   }
+   else
+   {
+   glColor3fv(rgb);
+   }
glVertex3fv(stk-points[i].p);
VecAddf(rgb, rgb, d_rgb);
}
@@ -1345,12 +1357,25 @@
return pt;
 }
 
+void sk_resetAdjust(SK_Sketch *sketch)
+{
+   sketch-adj.target = NULL;
+   sketch-adj.start = 0;
+   sketch-adj.end = 0;
+   sketch-adj.count = 0;
+}
+
+int sk_hasAdjust(SK_Sketch *sketch, SK_Stroke *stk)
+{
+   return sketch-adj.target  sketch-adj.count = 3  
(sketch-adj.target == stk || stk == NULL);
+}
+
 void sk_updateAdjust(SK_Sketch *sketch, SK_Stroke *stk, SK_DrawData *dd)
 {
if (sketch-adj.target == NULL)
{
SK_Stroke *target;
-   int closest_index = 0;
+   int closest_index = -1;
int dist = SNAP_MIN_DISTANCE * 2;

for (target = sketch-strokes.first; target; target = 
target-next)
@@ -1371,6 +1396,11 @@

if (sketch-adj.target != NULL)
{
+   if (closest_index  -1)
+   {
+   sketch-adj.count++;
+   }
+
if (stk-nb_points == 1)
{
sketch-adj.start = closest_index;
@@ -1379,7 +1409,6 @@
{
sketch-adj.end = closest_index;
}
-   sketch-adj.target-selected = 1;
}
}
else if (sketch-adj.target != NULL)
@@ -1392,49 +1421,69 @@

if (closest_pt != NULL)
{
+   sketch-adj.count++;
sketch-adj.end = index;
}
else
{
-   sketch-adj.end = 0;
+   sketch-adj.end = -1;
}
}
 }
 
+/* return 1 on reverse needed */
+int sk_adjustIndexes(SK_Sketch *sketch, int *start, int *end)
+{
+   int retval = 0;
+
+   *start = sketch-adj.start;
+   *end = sketch-adj.end;
+   
+   if (*end == -1)
+   {
+   *end = sketch-adj.target-nb_points - 1;
+   }
+   
+   if (*end  *start)
+   {
+   int tmp = *start;
+   *start = *end;
+   *end = tmp;
+   retval = 1;
+   }
+   
+   return retval;
+}
+
 void sk_endAdjust(SK_Sketch *sketch)
 {
SK_Stroke *stk = sketch-active_stroke;

-   if (sketch-adj.target)
+   if (sk_hasAdjust(sketch, NULL))
{
-   int start = sketch-adj.start;
-   int end = sketch-adj.end;
+   int start;
+   int end;

-   if (end == 0)
+   if (sk_adjustIndexes(sketch, start, end))
{
-   end = sketch-adj.target-nb_points - 1;
+   

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18424] branches/blender2.5/blender/source /blender: 2.5 filebrowser

2009-01-08 Thread Andrea Weikert
Revision: 18424
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=18424
Author:   elubie
Date: 2009-01-08 19:47:16 +0100 (Thu, 08 Jan 2009)

Log Message:
---
2.5 filebrowser
cleanup of space initialisation
fix for filebrowser opening with wrong parameters from window pupmenu after 
having been opened with F1.

Modified Paths:
--
branches/blender2.5/blender/source/blender/editors/include/ED_fileselect.h
branches/blender2.5/blender/source/blender/editors/space_file/file_draw.c
branches/blender2.5/blender/source/blender/editors/space_file/file_header.c
branches/blender2.5/blender/source/blender/editors/space_file/file_ops.c
branches/blender2.5/blender/source/blender/editors/space_file/filesel.c
branches/blender2.5/blender/source/blender/editors/space_file/space_file.c

branches/blender2.5/blender/source/blender/windowmanager/intern/wm_operators.c

Modified: 
branches/blender2.5/blender/source/blender/editors/include/ED_fileselect.h
===
--- branches/blender2.5/blender/source/blender/editors/include/ED_fileselect.h  
2009-01-08 18:23:48 UTC (rev 18423)
+++ branches/blender2.5/blender/source/blender/editors/include/ED_fileselect.h  
2009-01-08 18:47:16 UTC (rev 18424)
@@ -28,6 +28,8 @@
 #ifndef ED_FILES_H
 #define ED_FILES_H
 
+struct SpaceFile;
+
 typedef struct FileSelectParams {
int type; /* the mode of the filebrowser, FILE_BLENDER, FILE_SPECIAL, 
FILE_MAIN or FILE_LOADLIB */
char title[24]; /* title, also used for the text of the execute button 
*/
@@ -53,10 +55,12 @@
/* XXX --- end unused -- */
 } FileSelectParams;
 
-FileSelectParams* ED_fileselect_get_params(const struct bContext *C);
+FileSelectParams* ED_fileselect_get_params(struct SpaceFile *sfile);
 
-short ED_fileselect_set_params(FileSelectParams *params, int type, const char 
*title, const char *path, 
+short ED_fileselect_set_params(struct SpaceFile *sfile, int type, const char 
*title, const char *path, 
   short flag, short display, 
short filter);
 
+void ED_fileselect_reset_params(struct SpaceFile *sfile);
+
 #endif /* ED_FILES_H */
 

Modified: 
branches/blender2.5/blender/source/blender/editors/space_file/file_draw.c
===
--- branches/blender2.5/blender/source/blender/editors/space_file/file_draw.c   
2009-01-08 18:23:48 UTC (rev 18423)
+++ branches/blender2.5/blender/source/blender/editors/space_file/file_draw.c   
2009-01-08 18:47:16 UTC (rev 18424)
@@ -128,7 +128,7 @@
 void file_draw_buttons(const bContext *C, ARegion *ar)
 {
SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C);
-   FileSelectParams* params = sfile-params;
+   FileSelectParams* params = ED_fileselect_get_params(sfile);
uiBlock *block;
int loadbutton;
char name[20];
@@ -277,7 +277,7 @@
 void file_calc_previews(const bContext *C, ARegion *ar)
 {
SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C);
-   FileSelectParams* params = sfile-params;
+   FileSelectParams* params = ED_fileselect_get_params(sfile);
View2D *v2d= ar-v2d;
int width=0, height=0;
int rows, columns;
@@ -316,7 +316,7 @@
 void file_draw_previews(const bContext *C, ARegion *ar)
 {
SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C);
-   FileSelectParams* params=sfile-params;
+   FileSelectParams* params= ED_fileselect_get_params(sfile);
View2D *v2d= ar-v2d;
static double lasttime= 0;
struct FileList* files = sfile-files;
@@ -471,7 +471,7 @@
 void file_draw_list(const bContext *C, ARegion *ar)
 {
SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C);
-   FileSelectParams* params = sfile-params;
+   FileSelectParams* params = ED_fileselect_get_params(sfile);
struct FileList* files = sfile-files;
struct direntry *file;
int numfiles;
@@ -558,7 +558,7 @@
 void file_draw_fsmenu(const bContext *C, ARegion *ar)
 {
SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C);
-   FileSelectParams* params = sfile-params;
+   FileSelectParams* params = ED_fileselect_get_params(sfile);
char bookmark[FILE_MAX];
int nentries = fsmenu_get_nentries();
int linestep = U.fontsize*3/2;

Modified: 
branches/blender2.5/blender/source/blender/editors/space_file/file_header.c
===
--- branches/blender2.5/blender/source/blender/editors/space_file/file_header.c 
2009-01-08 18:23:48 UTC (rev 18423)
+++ branches/blender2.5/blender/source/blender/editors/space_file/file_header.c 
2009-01-08 18:47:16 UTC (rev 18424)
@@ -117,7 +117,7 @@
 {
ScrArea *sa= CTX_wm_area(C);
SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C);
-   FileSelectParams* params = sfile-params;
+   

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18425] branches/sim_physics/source/ blender/render/intern/source/volume_precache.c: * fixed an incredibly silly typo-bug in light cache

2009-01-08 Thread Matt Ebb
Revision: 18425
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=18425
Author:   broken
Date: 2009-01-08 23:49:03 +0100 (Thu, 08 Jan 2009)

Log Message:
---
* fixed an incredibly silly typo-bug in light cache

Modified Paths:
--
branches/sim_physics/source/blender/render/intern/source/volume_precache.c

Modified: 
branches/sim_physics/source/blender/render/intern/source/volume_precache.c
===
--- branches/sim_physics/source/blender/render/intern/source/volume_precache.c  
2009-01-08 18:47:16 UTC (rev 18424)
+++ branches/sim_physics/source/blender/render/intern/source/volume_precache.c  
2009-01-08 22:49:03 UTC (rev 18425)
@@ -204,7 +204,7 @@
i = rgb*res_3 + x*res_2 + y*res + z;
 
/* trigger for outside mesh */
-   if (cache[i]  0.5f) cache[i] = 
get_avg_surrounds(cache, res, res_2, res_3, rgb, x, y, z);
+   if (cache[i]  -0.5f) cache[i] = 
get_avg_surrounds(cache, res, res_2, res_3, rgb, x, y, z);
}
}
}


___
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 [18426] branches/blender2.5/blender/source /blender/editors/sculpt: More sculpt cleanup, removed sculpt_data and sculpt_session functions,

2009-01-08 Thread Nicholas Bishop
Revision: 18426
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=18426
Author:   nicholasbishop
Date: 2009-01-09 01:38:48 +0100 (Fri, 09 Jan 2009)

Log Message:
---
More sculpt cleanup, removed sculpt_data and sculpt_session functions, 
both of which used G(lobal)

Modified Paths:
--
branches/blender2.5/blender/source/blender/editors/sculpt/sculpt.c
branches/blender2.5/blender/source/blender/editors/sculpt/sculpt_intern.h
branches/blender2.5/blender/source/blender/editors/sculpt/stroke.c

Modified: branches/blender2.5/blender/source/blender/editors/sculpt/sculpt.c
===
--- branches/blender2.5/blender/source/blender/editors/sculpt/sculpt.c  
2009-01-08 22:49:03 UTC (rev 18425)
+++ branches/blender2.5/blender/source/blender/editors/sculpt/sculpt.c  
2009-01-09 00:38:48 UTC (rev 18426)
@@ -32,8 +32,6 @@
  *
  */
 
-// XXX #include GHOST_Types.h
-
 #include MEM_guardedalloc.h
 
 #include BLI_arithb.h
@@ -164,39 +162,25 @@
 
 static Object *active_ob= NULL;
 
-SculptData *sculpt_data(void)
-{
-   return NULL; /*XXX: return G.scene-sculptdata; */
-}
+static void init_brushaction(SculptData *sd, BrushAction *a, short *, short *);
 
-static void sculpt_init_session(void);
-static void init_brushaction(BrushAction *a, short *, short *);
-static void sculpt_undo_push(const short);
 
-SculptSession *sculpt_session(void)
-{
-   if(!sculpt_data()-session)
-   sculpt_init_session();
-   return sculpt_data()-session;
-}
-
 /* = MEMORY =
  * 
  * Allocate/initialize/free data
  */
 
-static void sculpt_init_session(void)
+static void sculpt_init_session(SculptData *sd)
 {
-   if(sculpt_data()-session)
+   if(sd-session)
;/*XXX: sculptsession_free(G.scene); */
-   sculpt_data()-session= MEM_callocN(sizeof(SculptSession), 
SculptSession);
+   sd-session= MEM_callocN(sizeof(SculptSession), SculptSession);
 }
 
 /* vertex_users is an array of Lists that store all the faces that use a
particular vertex. vertex_users is in the same order as mesh.mvert */
-static void calc_vertex_users()
+static void calc_vertex_users(SculptSession *ss)
 {
-   SculptSession *ss= sculpt_session();
int i,j;
IndexNode *node= NULL;
 
@@ -292,9 +276,8 @@
 
 /* Uses window coordinates (x,y) and depth component z to find a point in
modelspace */
-void unproject(float out[3], const short x, const short y, const float z)
+void unproject(SculptSession *ss, float out[3], const short x, const short y, 
const float z)
 {
-   SculptSession *ss= sculpt_session();
double ux, uy, uz;
 
 gluUnProject(x,y,z, ss-mats-modelview, ss-mats-projection,
@@ -305,9 +288,8 @@
 }
 
 /* Convert a point in model coordinates to 2D screen coordinates. */
-static void projectf(const float v[3], float p[2])
+static void projectf(SculptSession *ss, const float v[3], float p[2])
 {
-   SculptSession *ss= sculpt_session();
double ux, uy, uz;
 
gluProject(v[0],v[1],v[2], ss-mats-modelview, ss-mats-projection,
@@ -316,10 +298,10 @@
p[1]= uy;
 }
 
-static void project(const float v[3], short p[2])
+static void project(SculptSession *ss, const float v[3], short p[2])
 {
float f[2];
-   projectf(v, f);
+   projectf(ss, v, f);
 
p[0]= f[0];
p[1]= f[1];
@@ -333,9 +315,8 @@
shrink the brush. Skipped for grab brush because only the first mouse down
size is used, which is small if the user has just touched the pen to the
tablet */
-char brush_size(Brush *b)
+char brush_size(SculptData *sd, Brush *b)
 {
-   SculptData *sd = NULL; /* XXX */
float size= b-size;
float pressure= 0; /* XXX: get_pressure(); */
short activedevice= get_activedevice();
@@ -355,9 +336,8 @@
 /* Return modified brush strength. Includes the direction of the brush, 
positive
values pull vertices, negative values push. Uses tablet pressure and a
special multiplier found experimentally to scale the strength factor. */
-float brush_strength(Brush *b, BrushAction *a)
+float brush_strength(SculptData *sd, Brush *b, BrushAction *a)
 {
-   SculptData *sd = NULL; /* XXX */
float dir= b-flag  BRUSH_DIR_IN ? -1 : 1;
float pressure= 1;
short activedevice= get_activedevice();
@@ -408,9 +388,8 @@
}   
 }
 
-void sculpt_axislock(float *co)
+void sculpt_axislock(SculptData *sd, float *co)
 {
-   SculptData *sd = sculpt_data();
if (sd-flags  (SCULPT_LOCK_X|SCULPT_LOCK_Y|SCULPT_LOCK_Z)) return;
/* XXX: if(G.vd-twmode == V3D_MANIP_LOCAL) { */
if(0) {
@@ -444,10 +423,9 @@
 
 /* Currently only for the draw brush; finds average normal for all active
vertices */
-void calc_area_normal(float out[3], const BrushAction *a, const float *outdir, 
const ListBase* active_verts)
+void calc_area_normal(SculptData 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18427] branches/blender2.5/blender/source /blender/editors/sculpt/sculpt.c: Cleaned up some missing functions in sculpt.

2009-01-08 Thread Nicholas Bishop
Revision: 18427
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=18427
Author:   nicholasbishop
Date: 2009-01-09 06:24:11 +0100 (Fri, 09 Jan 2009)

Log Message:
---
Cleaned up some missing functions in sculpt.

Modified Paths:
--
branches/blender2.5/blender/source/blender/editors/sculpt/sculpt.c

Modified: branches/blender2.5/blender/source/blender/editors/sculpt/sculpt.c
===
--- branches/blender2.5/blender/source/blender/editors/sculpt/sculpt.c  
2009-01-09 00:38:48 UTC (rev 18426)
+++ branches/blender2.5/blender/source/blender/editors/sculpt/sculpt.c  
2009-01-09 05:24:11 UTC (rev 18427)
@@ -319,7 +319,7 @@
 {
float size= b-size;
float pressure= 0; /* XXX: get_pressure(); */
-   short activedevice= get_activedevice();
+   short activedevice= 0; /* XXX: get_activedevice(); */

if(b-sculpt_tool!=SCULPT_TOOL_GRAB) {
const float size_factor= sd-tablet_size / 10.0f;
@@ -340,7 +340,7 @@
 {
float dir= b-flag  BRUSH_DIR_IN ? -1 : 1;
float pressure= 1;
-   short activedevice= get_activedevice();
+   short activedevice= 0;/*XXX: get_activedevice(); */
float flip= a-flip ? -1:1;
float anchored = b-flag  BRUSH_ANCHORED ? 25 : 1;
 
@@ -431,7 +431,7 @@

out[0]=out[1]=out[2] = out_flip[0]=out_flip[1]=out_flip[2] = 0;
 
-   if(sculptmode_brush()-flag  BRUSH_ANCHORED) {
+   if(sd-brush-flag  BRUSH_ANCHORED) {
for(; node; node = node-next)
add_norm_if(((BrushAction*)a)-symm.out, out, out_flip, 
a-orig_norms[node-Index]);
}
@@ -580,7 +580,7 @@
 {
float area_normal[3];
ActiveData *node= active_verts-first;
-   const float bstr= brush_strength(sd, sculptmode_brush(), a);
+   const float bstr= brush_strength(sd, sd-brush, a);
 
calc_area_normal(sd, area_normal, a, NULL, active_verts);
 
@@ -921,7 +921,7 @@
ActiveData *adata= 0;
float *vert;
Mesh *me= NULL; /*XXX: get_mesh(OBACT); */
-   const float bstrength= brush_strength(sd, sculptmode_brush(), a);
+   const float bstrength= brush_strength(sd, sd-brush, a);
KeyBlock *keyblock= NULL; /*XXX: ob_get_keyblock(OBACT); */
SculptSession *ss = sd-session;
Brush *b = sd-brush;
@@ -1169,7 +1169,7 @@
ModifierData *md;
int i;
const char flip = 0; /*XXX: (get_qual() == LR_SHIFTKEY); */
-   const char anchored = sculptmode_brush()-flag  BRUSH_ANCHORED;
+   const int anchored = sd-brush-flag  BRUSH_ANCHORED;
short orig_mouse[2], dx=0, dy=0;
float size = brush_size(sd, b);
 
@@ -1629,7 +1629,7 @@
ss= sd-session;
}
 
-   anchored = sculptmode_brush()-flag  BRUSH_ANCHORED;
+   anchored = sd-brush-flag  BRUSH_ANCHORED;
smooth_stroke = (sd-flags  SCULPT_INPUT_SMOOTH)  
(sd-brush-sculpt_tool != SCULPT_TOOL_GRAB)  !anchored;
 
if(smooth_stroke)
@@ -1710,7 +1710,7 @@
}

if(firsttime || mouse[0]!=mvalo[0] || mouse[1]!=mvalo[1] ||
-  sculptmode_brush()-flag  BRUSH_AIRBRUSH) {
+  sd-brush-flag  BRUSH_AIRBRUSH) {
a-firsttime = firsttime;
firsttime= 0;
 
@@ -1778,7 +1778,7 @@

/* Draw cursor */
if(sd-flags  SCULPT_TOOL_DRAW)
-   
fdrawXORcirc((float)mouse[0],(float)mouse[1],sculptmode_brush()-size);
+   
fdrawXORcirc((float)mouse[0],(float)mouse[1],sd-brush-size);
/* XXX: if(smooth_stroke)
   sculpt_stroke_draw(); */

@@ -1836,9 +1836,6 @@
 {
G.f |= G_SCULPTMODE;
 
-   /* Called here to sanity-check the brush */
-   sculptmode_brush();
-
sculpt_init_session(NULL /*XXX*/);

glEnableClientState(GL_VERTEX_ARRAY);


___
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 [18429] branches/blender2.5/blender/source /blender/editors/space_ipo/ipo_draw.c: 2.5 - IPO Editor

2009-01-08 Thread Joshua Leung
Revision: 18429
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=18429
Author:   aligorith
Date: 2009-01-09 07:25:14 +0100 (Fri, 09 Jan 2009)

Log Message:
---
2.5 - IPO Editor

Porting relevant drawing code over from AnimSys2. It is currently not hooked up 
to anything else yet, so don't expect any curves to draw for a while. I'll need 
this for validating that my recorded animation system will work. ;)

Added Paths:
---
branches/blender2.5/blender/source/blender/editors/space_ipo/ipo_draw.c

Added: branches/blender2.5/blender/source/blender/editors/space_ipo/ipo_draw.c
===
--- branches/blender2.5/blender/source/blender/editors/space_ipo/ipo_draw.c 
(rev 0)
+++ branches/blender2.5/blender/source/blender/editors/space_ipo/ipo_draw.c 
2009-01-09 06:25:14 UTC (rev 18429)
@@ -0,0 +1,713 @@
+/**
+ * $Id: drawipo.c 17512 2008-11-20 05:55:42Z aligorith $
+ *
+ * * 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) Blender Foundation
+ *
+ * Contributor(s): Joshua Leung (2009 Recode)
+ *
+ * * END GPL LICENSE BLOCK *
+ */
+
+#include stdio.h
+#include math.h
+#include string.h
+
+#ifdef HAVE_CONFIG_H
+#include config.h
+#endif
+
+#ifndef _WIN32
+#include unistd.h
+#else
+#include io.h
+#endif
+
+#include MEM_guardedalloc.h
+
+#include BLI_blenlib.h
+#include BLI_arithb.h
+
+#include DNA_action_types.h
+#include DNA_curve_types.h
+#include DNA_ipo_types.h
+#include DNA_key_types.h
+#include DNA_object_types.h
+#include DNA_scene_types.h
+#include DNA_screen_types.h
+#include DNA_space_types.h
+#include DNA_sequence_types.h
+#include DNA_userdef_types.h
+#include DNA_view2d_types.h
+#include DNA_windowmanager_types.h
+
+#include BKE_curve.h
+#include BKE_depsgraph.h
+#include BKE_ipo.h
+#include BKE_key.h
+#include BKE_object.h
+#include BKE_utildefines.h
+
+#include BIF_gl.h
+#include BIF_glutil.h
+
+#include ED_anim_api.h
+#include ED_util.h
+
+#include UI_resources.h
+#include UI_view2d.h
+
+/*  */
+// XXX stubs to remove!
+
+// NOTE: the code in this file has yet to be rewritten to get rid of the 
editipo system which is past its use-by-date - Aligorith
+
+typedef struct EditIpo {
+   IpoCurve *icu;
+   short disptype;
+   short flag;
+   unsigned int col;
+} EditIpo;
+
+#define ISPOIN(a, b, c)   ( (a-b)  (a-c) )  
+#define ISPOIN3(a, b, c, d)   ( (a-b)  (a-c)  (a-d) )
+#define ISPOIN4(a, b, c, d, e)( (a-b)  (a-c)  (a-d)  (a-e) )
+
+/* *** */
+
+/* helper func - draw keyframe vertices only for an IPO-curve */
+static void draw_ipovertices_keyframes(IpoCurve *icu, View2D *v2d, short 
disptype, short edit, short sel)
+{
+   BezTriple *bezt= icu-bezt;
+   float v1[2];
+   int a, b;
+   
+   bglBegin(GL_POINTS);
+   
+   for (a = 0; a  icu-totvert; a++, bezt++) {
+   /* IPO_DISPBITS is used for displaying curves for bitflag 
variables */
+   if (disptype == IPO_DISPBITS) {
+   /*if (v2d-cur.xmin  bezt-vec[1][0]  v2d-cur.xmax) 
{*/
+   short ok= 0;
+   
+   if (edit) {
+   if ((bezt-f2  SELECT) == sel) 
+   ok= 1;
+   }
+   else ok= 1;
+   
+   if (ok) {
+   int val= (int)bezt-vec[1][1];
+   v1[0]= bezt-vec[1][0];
+   
+   for (b= 0; b  31; b++) {
+   if (val  (1b)) { 
+   v1[1]= b + 1;
+   bglVertex3fv(v1);
+   }
+   }
+   }
+   /*}*/
+   } 
+   else { /* normal (non bit) curves */
+   if (edit) {
+   /* Only the