[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18287] branches/blender2.5/blender/source /blender/makesrna: Started RNA for MTex

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

Log Message:
---
Started RNA for MTex

Modified Paths:
--
branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
branches/blender2.5/blender/source/blender/makesrna/intern/rna_texture.c

Modified: branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
===
--- branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
2009-01-03 07:38:40 UTC (rev 18286)
+++ branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
2009-01-03 08:08:44 UTC (rev 18287)
@@ -113,6 +113,7 @@
 extern StructRNA RNA_LatticeModifier;
 extern StructRNA RNA_LatticePoint;
 extern StructRNA RNA_Library;
+extern StructRNA RNA_MappingTexture;
 extern StructRNA RNA_MCol;
 extern StructRNA RNA_MColLayer;
 extern StructRNA RNA_MFloatProperty;

Modified: 
branches/blender2.5/blender/source/blender/makesrna/intern/rna_texture.c
===
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_texture.c
2009-01-03 07:38:40 UTC (rev 18286)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_texture.c
2009-01-03 08:08:44 UTC (rev 18287)
@@ -30,12 +30,74 @@
 
 #include rna_internal.h
 
+#include DNA_material_types.h
 #include DNA_texture_types.h
 
 #ifdef RNA_RUNTIME
 
 #else
 
+void rna_def_mapping_texture(BlenderRNA *brna)
+{
+   StructRNA *srna;
+   PropertyRNA *prop;
+
+   static EnumPropertyItem prop_texture_coordinates_items[] = {
+   {TEXCO_ORCO, ORIGINAL_COORDINATES, Original Coordinates, 
},
+   {TEXCO_REFL, REFLECTION_VECTOR, Reflection Vector, },
+   {TEXCO_NORM, NORMAL_VECTOR, Normal Vector, },
+   {TEXCO_GLOB, GLOBAL, Global, },
+   {TEXCO_UV, UV, UV, },
+   {TEXCO_OBJECT, LINKED_OBJECT, Linked Object, },
+   {TEXCO_STRAND, STRAND, Strand, },
+   {TEXCO_STRESS, STRESS, Stress, },
+   {TEXCO_SPEED, TANGENT, Tangent, },
+   {0, NULL, NULL, NULL}};
+
+   static EnumPropertyItem prop_blend_type_items[] = {
+   {MTEX_BLEND, MIX, Mix, },
+   {MTEX_ADD, ADD, Add, },
+   {MTEX_SUB, SUBTRACT, Subtract, },
+   {MTEX_MUL, MULTIPLY, Multiply, },
+   {MTEX_SCREEN, SCREEN, Screen, },
+   {MTEX_OVERLAY, OVERLAY, Overlay, },
+   {MTEX_DIFF, DIFFERENCE, Difference, },
+   {MTEX_DIV, DIVIDE, Divide, },
+   {MTEX_DARK, DARKEN, Darken, },
+   {MTEX_LIGHT, LIGHTEN, Lighten, },
+   {MTEX_BLEND_HUE, HUE, Hue, },
+   {MTEX_BLEND_SAT, SATURATION, Saturation, },
+   {MTEX_BLEND_VAL, VALUE, Value, },
+   {MTEX_BLEND_COLOR, COLOR, Color, },
+   {0, NULL, NULL, NULL}};
+
+   srna= RNA_def_struct(brna, MappingTexture, NULL);
+   RNA_def_struct_sdna(srna, MTex);
+   RNA_def_struct_ui_text(srna, MappingTexture, DOC_BROKEN);
+
+   prop= RNA_def_property(srna, texture_coordinates, PROP_ENUM, 
PROP_NONE);
+   RNA_def_property_enum_sdna(prop, NULL, texco);
+   RNA_def_property_enum_items(prop, prop_texture_coordinates_items);
+   RNA_def_property_ui_text(prop, Texture Coordinates, );
+
+   /* XXX: MTex.mapto and MTex.maptoneg */
+
+   prop= RNA_def_property(srna, blend_type, PROP_ENUM, PROP_NONE);
+   RNA_def_property_enum_sdna(prop, NULL, blendtype);
+   RNA_def_property_enum_items(prop, prop_blend_type_items);
+   RNA_def_property_ui_text(prop, Blend Type, );
+
+   prop= RNA_def_property(srna, mapping_object, PROP_POINTER, PROP_NONE);
+   RNA_def_property_pointer_sdna(prop, NULL, object);
+   RNA_def_property_struct_type(prop, Object);
+   RNA_def_property_ui_text(prop, Mapping Object, );
+
+   prop= RNA_def_property(srna, texture, PROP_POINTER, PROP_NONE);
+   RNA_def_property_pointer_sdna(prop, NULL, tex);
+   RNA_def_property_struct_type(prop, Texture);
+   RNA_def_property_ui_text(prop, Texture, );
+}
+
 void rna_def_environment_map(BlenderRNA *brna)
 {
StructRNA *srna;
@@ -153,6 +215,7 @@
{TEX_CELLNOISE, CELL_NOISE, Cell Noise, },
{0, NULL, NULL, NULL}};
 
+   rna_def_mapping_texture(brna);
rna_def_environment_map(brna);
 
srna= RNA_def_struct(brna, Texture, ID);


___
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 [18288] branches/blender2.5/blender/source /blender/editors: 2.5 - Silenced various compiler warnings

2009-01-03 Thread Joshua Leung
Revision: 18288
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=18288
Author:   aligorith
Date: 2009-01-03 11:03:26 +0100 (Sat, 03 Jan 2009)

Log Message:
---
2.5 - Silenced various compiler warnings

Modified Paths:
--
branches/blender2.5/blender/source/blender/editors/animation/anim_draw.c
branches/blender2.5/blender/source/blender/editors/animation/anim_filter.c

branches/blender2.5/blender/source/blender/editors/animation/keyframes_edit.c
branches/blender2.5/blender/source/blender/editors/transform/transform.c

Modified: 
branches/blender2.5/blender/source/blender/editors/animation/anim_draw.c
===
--- branches/blender2.5/blender/source/blender/editors/animation/anim_draw.c
2009-01-03 08:08:44 UTC (rev 18287)
+++ branches/blender2.5/blender/source/blender/editors/animation/anim_draw.c
2009-01-03 10:03:26 UTC (rev 18288)
@@ -271,6 +271,8 @@
bezt-vec[2][0]= get_action_frame(ob, bezt-vec[2][0]);
}   
bezt-vec[1][0]= get_action_frame(ob, bezt-vec[1][0]);
+   
+   return 0;
 }
 
 /* helper function for ANIM_nla_mapping_apply_ipocurve() - apply, i.e. 
mapping points to NLA-mapped global time */
@@ -286,6 +288,8 @@
bezt-vec[2][0]= get_action_frame_inv(ob, bezt-vec[2][0]);
}
bezt-vec[1][0]= get_action_frame_inv(ob, bezt-vec[1][0]);
+   
+   return 0;
 }
 
 

Modified: 
branches/blender2.5/blender/source/blender/editors/animation/anim_filter.c
===
--- branches/blender2.5/blender/source/blender/editors/animation/anim_filter.c  
2009-01-03 08:08:44 UTC (rev 18287)
+++ branches/blender2.5/blender/source/blender/editors/animation/anim_filter.c  
2009-01-03 10:03:26 UTC (rev 18288)
@@ -546,7 +546,6 @@
 {
bAnimListElem *ale = NULL;
bConstraintChannel *conchan;
-   IpoCurve *icu;
short owned= (owner  ownertype)? 1 : 0;
int items = 0;

@@ -857,7 +856,6 @@
 {
bAnimListElem *ale=NULL;
Object *ob= base-object;
-   IpoCurve *icu;
int items = 0;

/* include materials-expand widget? */

Modified: 
branches/blender2.5/blender/source/blender/editors/animation/keyframes_edit.c
===
--- 
branches/blender2.5/blender/source/blender/editors/animation/keyframes_edit.c   
2009-01-03 08:08:44 UTC (rev 18287)
+++ 
branches/blender2.5/blender/source/blender/editors/animation/keyframes_edit.c   
2009-01-03 10:03:26 UTC (rev 18288)
@@ -35,6 +35,7 @@
 #include BLI_arithb.h
 
 #include DNA_action_types.h
+#include DNA_constraint_types.h
 #include DNA_curve_types.h
 #include DNA_ipo_types.h
 #include DNA_key_types.h
@@ -116,7 +117,7 @@
 return 0;
 }
 
-/* This function is used to loop over the IPO curves (and subsequently the 
keyframes in them) */
+/* This function is used to loop over the IPO curves in the given IPO (and 
subsequently the keyframes in them) */
 short ANIM_ipo_keys_bezier_loop(BeztEditData *bed, Ipo *ipo, BeztEditFunc 
bezt_ok, BeztEditFunc bezt_cb, IcuEditFunc icu_cb)
 {
 IpoCurve *icu;
@@ -136,6 +137,48 @@
 
 /*  Further Abstracted 
- */
 
+/* This function is used to loop over the keyframe data in an Action Group */
+static short agrp_keys_bezier_loop(BeztEditData *bed, bActionGroup *agrp, 
BeztEditFunc bezt_ok, BeztEditFunc bezt_cb, IcuEditFunc icu_cb)
+{
+   bActionChannel *achan;
+   bConstraintChannel *conchan;
+   
+   /* only iterate over the action-channels and their sub-channels that 
are in this group */
+   for (achan= agrp-channels.first; achan  achan-grp==agrp; achan= 
achan-next) {
+   if (ANIM_ipo_keys_bezier_loop(bed, achan-ipo, bezt_ok, 
bezt_cb, icu_cb))
+   return 1;
+   
+   for (conchan=achan-constraintChannels.first; conchan; 
conchan=conchan-next) {
+   if (ANIM_ipo_keys_bezier_loop(bed, conchan-ipo, 
bezt_ok, bezt_cb, icu_cb))
+   return 1;
+   }
+   }
+   
+   return 0;
+}
+
+/* This function is used to loop over the keyframe data in an Action Group */
+static short act_keys_bezier_loop(BeztEditData *bed, bAction *act, 
BeztEditFunc bezt_ok, BeztEditFunc bezt_cb, IcuEditFunc icu_cb)
+{
+   bActionChannel *achan;
+   bConstraintChannel *conchan;
+   
+   for (achan= act-chanbase.first; achan; achan= achan-next) {
+   if (ANIM_ipo_keys_bezier_loop(bed, achan-ipo, bezt_ok, 
bezt_cb, icu_cb))
+   return 1;
+   
+   for (conchan=achan-constraintChannels.first; conchan; 
conchan=conchan-next) {
+   if 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18290] branches/blender2.5/blender/source /blender/makesrna/RNA_access.h: missed this one last time

2009-01-03 Thread Matt Ebb
Revision: 18290
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=18290
Author:   broken
Date: 2009-01-03 13:39:36 +0100 (Sat, 03 Jan 2009)

Log Message:
---
missed this one last time

Modified Paths:
--
branches/blender2.5/blender/source/blender/makesrna/RNA_access.h

Modified: branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
===
--- branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
2009-01-03 11:35:39 UTC (rev 18289)
+++ branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
2009-01-03 12:39:36 UTC (rev 18290)
@@ -205,6 +205,7 @@
 extern StructRNA RNA_StringProperty;
 extern StructRNA RNA_Struct;
 extern StructRNA RNA_SubsurfModifier;
+extern StructRNA RNA_SunskySettings;
 extern StructRNA RNA_Text;
 extern StructRNA RNA_TextBox;
 extern StructRNA RNA_TextLine;


___
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 [18291] trunk/blender/release/scripts/ export_fbx.py: [#18142] Blender FBX export outputs broken vertex colors when using vertex paint

2009-01-03 Thread Campbell Barton
Revision: 18291
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=18291
Author:   campbellbarton
Date: 2009-01-03 15:02:14 +0100 (Sat, 03 Jan 2009)

Log Message:
---
[#18142] Blender FBX export outputs broken vertex colors when using vertex paint
from Kevin Hsu (caywen) 
use fix suggested in report

Modified Paths:
--
trunk/blender/release/scripts/export_fbx.py

Modified: trunk/blender/release/scripts/export_fbx.py
===
--- trunk/blender/release/scripts/export_fbx.py 2009-01-03 12:39:36 UTC (rev 
18290)
+++ trunk/blender/release/scripts/export_fbx.py 2009-01-03 14:02:14 UTC (rev 
18291)
@@ -1446,13 +1446,13 @@
for f in me.faces:
for col in f.col:
if i==-1:
-   file.write('%i,%i,%i' % 
(col[0], col[1], col[2]))
+   
file.write('%i,%i,%i,255' % (col[0], col[1], col[2]))
i=0
else:
if i==7:

file.write('\n\t\t\t\t')
i=0
-   file.write(',%i,%i,%i' 
% (col[0], col[1], col[2]))
+   
file.write(',%i,%i,%i,255' % (col[0], col[1], col[2]))
i+=1
ii+=1 # One more Color



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

2009-01-03 Thread Martin Poirier
Revision: 18292
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=18292
Author:   theeth
Date: 2009-01-03 18:21:32 +0100 (Sat, 03 Jan 2009)

Log Message:
---
2.5

Snapping for editmesh remove a silly bug and make it work with PET. In that 
case, you can only snap to other object, not to the edit mesh.

Modified Paths:
--
branches/blender2.5/blender/source/blender/editors/transform/transform.h

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

Modified: 
branches/blender2.5/blender/source/blender/editors/transform/transform.h
===
--- branches/blender2.5/blender/source/blender/editors/transform/transform.h
2009-01-03 14:02:14 UTC (rev 18291)
+++ branches/blender2.5/blender/source/blender/editors/transform/transform.h
2009-01-03 17:21:32 UTC (rev 18292)
@@ -77,6 +77,7 @@
 typedef struct TransSnap {
short   modePoint;
short   modeTarget;
+   int mode;
int status;
float   snapPoint[3];
float   snapTarget[3];

Modified: 
branches/blender2.5/blender/source/blender/editors/transform/transform_snap.c
===
--- 
branches/blender2.5/blender/source/blender/editors/transform/transform_snap.c   
2009-01-03 14:02:14 UTC (rev 18291)
+++ 
branches/blender2.5/blender/source/blender/editors/transform/transform_snap.c   
2009-01-03 17:21:32 UTC (rev 18292)
@@ -100,8 +100,9 @@
 float ResizeBetween(TransInfo *t, float p1[3], float p2[3]);
 
 /* Modes */
-#define NOT_SELECTED 0
-#define NOT_ACTIVE 1
+#define SNAP_ALL   0
+#define SNAP_NOT_SELECTED  1
+#define SNAP_NOT_OBEDIT2
 int snapObjects(TransInfo *t, int *dist, float *loc, float *no, int mode);
 
 
@@ -283,7 +284,7 @@
 void initSnapping(TransInfo *t)
 {
Scene *scene = t-scene;
-   Object *obedit = NULL;
+   Object *obedit = t-obedit;
resetSnapping(t);

if ((t-spacetype == SPACE_VIEW3D || t-spacetype == SPACE_IMAGE)  // 
Only 3D view or UV
@@ -293,11 +294,19 @@
/* Edit mode */
if (t-tsnap.applySnap != NULL  // A snapping function 
actually exist
(scene-snap_flag  SCE_SNAP)  // Only if the snap 
flag is on
-   (obedit != NULL  obedit-type==OB_MESH)  // 
Temporary limited to edit mode meshes
-   ((t-flag  T_PROP_EDIT) == 0) ) // No PET, obviously
+   (obedit != NULL  obedit-type==OB_MESH) ) // 
Temporary limited to edit mode meshes
{
t-tsnap.status |= SNAP_ON;
t-tsnap.modePoint = SNAP_GEO;
+   
+   if (t-flag  T_PROP_EDIT)
+   {
+   t-tsnap.mode = SNAP_NOT_OBEDIT;
+   }
+   else
+   {
+   t-tsnap.mode = SNAP_ALL;
+   }
}
/* Object mode */
else if (t-tsnap.applySnap != NULL  // A snapping function 
actually exist
@@ -306,6 +315,7 @@
{
t-tsnap.status |= SNAP_ON;
t-tsnap.modePoint = SNAP_GEO;
+   t-tsnap.mode = SNAP_NOT_SELECTED;
}
else
{   
@@ -508,7 +518,7 @@
int found = 0;
int dist = 40; // Use a user defined value here

-   found = snapObjects(t, dist, vec, no, NOT_SELECTED);
+   found = snapObjects(t, dist, vec, no, t-mode);
if (found == 1)
{
float tangent[3];
@@ -542,7 +552,7 @@
int found = 0;
int dist = 40; // Use a user defined value here
 
-   found = snapObjects(t, dist, vec, no, NOT_ACTIVE);
+   found = snapObjects(t, dist, vec, no, t-mode);
if (found == 1)
{
VECCOPY(t-tsnap.snapPoint, vec);
@@ -658,7 +668,7 @@
VecAddf(t-tsnap.snapTarget, t-tsnap.snapTarget, 
td-center);
}

-   VecMulf(t-tsnap.snapTarget, 1.0 / t-total);
+   VecMulf(t-tsnap.snapTarget, 1.0 / i);

if(t-flag  (T_EDIT|T_POSE)) {
Object *ob= t-obedit?t-obedit:t-poseobj;
@@ -1178,7 +1188,7 @@

viewray(t-ar, v3d, t-mval, ray_start, ray_normal);
 
-   if (mode == NOT_ACTIVE)
+   if (mode == SNAP_ALL  t-obedit)
{
DerivedMesh *dm;
 

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

2009-01-03 Thread Nathan Letwory
Revision: 18293
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=18293
Author:   jesterking
Date: 2009-01-03 19:43:11 +0100 (Sat, 03 Jan 2009)

Log Message:
---
2.5
- Make sure shader, composit and texture ntrees have an id.name. This is to 
ensure
  that node trees in Material, Scene and Texture are properly identified 
through RNA

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

Modified: 
branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c
===
--- branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c 
2009-01-03 17:21:32 UTC (rev 18292)
+++ branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c 
2009-01-03 18:43:11 UTC (rev 18293)
@@ -8436,9 +8436,30 @@
 
if (main-versionfile  250) {
bScreen *screen;
+   Material *ma;
+   Scene *sce;
+   Tex *tx;

for(screen= main-screen.first; screen; screen= screen-id.next)
do_versions_windowmanager_2_50(screen);
+   
+   /* shader, composit and texture node trees have id.name empty, 
put something in
+* to have them show in RNA viewer and accessible otherwise.
+*/
+   for(ma= main-mat.first; ma; ma= ma-id.next) {
+   if(ma-nodetree  strlen(ma-nodetree-id.name)==0)
+   strcpy(ma-nodetree-id.name, NTShader 
Nodetree);
+   }
+   /* and composit trees */
+   for(sce= main-scene.first; sce; sce= sce-id.next) {
+   if(sce-nodetree  strlen(sce-nodetree-id.name)==0)
+   strcpy(sce-nodetree-id.name, NTComposit 
Nodetree);
+   }
+   /* and texture trees */
+   for(tx= main-tex.first; tx; tx= tx-id.next) {
+   if(tx-nodetree  strlen(tx-nodetree-id.name)==0)
+   strcpy(tx-nodetree-id.name, NTTexture 
Nodetree);
+   }
}




___
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 [18294] branches/blender2.5/blender/source /blender/makesrna/intern: Added RNA for MTex, also property for mtex array in Material RNA.

2009-01-03 Thread Nicholas Bishop
Revision: 18294
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=18294
Author:   nicholasbishop
Date: 2009-01-03 20:39:39 +0100 (Sat, 03 Jan 2009)

Log Message:
---
Added RNA for MTex, also property for mtex array in Material RNA.

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

Modified: 
branches/blender2.5/blender/source/blender/makesrna/intern/rna_material.c
===
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_material.c   
2009-01-03 18:43:11 UTC (rev 18293)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_material.c   
2009-01-03 19:39:39 UTC (rev 18294)
@@ -30,6 +30,7 @@
 #include rna_internal.h
 
 #include DNA_material_types.h
+#include DNA_texture_types.h
 
 #include WM_types.h
 
@@ -45,6 +46,12 @@
mat-mode = ~(MA_HALO|MA_STAR|MA_HALO_XALPHA|MA_ZINV|MA_ENV);
 }
 
+static void rna_Material_mtex_begin(CollectionPropertyIterator *iter, 
PointerRNA *ptr)
+{
+   Material *mat= (Material*)ptr-data;
+   rna_iterator_array_begin(iter, (void*)mat-mtex, sizeof(MTex*), 
MAX_MTEX, NULL);
+}
+
 #else
 
 static void rna_def_material_colors(StructRNA *srna, PropertyRNA *prop)
@@ -402,16 +409,21 @@
RNA_def_property_boolean_sdna(prop, NULL, mode, MA_HALO_SOFT); /* use 
bitflags */
RNA_def_property_ui_text(prop, Halo Mode Soft, Softens the halo.);
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
-   
 }
 
 void RNA_def_material(BlenderRNA *brna)
 {
StructRNA *srna= NULL;
PropertyRNA *prop= NULL;
-   
+
srna= RNA_def_struct(brna, Material, ID);
RNA_def_struct_ui_text(srna, Material, DOC_BROKEN);
+
+   /* mtex */
+   prop= RNA_def_property(srna, textures, PROP_COLLECTION, PROP_NONE);
+   RNA_def_property_struct_type(prop, MappingTexture);
+   RNA_def_property_collection_funcs(prop, rna_Material_mtex_begin, 
rna_iterator_array_next, rna_iterator_array_end, 
rna_iterator_array_dereference_get, 0, 0, 0, 0);
+   RNA_def_property_ui_text(prop, Textures, );

/* colors */
rna_def_material_colors(srna, prop);

Modified: 
branches/blender2.5/blender/source/blender/makesrna/intern/rna_texture.c
===
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_texture.c
2009-01-03 18:43:11 UTC (rev 18293)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_texture.c
2009-01-03 19:39:39 UTC (rev 18294)
@@ -71,6 +71,13 @@
{MTEX_BLEND_COLOR, COLOR, Color, },
{0, NULL, NULL, NULL}};
 
+   static EnumPropertyItem prop_mapping_items[] = {
+   {MTEX_FLAT, FLAT, Flat, Maps X and Y coordinates 
directly.},
+   {MTEX_CUBE, CUBE, Cube, Maps using the normal vector.},
+   {MTEX_TUBE, TUBE, Tube, Maps with Z as central axis.},
+   {MTEX_SPHERE, SPHERE, Sphere, Maps with Z as central 
axis.},
+   {0, NULL, NULL, NULL}};
+
srna= RNA_def_struct(brna, MappingTexture, NULL);
RNA_def_struct_sdna(srna, MTex);
RNA_def_struct_ui_text(srna, MappingTexture, DOC_BROKEN);
@@ -96,6 +103,21 @@
RNA_def_property_pointer_sdna(prop, NULL, tex);
RNA_def_property_struct_type(prop, Texture);
RNA_def_property_ui_text(prop, Texture, );
+
+   /* XXX: MTex.uvname, MTex.proj[xyz] */
+
+   prop= RNA_def_property(srna, mapping, PROP_ENUM, PROP_NONE);
+   RNA_def_property_enum_items(prop, prop_mapping_items);
+   RNA_def_property_ui_text(prop, Mapping, );
+
+   prop= RNA_def_property(srna, offset, PROP_FLOAT, PROP_VECTOR);
+   RNA_def_property_float_sdna(prop, NULL, ofs);
+   RNA_def_property_ui_range(prop, -10, 10, 10, 2);
+   RNA_def_property_ui_text(prop, Offset, );
+
+   prop= RNA_def_property(srna, size, PROP_FLOAT, PROP_VECTOR);
+   RNA_def_property_ui_range(prop, -100, 100, 10, 2);
+   RNA_def_property_ui_text(prop, Size, );
 }
 
 void rna_def_environment_map(BlenderRNA *brna)


___
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 [18295] branches/blender2.5/blender/source /blender: 2.5: fix repeat last, and display of operator properties

2009-01-03 Thread Brecht Van Lommel
Revision: 18295
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=18295
Author:   blendix
Date: 2009-01-03 21:03:39 +0100 (Sat, 03 Jan 2009)

Log Message:
---
2.5: fix repeat last, and display of operator properties
in rna outliner.

Modified Paths:
--
branches/blender2.5/blender/source/blender/editors/space_outliner/outliner.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_modifier.c
branches/blender2.5/blender/source/blender/windowmanager/intern/wm.c

branches/blender2.5/blender/source/blender/windowmanager/intern/wm_event_system.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-03 19:39:39 UTC (rev 18294)
+++ 
branches/blender2.5/blender/source/blender/editors/space_outliner/outliner.c
2009-01-03 20:03:39 UTC (rev 18295)
@@ -4184,6 +4184,7 @@
 
if(nameprop) {
text= RNA_property_string_get_alloc(pptr, 
nameprop, textbuf, sizeof(textbuf));
+   descr= 
(char*)RNA_property_ui_description(pptr, prop);
but= uiDefIconTextBut(block, LABEL, 0, icon, 
text, x1, y1, x2, y2, NULL, 0, 0, 0, 0, descr);
if(text != textbuf)
MEM_freeN(text);

Modified: 
branches/blender2.5/blender/source/blender/makesrna/intern/rna_modifier.c
===
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_modifier.c   
2009-01-03 19:39:39 UTC (rev 18294)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_modifier.c   
2009-01-03 20:03:39 UTC (rev 18295)
@@ -875,7 +875,6 @@
srna= RNA_def_struct(brna, CastModifier, Modifier);
RNA_def_struct_ui_text(srna, Cast Modifier, Cast Modifier.);
RNA_def_struct_sdna(srna, CastModifierData);
-   RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, 
rna_Modifier_update);
 
prop= RNA_def_property(srna, cast_type, PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, type);

Modified: branches/blender2.5/blender/source/blender/windowmanager/intern/wm.c
===
--- branches/blender2.5/blender/source/blender/windowmanager/intern/wm.c
2009-01-03 19:39:39 UTC (rev 18294)
+++ branches/blender2.5/blender/source/blender/windowmanager/intern/wm.c
2009-01-03 20:03:39 UTC (rev 18295)
@@ -80,12 +80,6 @@
 {
int tot;
 
-   if(op-ptr) {
-   op-properties= op-ptr-data;
-   MEM_freeN(op-ptr);
-   op-ptr= NULL;
-   }
-
BLI_addtail(wm-operators, op);
tot= BLI_countlist(wm-operators);


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-03 19:39:39 UTC (rev 18294)
+++ 
branches/blender2.5/blender/source/blender/windowmanager/intern/wm_event_system.c
   2009-01-03 20:03:39 UTC (rev 18295)
@@ -367,11 +367,18 @@
op-type= ot;
BLI_strncpy(op-idname, ot-idname, OP_MAX_TYPENAME);

+   /* initialize properties, either copy or create */
op-ptr= MEM_callocN(sizeof(PointerRNA), wmOperatorPtrRNA);
-   if(properties  properties-data)
-   op-ptr-data= IDP_CopyProperty(properties-data);
-   RNA_pointer_create(RNA_WindowManager, wm-id, ot-srna, 
op-ptr-data, op-ptr);
+   if(properties  properties-data) {
+   op-properties= IDP_CopyProperty(properties-data);
+   }
+   else {
+   IDPropertyTemplate val = {0};
+   op-properties= IDP_New(IDP_GROUP, val, 
wmOperatorProperties);
+   }
+   RNA_pointer_create(RNA_WindowManager, wm-id, ot-srna, 
op-properties, op-ptr);
 
+   /* initialize error reports */
if (reports) {
op-reports= reports; /* must be initialized alredy */
}


___
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 [18296] branches/bmesh/bmesh/ bmesh_operators.h: - Remove BMO_Connect Macro

2009-01-03 Thread Geoffrey Bantle
Revision: 18296
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=18296
Author:   briggs
Date: 2009-01-03 21:12:12 +0100 (Sat, 03 Jan 2009)

Log Message:
---
- Remove BMO_Connect Macro


Removed BMO_Connect Macro. This was actually something from
old iteration of the BMOP design that was abandoned.

Modified Paths:
--
branches/bmesh/bmesh/bmesh_operators.h

Modified: branches/bmesh/bmesh/bmesh_operators.h
===
--- branches/bmesh/bmesh/bmesh_operators.h  2009-01-03 20:03:39 UTC (rev 
18295)
+++ branches/bmesh/bmesh/bmesh_operators.h  2009-01-03 20:12:12 UTC (rev 
18296)
@@ -28,10 +28,6 @@
} data;
 }BMOpSlot;
 
-/*not sure if this is correct, which is why it's a macro, nicely
-  visible here in the header.*/
-#define BMO_Connect(s1, s2) (s2-data = s1-data)
-
 /*operators represent logical, executable mesh modules.*/
 #define BMOP_MAX_SLOTS 16  /*way more than 
probably needed*/
 


___
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 [18297] branches/blender2.5/blender/source /blender/makesrna: Added some sub-structs to Material RNA for halo and ray transp/mirror

2009-01-03 Thread Nicholas Bishop
Revision: 18297
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=18297
Author:   nicholasbishop
Date: 2009-01-03 21:20:09 +0100 (Sat, 03 Jan 2009)

Log Message:
---
Added some sub-structs to Material RNA for halo and ray transp/mirror 
settings. Material RNA shows much cleaner in the RNA viewer now.

Modified Paths:
--
branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
branches/blender2.5/blender/source/blender/makesrna/intern/rna_material.c

Modified: branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
===
--- branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
2009-01-03 20:12:12 UTC (rev 18296)
+++ branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
2009-01-03 20:20:09 UTC (rev 18297)
@@ -126,6 +126,9 @@
 extern StructRNA RNA_Main;
 extern StructRNA RNA_MaskModifier;
 extern StructRNA RNA_Material;
+extern StructRNA RNA_MaterialHalo;
+extern StructRNA RNA_MaterialRaytraceMirror;
+extern StructRNA RNA_MaterialRaytraceTransparency;
 extern StructRNA RNA_Mesh;
 extern StructRNA RNA_MeshDeformModifier;
 extern StructRNA RNA_MeshEdge;

Modified: 
branches/blender2.5/blender/source/blender/makesrna/intern/rna_material.c
===
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_material.c   
2009-01-03 20:12:12 UTC (rev 18296)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_material.c   
2009-01-03 20:20:09 UTC (rev 18297)
@@ -36,6 +36,21 @@
 
 #ifdef RNA_RUNTIME
 
+static void *rna_Material_raytrace_mirror_get(PointerRNA *ptr)
+{
+   return ptr-id.data;
+}
+
+static void *rna_Material_raytrace_transparency_get(PointerRNA *ptr)
+{
+   return ptr-id.data;
+}
+
+static void *rna_Material_halo_get(PointerRNA *ptr)
+{
+   return ptr-id.data;
+}
+
 static void rna_Material_mode_halo_set(PointerRNA *ptr, int value)
 {
Material *mat= (Material*)ptr-data;
@@ -139,12 +154,24 @@
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
 }
 
-static void rna_def_material_raymirror(StructRNA *srna, PropertyRNA *prop)
+static void rna_def_material_raymirror(BlenderRNA *brna, StructRNA *parent)
 {
+   StructRNA *srna;
+   PropertyRNA *prop;
+
static EnumPropertyItem prop_fadeto_mir_items[] = {
{MA_RAYMIR_FADETOSKY, RAYMIR_FADETOSKY, Fade to sky color, 
},
{MA_RAYMIR_FADETOMAT, RAYMIR_FADETOMAT, Fade to material 
color, },
{0, NULL, NULL, NULL}};
+
+   srna= RNA_def_struct(brna, MaterialRaytraceMirror, NULL);
+   RNA_def_struct_sdna(srna, Material);
+   RNA_def_struct_ui_text(srna, Raytrace Mirror, );
+
+   prop= RNA_def_property(parent, raytrace_mirror, PROP_POINTER, 
PROP_NONE);
+   RNA_def_property_struct_type(prop, MaterialRaytraceMirror);
+   RNA_def_property_pointer_funcs(prop, 
rna_Material_raytrace_mirror_get, NULL, NULL);
+   RNA_def_property_ui_text(prop, Raytrace Mirror, );

prop= RNA_def_property(srna, mode_ray_mirror, PROP_BOOLEAN, 
PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, mode, MA_RAYMIRROR); /* use 
bitflags */
@@ -211,8 +238,20 @@
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
 }
 
-static void rna_def_material_raytra(StructRNA *srna, PropertyRNA *prop)
+static void rna_def_material_raytra(BlenderRNA *brna, StructRNA *parent)
 {
+   StructRNA *srna;
+   PropertyRNA *prop;
+
+   srna= RNA_def_struct(brna, MaterialRaytraceTransparency, NULL);
+   RNA_def_struct_sdna(srna, Material);
+   RNA_def_struct_ui_text(srna, Raytrace Transparency, );
+
+   prop= RNA_def_property(parent, raytrace_transparency, PROP_POINTER, 
PROP_NONE);
+   RNA_def_property_struct_type(prop, MaterialRaytraceTransparency);
+   RNA_def_property_pointer_funcs(prop, 
rna_Material_raytrace_transparency_get, NULL, NULL);
+   RNA_def_property_ui_text(prop, Raytrace Transparency, );
+
prop= RNA_def_property(srna, mode_ray_transparency, PROP_BOOLEAN, 
PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, mode, MA_RAYTRANSP); /* use 
bitflags */
RNA_def_property_ui_text(prop, Ray Transparency Mode, Enables 
raytracing for transparent refraction rendering.);
@@ -285,8 +324,20 @@
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
 }
 
-static void rna_def_material_halo(StructRNA *srna, PropertyRNA *prop)
+static void rna_def_material_halo(BlenderRNA *brna, StructRNA *parent)
 {
+   StructRNA *srna;
+   PropertyRNA *prop;
+
+   srna= RNA_def_struct(brna, MaterialHalo, NULL);
+   RNA_def_struct_sdna(srna, Material);
+   RNA_def_struct_ui_text(srna, Halo, );
+
+   prop= RNA_def_property(parent, halo, PROP_POINTER, PROP_NONE);
+   RNA_def_property_struct_type(prop, 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18298] branches/bmesh/bmesh: - Cleanup up of API flags

2009-01-03 Thread Geoffrey Bantle
Revision: 18298
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=18298
Author:   briggs
Date: 2009-01-03 21:26:29 +0100 (Sat, 03 Jan 2009)

Log Message:
---
- Cleanup up of API flags

API flags now use dynamically allocated flag layers isntead
of the persistent flag reserverd for 'marking' elements
(hide, select, sharp, ect).

Modified Paths:
--
branches/bmesh/bmesh/bmesh.h
branches/bmesh/bmesh/intern/bmesh_construct.c
branches/bmesh/bmesh/intern/bmesh_mesh.c
branches/bmesh/bmesh/intern/bmesh_queries.c

Modified: branches/bmesh/bmesh/bmesh.h
===
--- branches/bmesh/bmesh/bmesh.h2009-01-03 20:20:09 UTC (rev 18297)
+++ branches/bmesh/bmesh/bmesh.h2009-01-03 20:26:29 UTC (rev 18298)
@@ -47,86 +47,68 @@
 struct BMEdge;
 struct BMFace;
 struct BMLoop;
+
 /*
-   all mesh elements should share this beginning layout
-   we can pack this a little tighter now... 
-   
-   BMHeader *next, *prev;
-   int EID;
-   int eflag1, eflag2;
-   short systemflag, type;
-   struct BMFlagLayer *flags;
+ * BMHeader
+ *
+ * All mesh elements begin with a BMHeader. This structure 
+ * hold several types of data
+ *
+ * 1: The type of the element (vert, edge, loop or face)
+ * 2: Persistant flags/markings (sharp, seam, select, hidden, ect)
+ * 3: Unique ID in the bmesh.
+ * 4: some elements for internal record keeping.
+ *
 */
 
-/* Defines for BMHeader-type*/
+/*BMHeader-type*/
 #define BM_VERT1
 #define BM_EDGE2
 #define BM_FACE4
 #define BM_LOOP8
 #define BM_ALL BM_VERT | BM_EDGE | BM_FACE | 
BM_LOOP
 
-/*Masks for BMHeader-flag
-   Note: Its entirely possible that any temporal flags should be moved
-   into the dynamically allocated flag layers and only reserve 
BMHeader-flag
-   for things like select, hide, ect.
+/*BMHeader-flag*/
+#define BM_SELECT  (10)
+#define BM_SEAM(11)
+#define BM_FGON(12)
+#define BM_HIDDEN  (13)
+#define BM_SHARP   (14)
+#define BM_SMOOTH  (15)
 
-   The first 16 bits are reserved for the original element flags.
-   The next 5 (till BM_SMOOTH) are bmesh-added ones that replace
-   single variable flags.  The rest after that are temporary flags.
-*/ 
-
-#define BM_SELECT  1 //redefinition of SELECT
-
-/*auxillery bmesh flags.  note, these should
-  become internal to the api eventually.
-  
-  start at the 17th flag.
- */
-#define BM_SEAM(116)
-#define BM_FGON(117)
-#define BM_HIDDEN  (118)
-#define BM_SHARP   (119)
-#define BM_SMOOTH  (120) /* for faces */
-
-#define BM_DIRTY   (121) /*Not used yet*/
-#define BM_NEW (122) 
-#define BM_OVERLAP (123) /*used by 
bmesh_verts_in_face*/
-#define BM_EDGEVERT(124) /*used by 
bmesh_make_ngon*/
-#define BM_DELETE  (125)
-#define BM_AUX1(126) 
/*different for edges/verts/faces/ect*/
-#define BM_AUX2(127) 
/*different for edges/verts/faces/ect*/
-#define BM_AUX3(128) 
/*different for edges/verts/faces/ect*/
-#define BM_TEMP_FLAGS  BM_DIRTY|BM_NEW|BM_OVERLAP|BM_EDGEVERT|BM_DELETE
-
-/*All Mesh elements start with this structure*/
 typedef struct BMHeader
 {
struct BMHeader *next, *prev;
-   int EID;
-   int flag;   
/*mesh flags, never to be (ab)used by the api itself!*/
+   int EID;
/*Consider removing this/making it ifdeffed for debugging*/
+   short   flag, type; 

int eflag1, eflag2; 
/*Flags used by eulers. Try and get rid of/minimize some of these*/
-   short   type, pad1, pad2, pad3; /*Type 
of element this is head to*/
-   struct BMFlagLayer *flags;  
/*Dynamically allocated block of flag layers for operators to use*/
+   struct BMFlagLayer *flags;  
/*Dynamically allocated block of flag layers for operators to use*/
 } BMHeader;
 
+typedef struct BMFlagLayer{
+   int f1;
+   short mask, pflag;
+}BMFlagLayer;
 
-/*Used for circular linked list functions*/
+#define BM_OVERLAP (10)  /*used by 
bmesh_verts_in_face*/

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18299] branches/blender2.5/blender/source /blender/makesrna/intern/rna_texture.c: Added more RNA MTex properties

2009-01-03 Thread Nicholas Bishop
Revision: 18299
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=18299
Author:   nicholasbishop
Date: 2009-01-03 22:10:48 +0100 (Sat, 03 Jan 2009)

Log Message:
---
Added more RNA MTex properties

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

Modified: 
branches/blender2.5/blender/source/blender/makesrna/intern/rna_texture.c
===
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_texture.c
2009-01-03 20:26:29 UTC (rev 18298)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_texture.c
2009-01-03 21:10:48 UTC (rev 18299)
@@ -78,6 +78,13 @@
{MTEX_SPHERE, SPHERE, Sphere, Maps with Z as central 
axis.},
{0, NULL, NULL, NULL}};
 
+   static EnumPropertyItem prop_normal_map_space_items[] = {
+   {MTEX_NSPACE_CAMERA, CAMERA, Camera, },
+   {MTEX_NSPACE_WORLD, WORLD, World, },
+   {MTEX_NSPACE_OBJECT, OBJECT, Object, },
+   {MTEX_NSPACE_TANGENT, TANGENT, Tangent, },
+   {0, NULL, NULL, NULL}};
+
srna= RNA_def_struct(brna, MappingTexture, NULL);
RNA_def_struct_sdna(srna, MTex);
RNA_def_struct_ui_text(srna, MappingTexture, DOC_BROKEN);
@@ -118,6 +125,55 @@
prop= RNA_def_property(srna, size, PROP_FLOAT, PROP_VECTOR);
RNA_def_property_ui_range(prop, -100, 100, 10, 2);
RNA_def_property_ui_text(prop, Size, );
+
+   /* XXX: MTex.colormodel, pmapto, pmaptoneg */
+
+   prop= RNA_def_property(srna, normal_map_space, PROP_ENUM, PROP_NONE);
+   RNA_def_property_enum_sdna(prop, NULL, normapspace);
+   RNA_def_property_enum_items(prop, prop_normal_map_space_items);
+   RNA_def_property_ui_text(prop, Normal Map Space, );
+
+   /* XXX: MTex.which_output */
+
+   prop= RNA_def_property(srna, color, PROP_FLOAT, PROP_COLOR);
+   RNA_def_property_float_sdna(prop, NULL, r);
+   RNA_def_property_array(prop, 3);
+   RNA_def_property_ui_text(prop, Color, );
+
+   /* XXX: MTex.k */
+
+   prop= RNA_def_property(srna, default_value, PROP_FLOAT, PROP_VECTOR);
+   RNA_def_property_float_sdna(prop, NULL, def_var);
+   RNA_def_property_range(prop, 0, 1);
+   RNA_def_property_ui_text(prop, Default Value, Value to use for Ref, 
Spec, Amb, Emit, Alpha, RayMir, TransLu and Hard.);
+
+   /* XXX: MTex.rt */
+
+   prop= RNA_def_property(srna, color_factor, PROP_FLOAT, PROP_VECTOR);
+   RNA_def_property_float_sdna(prop, NULL, colfac);
+   RNA_def_property_range(prop, 0, 1);
+   RNA_def_property_ui_text(prop, Color Factor, Amount texture affects 
color values.);
+
+   prop= RNA_def_property(srna, normal_factor, PROP_FLOAT, PROP_VECTOR);
+   RNA_def_property_float_sdna(prop, NULL, norfac);
+   RNA_def_property_range(prop, 0, 25);
+   RNA_def_property_ui_text(prop, Normal actor, Amount texture affects 
normal values.);
+
+   /* XXX: could use a better name/description? */
+   prop= RNA_def_property(srna, general_factor, PROP_FLOAT, PROP_VECTOR);
+   RNA_def_property_float_sdna(prop, NULL, varfac);
+   RNA_def_property_range(prop, 0, 1);
+   RNA_def_property_ui_text(prop, General Factor, Amount texture 
affects other values.);
+
+   prop= RNA_def_property(srna, displacement_factor, PROP_FLOAT, 
PROP_VECTOR);
+   RNA_def_property_float_sdna(prop, NULL, dispfac);
+   RNA_def_property_range(prop, 0, 1);
+   RNA_def_property_ui_text(prop, Displacement Factor, Amount texture 
displaces the surface.);
+
+   prop= RNA_def_property(srna, warp_factor, PROP_FLOAT, PROP_VECTOR);
+   RNA_def_property_float_sdna(prop, NULL, warpfac);
+   RNA_def_property_range(prop, 0, 1);
+   RNA_def_property_ui_text(prop, Warp Factor, Amount texture affects 
color values.);
 }
 
 void rna_def_environment_map(BlenderRNA *brna)


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

2009-01-03 Thread Martin Poirier
Revision: 18300
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=18300
Author:   theeth
Date: 2009-01-03 23:15:59 +0100 (Sat, 03 Jan 2009)

Log Message:
---
2.5

Transform operator replay

Basic support working. Only saves mode and values, not constraint setup.

Removed event pointer from TransInfo (it's not available in operator exec). 
Replaced checks to event-modifiers to a functional modifier bitfield in 
TransInfo (that is, instead of checking for Shift, it checks for MOD_PRECISION) 
to make it remappable later.

Misc:
X-Mirror for mesh now working with transform

Modified Paths:
--
branches/blender2.5/blender/source/blender/editors/include/ED_mesh.h
branches/blender2.5/blender/source/blender/editors/mesh/mesh_intern.h
branches/blender2.5/blender/source/blender/editors/transform/transform.c
branches/blender2.5/blender/source/blender/editors/transform/transform.h

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

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

branches/blender2.5/blender/source/blender/editors/transform/transform_input.c
branches/blender2.5/blender/source/blender/editors/transform/transform_ops.c

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

Modified: branches/blender2.5/blender/source/blender/editors/include/ED_mesh.h
===
--- branches/blender2.5/blender/source/blender/editors/include/ED_mesh.h
2009-01-03 21:10:48 UTC (rev 18299)
+++ branches/blender2.5/blender/source/blender/editors/include/ED_mesh.h
2009-01-03 22:15:59 UTC (rev 18300)
@@ -89,6 +89,7 @@
 void   remake_editMesh(Scene *scene, Object *ob);
 void   free_editMesh(struct EditMesh *em);
 
+void   recalc_editnormals(struct EditMesh *em);
 
 void   EM_init_index_arrays(struct EditMesh *em, int forVert, int 
forEdge, int forFace);
 void   EM_free_index_arrays(void);

Modified: branches/blender2.5/blender/source/blender/editors/mesh/mesh_intern.h
===
--- branches/blender2.5/blender/source/blender/editors/mesh/mesh_intern.h   
2009-01-03 21:10:48 UTC (rev 18299)
+++ branches/blender2.5/blender/source/blender/editors/mesh/mesh_intern.h   
2009-01-03 22:15:59 UTC (rev 18300)
@@ -127,8 +127,6 @@
 extern void flipface(EditMesh *em, EditFace *efa); // flips for normal 
direction
 extern int compareface(EditFace *vl1, EditFace *vl2);
 
-void recalc_editnormals(EditMesh *em);
-
 /* flag for selection bits, *nor will be filled with normal for extrusion 
constraint */
 /* return value defines if such normal was set */
 extern short extrudeflag_face_indiv(EditMesh *em, short flag, float *nor);

Modified: 
branches/blender2.5/blender/source/blender/editors/transform/transform.c
===
--- branches/blender2.5/blender/source/blender/editors/transform/transform.c
2009-01-03 21:10:48 UTC (rev 18299)
+++ branches/blender2.5/blender/source/blender/editors/transform/transform.c
2009-01-03 22:15:59 UTC (rev 18300)
@@ -59,7 +59,10 @@
 #include DNA_userdef_types.h
 #include DNA_view3d_types.h
 #include DNA_space_types.h
+#include DNA_windowmanager_types.h
 
+#include RNA_access.h
+
 //#include BIF_editview.h/* arrows_move_cursor   */
 #include BIF_gl.h
 #include BIF_glutil.h
@@ -560,8 +563,6 @@
float mati[3][3] = {{1.0f, 0.0f, 0.0f}, {0.0f, 1.0f, 0.0f}, {0.0f, 
0.0f, 1.0f}};
char cmode = constraintModeToChar(t);

-   t-event = event;
-   
t-redraw |= handleMouseInput(t, t-mouse, event);
 
if (event-type == MOUSEMOVE)
@@ -569,6 +570,8 @@
t-mval[0] = event-x - t-ar-winrct.xmin;
t-mval[1] = event-y - t-ar-winrct.ymin;

+   t-redraw = 1;
+   
applyMouseInput(t, t-mouse, t-mval, t-values);
}

@@ -577,9 +580,16 @@
/* enforce redraw of transform when modifiers are used */
case LEFTCTRLKEY:
case RIGHTCTRLKEY:
+   t-modifiers |= MOD_SNAP_GEARS;
t-redraw = 1;
break;

+   case LEFTSHIFTKEY:
+   case RIGHTSHIFTKEY:
+   t-modifiers |= MOD_CONSTRAINT_PLANE;
+   t-redraw = 1;
+   break;
+
case SPACEKEY:
if ((t-spacetype==SPACE_VIEW3D)  event-alt) {
 #if 0 // TRANSFORM_FIX_ME
@@ -597,7 +607,6 @@
}
break;

-   
case MIDDLEMOUSE:
if ((t-flag  

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18301] branches/blender2.5/blender/source /blender/makesrna/intern/rna_modifier.c: Fixed a couple of properties in Modifiers.

2009-01-03 Thread Nicholas Bishop
Revision: 18301
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=18301
Author:   nicholasbishop
Date: 2009-01-04 00:14:33 +0100 (Sun, 04 Jan 2009)

Log Message:
---
Fixed a couple of properties in Modifiers.

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

Modified: 
branches/blender2.5/blender/source/blender/makesrna/intern/rna_modifier.c
===
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_modifier.c   
2009-01-03 22:15:59 UTC (rev 18300)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_modifier.c   
2009-01-03 23:14:33 UTC (rev 18301)
@@ -44,6 +44,12 @@
 #include BKE_context.h
 #include BKE_depsgraph.h
 
+static void rna_UVProject_projectors_begin(CollectionPropertyIterator *iter, 
PointerRNA *ptr)
+{
+   UVProjectModifierData *uvp= (UVProjectModifierData*)ptr-data;
+   rna_iterator_array_begin(iter, (void*)uvp-projectors, sizeof(Object*), 
10, NULL);
+}
+
 static StructRNA* rna_Modifier_refine(struct PointerRNA *ptr)
 {
ModifierData *md= (ModifierData*)ptr-data;
@@ -787,12 +793,10 @@
 
/* XXX: not sure how to handle uvlayer_tmp */
 
-   /* XXX: and how to do UVProjectModifier.projectors, a statically-sized 
array of Object pointers?
-   (this code crashes when it's expanded in the RNA viewer...) */
-   /*prop= RNA_def_property(srna, projectors, PROP_COLLECTION, 
PROP_NONE);
-   RNA_def_property_collection_sdna(prop, NULL, projectors, 
num_projectors);
+   prop= RNA_def_property(srna, projectors, PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, Object);
-   RNA_def_property_ui_text(prop, Projectors, );*/
+   RNA_def_property_collection_funcs(prop, 
rna_UVProject_projectors_begin, rna_iterator_array_next, 
rna_iterator_array_end, rna_iterator_array_dereference_get, 0, 0, 0, 0);
+   RNA_def_property_ui_text(prop, Projectors, );
 
prop= RNA_def_property(srna, image, PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, Image);
@@ -1172,7 +1176,20 @@
RNA_def_property_ui_text(prop, Offset, Distance to keep from the 
target.);
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, 
rna_Modifier_update);
 
-   /* XXX: need to do projaxis */
+   prop= RNA_def_property(srna, x, PROP_BOOLEAN, PROP_NONE);
+   RNA_def_property_boolean_sdna(prop, NULL, projAxis, 
MOD_SHRINKWRAP_PROJECT_OVER_X_AXIS);
+   RNA_def_property_ui_text(prop, X, );
+   RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, 
rna_Modifier_update);
+
+   prop= RNA_def_property(srna, y, PROP_BOOLEAN, PROP_NONE);
+   RNA_def_property_boolean_sdna(prop, NULL, projAxis, 
MOD_SHRINKWRAP_PROJECT_OVER_Y_AXIS);
+   RNA_def_property_ui_text(prop, Y, );
+   RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, 
rna_Modifier_update);
+
+   prop= RNA_def_property(srna, z, PROP_BOOLEAN, PROP_NONE);
+   RNA_def_property_boolean_sdna(prop, NULL, projAxis, 
MOD_SHRINKWRAP_PROJECT_OVER_Z_AXIS);
+   RNA_def_property_ui_text(prop, Z, );
+   RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, 
rna_Modifier_update);

prop= RNA_def_property(srna, subsurf_levels, PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, subsurfLevels);


___
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 [18302] branches/blender2.5/blender/source /blender/editors: Some tweaks to menu drawing

2009-01-03 Thread Matt Ebb
Revision: 18302
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=18302
Author:   broken
Date: 2009-01-04 01:05:40 +0100 (Sun, 04 Jan 2009)

Log Message:
---
Some tweaks to menu drawing

Modified Paths:
--
branches/blender2.5/blender/source/blender/editors/include/UI_interface.h
branches/blender2.5/blender/source/blender/editors/interface/interface.c

branches/blender2.5/blender/source/blender/editors/interface/interface_draw.c

branches/blender2.5/blender/source/blender/editors/interface/interface_regions.c
branches/blender2.5/blender/source/blender/editors/interface/resources.c

Modified: 
branches/blender2.5/blender/source/blender/editors/include/UI_interface.h
===
--- branches/blender2.5/blender/source/blender/editors/include/UI_interface.h   
2009-01-03 23:14:33 UTC (rev 18301)
+++ branches/blender2.5/blender/source/blender/editors/include/UI_interface.h   
2009-01-04 00:05:40 UTC (rev 18302)
@@ -180,7 +180,7 @@
 void uiRoundBox(float minx, float miny, float maxx, float maxy, float rad);
 void uiSetRoundBox(int type);
 void uiRoundRect(float minx, float miny, float maxx, float maxy, float rad);
-void uiDrawMenuBox(float minx, float miny, float maxx, float maxy, short flag);
+void uiDrawMenuBox(float minx, float miny, float maxx, float maxy, short flag, 
short direction);
 void uiDrawBoxShadow(unsigned char alpha, float minx, float miny, float maxx, 
float maxy);
 
 /* Popup Menu's */

Modified: 
branches/blender2.5/blender/source/blender/editors/interface/interface.c
===
--- branches/blender2.5/blender/source/blender/editors/interface/interface.c
2009-01-03 23:14:33 UTC (rev 18301)
+++ branches/blender2.5/blender/source/blender/editors/interface/interface.c
2009-01-04 00:05:40 UTC (rev 18302)
@@ -511,7 +511,7 @@
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

if(block-flag  UI_BLOCK_LOOP)
-   uiDrawMenuBox(block-minx, block-miny, block-maxx, 
block-maxy, block-flag);
+   uiDrawMenuBox(block-minx, block-miny, block-maxx, 
block-maxy, block-flag, block-direction);
else if(block-panel)
ui_draw_panel(CTX_wm_region(C), block);
 

Modified: 
branches/blender2.5/blender/source/blender/editors/interface/interface_draw.c
===
--- 
branches/blender2.5/blender/source/blender/editors/interface/interface_draw.c   
2009-01-03 23:14:33 UTC (rev 18301)
+++ 
branches/blender2.5/blender/source/blender/editors/interface/interface_draw.c   
2009-01-04 00:05:40 UTC (rev 18302)
@@ -2090,9 +2090,9 @@
glBegin(GL_POLYGON);
glColor4ub(0, 0, 0, alpha);
glVertex2f(maxx, miny);
-   glVertex2f(maxx, maxy-shadsize);
+   glVertex2f(maxx, maxy-0.3*shadsize);
glColor4ub(0, 0, 0, 0);
-   glVertex2f(maxx+shadsize, maxy-shadsize-shadsize);
+   glVertex2f(maxx+shadsize, maxy-0.75*shadsize);
glVertex2f(maxx+shadsize, miny);
glEnd();

@@ -2109,11 +2109,11 @@
/* bottom quad */   
glBegin(GL_POLYGON);
glColor4ub(0, 0, 0, alpha);
-   glVertex2f(minx+shadsize, miny);
+   glVertex2f(minx+0.3*shadsize, miny);
glVertex2f(maxx, miny);
glColor4ub(0, 0, 0, 0);
glVertex2f(maxx, miny-shadsize);
-   glVertex2f(minx+shadsize+shadsize, miny-shadsize);
+   glVertex2f(minx+0.5*shadsize, miny-shadsize);
glEnd();

glDisable(GL_BLEND);
@@ -2123,33 +2123,48 @@
 void uiDrawBoxShadow(unsigned char alpha, float minx, float miny, float maxx, 
float maxy)
 {
/* accumulated outline boxes to make shade not linear, is more pleasant 
*/
-   ui_shadowbox(minx, miny, maxx, maxy, 6.0, (30*alpha)8);
-   ui_shadowbox(minx, miny, maxx, maxy, 4.0, (70*alpha)8);
-   ui_shadowbox(minx, miny, maxx, maxy, 2.0, (100*alpha)8);
+   ui_shadowbox(minx, miny, maxx, maxy, 11.0, (20*alpha)8);
+   ui_shadowbox(minx, miny, maxx, maxy, 7.0, (40*alpha)8);
+   ui_shadowbox(minx, miny, maxx, maxy, 5.0, (80*alpha)8);

 }
 
 // background for pulldowns, pullups, and other drawing temporal menus
 // has to be made themable still (now only color)
 
-void uiDrawMenuBox(float minx, float miny, float maxx, float maxy, short flag)
+void uiDrawMenuBox(float minx, float miny, float maxx, float maxy, short flag, 
short direction)
 {
char col[4];
+   int rounded = ELEM(UI_GetThemeValue(TH_BUT_DRAWTYPE), TH_ROUNDED, 
TH_ROUNDSHADED);
+   
UI_GetThemeColor4ubv(TH_MENU_BACK, col);

+   if (rounded) {
+   if (direction == UI_DOWN) {
+   uiSetRoundBox(12);
+   miny -= 4.0;
+   } else if (direction == UI_TOP) {
+  

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18303] branches/blender2.5/blender/source /blender/editors: 2.5 / Nodes / Transformations

2009-01-03 Thread Nathan Letwory
Revision: 18303
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=18303
Author:   jesterking
Date: 2009-01-04 02:08:01 +0100 (Sun, 04 Jan 2009)

Log Message:
---
2.5 / Nodes / Transformations
- after talking with Martin P (theeth), I have now shuffled code around
  so that there is no more exception code for nodes in the wrong places.
  This means node editor now also use entirely common translation.
  As proof of concept, there is now also resize and rotate support. It already
  works, but there need to be a bit more thought in how those
  actions are initialised for node editor. Probably some way to tell
  what to use as pivot point, etc.

Modified Paths:
--
branches/blender2.5/blender/source/blender/editors/include/BIF_transform.h
branches/blender2.5/blender/source/blender/editors/transform/transform.c
branches/blender2.5/blender/source/blender/editors/transform/transform.h

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

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

Modified: 
branches/blender2.5/blender/source/blender/editors/include/BIF_transform.h
===
--- branches/blender2.5/blender/source/blender/editors/include/BIF_transform.h  
2009-01-04 00:05:40 UTC (rev 18302)
+++ branches/blender2.5/blender/source/blender/editors/include/BIF_transform.h  
2009-01-04 01:08:01 UTC (rev 18303)
@@ -71,8 +71,7 @@
TFM_BAKE_TIME,
TFM_BEVEL,
TFM_BWEIGHT,
-   TFM_ALIGN,
-   TFM_NODE_TRANSLATE
+   TFM_ALIGN
 } TfmModesInputFlags;
 
 /* TRANSFORM CONTEXTS */

Modified: 
branches/blender2.5/blender/source/blender/editors/transform/transform.c
===
--- branches/blender2.5/blender/source/blender/editors/transform/transform.c
2009-01-04 00:05:40 UTC (rev 18302)
+++ branches/blender2.5/blender/source/blender/editors/transform/transform.c
2009-01-04 01:08:01 UTC (rev 18303)
@@ -220,6 +220,17 @@
vec[1]= (v2d-cur.ymax-v2d-cur.ymin)*(dy) / (divy);
vec[2]= 0.0f;
}
+   else if(t-spacetype==SPACE_NODE) {
+   View2D *v2d = t-ar-v2d;
+   float divx, divy;
+   
+   divx= v2d-mask.xmax-v2d-mask.xmin;
+   divy= v2d-mask.ymax-v2d-mask.ymin;
+   
+   vec[0]= (v2d-cur.xmax-v2d-cur.xmin)*(dx)/divx;
+   vec[1]= (v2d-cur.ymax-v2d-cur.ymin)*(dy)/divy;
+   vec[2]= 0.0f;
+   }
 }
 
 void projectIntView(TransInfo *t, float *vec, int *adr)
@@ -550,8 +561,6 @@
return Key Time;
case TFM_MIRROR:
return Mirror;
-   case TFM_NODE_TRANSLATE:
-   return Node Translate;
}
return Transform;
 }
@@ -1080,13 +1089,8 @@
case TFM_ALIGN:
initAlign(t);
break;
-   case TFM_NODE_TRANSLATE:
-   initNodeTranslate(t);
-   break;
}
-
-
-
+   
RNA_float_get_array(op-ptr, values, values);

/* overwrite initial values if operator supplied a non-null vector */
@@ -1135,12 +1139,7 @@
if(t-state == TRANS_CANCEL)
{
exit_code = OPERATOR_CANCELLED;
-   
-   /* TRANSFORM_FIX_ME fix jesty's node stuff, shouldn't 
be exceptional at this level */   
-   if(t-spacetype == SPACE_NODE)
-   restoreTransNodes(t);
-   else
-   restoreTransObjects(t); // calls recalcData()
+   restoreTransObjects(t); // calls recalcData()
}
else
{
@@ -2953,7 +2952,7 @@

applyTranslation(t, t-values);
 
-   /* evil hack - redo translation if cliiping needeed */
+   /* evil hack - redo translation if clipping needed */
if (t-flag  T_CLIP_UV  clipUVTransform(t, t-values, 0))
applyTranslation(t, t-values);
 
@@ -4584,54 +4583,3 @@
}
 #endif
 }
-
-/* *** Node translation *** */
-
-void initNodeTranslate(TransInfo *t) 
-{
-   t-mode = TFM_NODE_TRANSLATE;
-   t-transform = NodeTranslate;
-   
-   initMouseInputMode(t, t-mouse, INPUT_NONE);
-
-   /* num-input has max of (n-1) */
-   t-idx_max = 0;
-   t-num.flag = 0;
-   t-num.idx_max = t-idx_max;
-   
-   /* initialise snap like for everything else */
-   t-snap[0] = 0.0f; 
-   t-snap[1] = t-snap[2] = 1.0f;
-}
-
-static void applyNodeTranslate(TransInfo *t) 
-{
-   TransData2D *td = t-data2d;
-   int i;
-
-   for (i 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18304] branches/blender2.5/blender/source /blender/editors: * Added support for displaying disabled RNA buttons

2009-01-03 Thread Matt Ebb
Revision: 18304
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=18304
Author:   broken
Date: 2009-01-04 03:09:41 +0100 (Sun, 04 Jan 2009)

Log Message:
---
* Added support for displaying disabled RNA buttons

The functionality already existed via the RNA system, this
commit makes disabled buttons draw greyed out, and not respond to clicks
(previously, they would drag/edit/etc but then reset to the previous value)

Modified Paths:
--
branches/blender2.5/blender/source/blender/editors/include/UI_interface.h
branches/blender2.5/blender/source/blender/editors/interface/interface.c

branches/blender2.5/blender/source/blender/editors/interface/interface_draw.c

Modified: 
branches/blender2.5/blender/source/blender/editors/include/UI_interface.h
===
--- branches/blender2.5/blender/source/blender/editors/include/UI_interface.h   
2009-01-04 01:08:01 UTC (rev 18303)
+++ branches/blender2.5/blender/source/blender/editors/include/UI_interface.h   
2009-01-04 02:09:41 UTC (rev 18304)
@@ -115,8 +115,8 @@
 #define UI_BUT_ALIGN_LEFT  (113)
 #define UI_BUT_ALIGN_RIGHT (114)
 #define UI_BUT_ALIGN_DOWN  (115)
+#define UI_BUT_DISABLED(116)
 
-
 /* Button types, bits stored in 1 value... and a short even!
 - bits 0-4:  bitnr (0-31)
 - bits 5-7:  pointer type

Modified: 
branches/blender2.5/blender/source/blender/editors/interface/interface.c
===
--- branches/blender2.5/blender/source/blender/editors/interface/interface.c
2009-01-04 01:08:01 UTC (rev 18303)
+++ branches/blender2.5/blender/source/blender/editors/interface/interface.c
2009-01-04 02:09:41 UTC (rev 18304)
@@ -2118,6 +2118,12 @@
but-rnapoin= *ptr;
but-rnaprop= prop;
but-rnaindex= index;
+   
+   if (!RNA_property_editable(but-rnapoin, prop)) {
+   but-flag |= UI_BUT_DISABLED;
+   but-lock = 1;
+   but-lockstr = ;
+   }
 
if(freestr)
MEM_freeN(str);

Modified: 
branches/blender2.5/blender/source/blender/editors/interface/interface_draw.c
===
--- 
branches/blender2.5/blender/source/blender/editors/interface/interface_draw.c   
2009-01-04 01:08:01 UTC (rev 18303)
+++ 
branches/blender2.5/blender/source/blender/editors/interface/interface_draw.c   
2009-01-04 02:09:41 UTC (rev 18304)
@@ -58,6 +58,8 @@
 #include interface_intern.h
 
 #define UI_RB_ALPHA 16
+#define UI_DISABLED_ALPHA_OFFS -160
+
 static int roundboxtype= 15;
 
 void uiSetRoundBox(int type)
@@ -485,13 +487,14 @@
 
 void uiTriangleFakeAA(float x1, float y1, float x2, float y2, float x3, float 
y3, float asp)
 {
-   float color[4];
+   float color[4], alpha;
float jitter;
int i, passes=4;

/* get the colour and divide up the alpha */
glGetFloatv(GL_CURRENT_COLOR, color);
-   color[3]= 1.0/(float)passes;
+   alpha = color[3];
+   color[3]= alpha/(float)passes;
glColor4fv(color);

/* set the 'jitter amount' */
@@ -511,6 +514,9 @@
}

glDisable( GL_BLEND );
+   
+   color[3] = alpha;
+   glColor4fv(color);
 }
 
 /* for headers and floating panels */
@@ -1116,6 +1122,7 @@
 {
float rad, maxrad;
int align= (flag  UI_BUT_ALIGN);
+   int alpha_offs= (flag  UI_BUT_DISABLED)?UI_DISABLED_ALPHA_OFFS:0;

/* rounded corners */
if (ELEM4(type, MENU, ROW, ICONROW, ICONTEXTROW)) maxrad = 5.0;
@@ -1176,9 +1183,9 @@
case ICONTEXTROW:   
/* iconrow double arrow  */
if(flag  UI_SELECT) {
-   UI_ThemeColorShade(colorid, -80);
+   UI_ThemeColorShadeAlpha(colorid, -80, 
alpha_offs);
} else {
-   UI_ThemeColorShade(colorid, -45);
+   UI_ThemeColorShadeAlpha(colorid, -45, 
alpha_offs);
}
ui_iconrow_arrows(x1, y1, x2, y2);
/* end iconrow double arrow */
@@ -1186,9 +1193,9 @@
case MENU:
/* menu double arrow  */
if(flag  UI_SELECT) {
-   UI_ThemeColorShade(colorid, -110);
+   UI_ThemeColorShadeAlpha(colorid, -110, 
alpha_offs);
} else {
-   UI_ThemeColorShade(colorid, -80);
+   UI_ThemeColorShadeAlpha(colorid, -80, 
alpha_offs);
}
ui_menu_arrows(x1, y1, x2, y2, asp);
/* end menu double arrow */
@@ 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18305] branches/bmesh/bmesh: The conversions functions are now operator-afied.

2009-01-03 Thread Joseph Eagar
Revision: 18305
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=18305
Author:   joeedh
Date: 2009-01-04 03:25:10 +0100 (Sun, 04 Jan 2009)

Log Message:
---
The conversions functions are now operator-afied.

Also tried to make the flags play nice with each other
again, since that was messing things up.  I'm a
little confused on the design; I thought that flags
from the Edit-f variables would go in
header-flag, along with the flags that live in
other variables.

I made the two temp flags (flag layer flag, not
header-flag) be at the 15th and 16th bit, since
otherwise they could probably interfere with
operator flags.  I also reverted the change of
header-flag to a short, and the changes of the
bmesh-specific flags.

Modified Paths:
--
branches/bmesh/bmesh/bmesh.h
branches/bmesh/bmesh/bmesh_operators.h
branches/bmesh/bmesh/editmesh_tools.c
branches/bmesh/bmesh/intern/bmesh_opdefines.c
branches/bmesh/bmesh/intern/bmesh_operators_private.h
branches/bmesh/bmesh/intern/bmesh_structure.c
branches/bmesh/bmesh/intern/bmesh_to_editmesh.c
branches/bmesh/bmesh/intern/editmesh_to_bmesh.c
branches/bmesh/bmesh/operators/subdivideop.c

Modified: branches/bmesh/bmesh/bmesh.h
===
--- branches/bmesh/bmesh/bmesh.h2009-01-04 02:09:41 UTC (rev 18304)
+++ branches/bmesh/bmesh/bmesh.h2009-01-04 02:25:10 UTC (rev 18305)
@@ -62,38 +62,37 @@
 */
 
 /*BMHeader-type*/
-#define BM_VERT1
-#define BM_EDGE2
-#define BM_FACE4
-#define BM_LOOP8
-#define BM_ALL BM_VERT | BM_EDGE | BM_FACE | 
BM_LOOP
+#define BM_VERT1
+#define BM_EDGE2
+#define BM_FACE4
+#define BM_LOOP8
+#define BM_ALL BM_VERT | BM_EDGE | BM_FACE | BM_LOOP
 
 /*BMHeader-flag*/
 #define BM_SELECT  (10)
-#define BM_SEAM(11)
-#define BM_FGON(12)
-#define BM_HIDDEN  (13)
-#define BM_SHARP   (14)
-#define BM_SMOOTH  (15)
 
-typedef struct BMHeader
-{
+#define BM_SEAM(116)
+#define BM_FGON(117)
+#define BM_HIDDEN  (118)
+#define BM_SHARP   (119)
+#define BM_SMOOTH  (120)
+
+typedef struct BMHeader {
struct BMHeader *next, *prev;
int EID;
/*Consider removing this/making it ifdeffed for debugging*/
-   short   flag, type; 

+   int flag, type;
int eflag1, eflag2; 
/*Flags used by eulers. Try and get rid of/minimize some of these*/
struct BMFlagLayer *flags;  
/*Dynamically allocated block of flag layers for operators to use*/
 } BMHeader;
 
-typedef struct BMFlagLayer{
+typedef struct BMFlagLayer {
int f1;
short mask, pflag;
-}BMFlagLayer;
+} BMFlagLayer;
 
-#define BM_OVERLAP (10)  /*used by 
bmesh_verts_in_face*/
-#define BM_EDGEVERT(11)  /*used by bmesh_make_ngon*/
+#define BM_OVERLAP (114) /*used by 
bmesh_verts_in_face*/
+#define BM_EDGEVERT(115) /*used by bmesh_make_ngon*/
 
-
 /*
  * BMNode
  *
@@ -103,14 +102,13 @@
  *
 */
 
-typedef struct BMNode{
+typedef struct BMNode {
struct BMNode *next, *prev;
void *data;
-}BMNode;
+} BMNode;
 
 
-typedef struct BMesh
-{
+typedef struct BMesh {
ListBase verts, edges, polys;
struct BLI_mempool *vpool;
struct BLI_mempool *epool;
@@ -128,10 +126,9 @@
struct BLI_mempool *flagpool;   
/*memory pool for dynamically allocated flag layers*/
int stackdepth; 
/*current depth of operator stack*/
int totflags, walkers;  
/*total number of tool flag layers*/
-}BMesh;
+} BMesh;
 
-typedef struct BMVert
-{  
+typedef struct BMVert {
struct BMHeader head;
float co[3];

float no[3];

@@ -141,35 +138,32 @@
float bweight;  
/*please, someone just get rid of me...*/
 } BMVert;
 
-typedef struct BMEdge
-{
+typedef struct BMEdge {
struct BMHeader head;
struct BMVert *v1, *v2;
struct BMNode d1, d2;
struct BMLoop *loop;
void *data;
float 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18307] branches/blender2.5/blender/source /blender/editors/object/object_edit.c: no idea how this happened :S

2009-01-03 Thread Michael Fox
Revision: 18307
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=18307
Author:   mfoxdogg
Date: 2009-01-04 03:39:22 +0100 (Sun, 04 Jan 2009)

Log Message:
---
no idea how this happened :S

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

Modified: 
branches/blender2.5/blender/source/blender/editors/object/object_edit.c
===
--- branches/blender2.5/blender/source/blender/editors/object/object_edit.c 
2009-01-04 02:34:34 UTC (rev 18306)
+++ branches/blender2.5/blender/source/blender/editors/object/object_edit.c 
2009-01-04 02:39:22 UTC (rev 18307)
@@ -1496,6 +1496,7 @@
ot-idname= OBJECT_OT_clear_origin;

/* api callbacks */
+   ot-invoke= WM_operator_confirm;
ot-exec= object_clear_origin_exec;
ot-poll= ED_operator_object_active;
 }


___
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 [18308] branches/blender2.5/blender/source /blender/editors: 2.5 - Outliner/RNA Viewer View2d Fixes (Part 1)

2009-01-03 Thread Joshua Leung
Revision: 18308
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=18308
Author:   aligorith
Date: 2009-01-04 05:21:32 +0100 (Sun, 04 Jan 2009)

Log Message:
---
2.5 - Outliner/RNA Viewer View2d Fixes (Part 1)

Cleaned up the View2D setup stuff here, by removing all the hacky manual 
setting of tot and cur rects. Now the Outliner and RNA are scrollable again.

However, in the process, I uncovered a few rather nasty bugs that must've been 
around for ages. 
1) The width-calculation code depends on te-xend for calculating the 
max-extents, but that is not set until drawing of channels commences. This is 
far too late, as it is needed for the setting of the 'tot' rect's extents, so 
that we can have horizontal scrolling, and an accurate horizontal scroller! I 
noticed that RNA version of this currently hacks around this by using constant 
width of 100, but that's not a great final solution.

2) There's some minor pixel offset twitching going on with the restriction 
columns when the view is resized. Also, for RNA, the buttons sometimes cause a 
few drawing artifacts. Will check on this in part 2.

Modified Paths:
--
branches/blender2.5/blender/source/blender/editors/interface/view2d.c
branches/blender2.5/blender/source/blender/editors/space_outliner/outliner.c

Modified: branches/blender2.5/blender/source/blender/editors/interface/view2d.c
===
--- branches/blender2.5/blender/source/blender/editors/interface/view2d.c   
2009-01-04 02:39:22 UTC (rev 18307)
+++ branches/blender2.5/blender/source/blender/editors/interface/view2d.c   
2009-01-04 04:21:32 UTC (rev 18308)
@@ -671,8 +671,13 @@
 void UI_view2d_totRect_set (View2D *v2d, int width, int height)
 {
/* don't do anything if either value is 0 */
-   if (ELEM3(0, v2d, width, height))
+   width= abs(width);
+   height= abs(height);
+   
+   if (ELEM3(0, v2d, width, height)) {
+   printf(Error: View2D totRect set exiting: %p %d %d \n, v2d, 
width, height); // XXX temp debug string
return;
+   }

/* handle width - posx and negx flags are mutually exclusive, so watch 
out */
if ((v2d-align  V2D_ALIGN_NO_POS_X)  !(v2d-align  
V2D_ALIGN_NO_NEG_X)) {

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-04 02:39:22 UTC (rev 18307)
+++ 
branches/blender2.5/blender/source/blender/editors/space_outliner/outliner.c
2009-01-04 04:21:32 UTC (rev 18308)
@@ -263,7 +263,7 @@
TreeStoreElem *tselem= TREESTORE(te);
if((tselem-flag  TSE_CLOSED)==0) 
outliner_height(soops, te-subtree, h);
-   (*h)++;
+   (*h) += OL_H;
te= te-next;
}
 }
@@ -273,13 +273,20 @@
TreeElement *te= lb-first;
while(te) {
TreeStoreElem *tselem= TREESTORE(te);
+   
+   // XXX fixme... te-xend is not set yet
+/*
if(tselem-flag  TSE_CLOSED) {
if (te-xend  *w)
*w = te-xend;
}
+*/
outliner_width(soops, te-subtree, w);
te= te-next;
}
+   
+   // XXX for now, use constant width for this level (until te-xend is 
set)
+   *w += 100;
 }
 
 static void outliner_rna_width(SpaceOops *soops, ListBase *lb, int *w, int 
startx)
@@ -287,6 +294,7 @@
TreeElement *te= lb-first;
while(te) {
TreeStoreElem *tselem= TREESTORE(te);
+   // XXX fixme... (currently, we're using a fixed length 
of 100)!
/*if(te-xend) {
if(te-xend  *w)
*w = te-xend;
@@ -1198,7 +1206,7 @@
Object *ob;
TreeElement *te=NULL, *ten;
TreeStoreElem *tselem;
-   int show_opened= soops-treestore==NULL; /* on first view, we open 
scenes */
+   int show_opened= (soops-treestore==NULL); /* on first view, we open 
scenes */
 
if(soops-tree.first  (soops-storeflag  SO_TREESTORE_REDRAW))
   return;
@@ -1207,13 +1215,13 @@
outliner_storage_cleanup(soops);

/* clear ob id.new flags */
-   for(ob= G.main-object.first; ob; ob= ob-id.next) ob-id.newid= NULL;
+   for(ob= mainvar-object.first; ob; ob= ob-id.next) ob-id.newid= NULL;

/* options */
if(soops-outlinevis == SO_LIBRARIES) {
Library *lib;

-   for(lib= G.main-library.first; lib; lib= lib-id.next) {
+   for(lib= mainvar-library.first; lib; lib= lib-id.next) {
ten= 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18310] branches/blender2.5/blender/source /blender/editors: * Enabled disabled drawing for 'locked' buttons

2009-01-03 Thread Matt Ebb
Revision: 18310
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=18310
Author:   broken
Date: 2009-01-04 08:50:41 +0100 (Sun, 04 Jan 2009)

Log Message:
---
* Enabled disabled drawing for 'locked' buttons 
(made with uiBlockSetButLock())

Modified Paths:
--
branches/blender2.5/blender/source/blender/editors/include/UI_resources.h
branches/blender2.5/blender/source/blender/editors/interface/interface.c

branches/blender2.5/blender/source/blender/editors/interface/interface_draw.c
branches/blender2.5/blender/source/blender/editors/interface/resources.c

Modified: 
branches/blender2.5/blender/source/blender/editors/include/UI_resources.h
===
--- branches/blender2.5/blender/source/blender/editors/include/UI_resources.h   
2009-01-04 07:47:11 UTC (rev 18309)
+++ branches/blender2.5/blender/source/blender/editors/include/UI_resources.h   
2009-01-04 07:50:41 UTC (rev 18310)
@@ -904,6 +904,7 @@
 void   UI_ThemeColorBlend(int colorid1, int colorid2, float fac);
 // same, with shade offset
 voidUI_ThemeColorBlendShade(int colorid1, int colorid2, float fac, int 
offset);
+void   UI_ThemeColorBlendShadeAlpha(int colorid1, int colorid2, float fac, int 
offset, int alphaoffset);
 
 // returns one value, not scaled
 float  UI_GetThemeValuef(int colorid);

Modified: 
branches/blender2.5/blender/source/blender/editors/interface/interface.c
===
--- branches/blender2.5/blender/source/blender/editors/interface/interface.c
2009-01-04 07:47:11 UTC (rev 18309)
+++ branches/blender2.5/blender/source/blender/editors/interface/interface.c
2009-01-04 07:50:41 UTC (rev 18310)
@@ -2035,6 +2035,12 @@
if(block-flag  UI_BLOCK_NO_HILITE)
but-flag |= UI_NO_HILITE;
 
+   if (but-lock) {
+   if (but-lockstr) {
+   but-flag |= UI_BUT_DISABLED;
+   }
+   }
+
return but;
 }
 

Modified: 
branches/blender2.5/blender/source/blender/editors/interface/interface_draw.c
===
--- 
branches/blender2.5/blender/source/blender/editors/interface/interface_draw.c   
2009-01-04 07:47:11 UTC (rev 18309)
+++ 
branches/blender2.5/blender/source/blender/editors/interface/interface_draw.c   
2009-01-04 07:50:41 UTC (rev 18310)
@@ -436,13 +436,14 @@
 /* plain fake antialiased unfilled round rectangle */
 void uiRoundRectFakeAA(float minx, float miny, float maxx, float maxy, float 
rad, float asp)
 {
-   float color[4];
+   float color[4], alpha;
float raddiff;
int i, passes=4;

/* get the colour and divide up the alpha */
glGetFloatv(GL_CURRENT_COLOR, color);
-   color[3]= 1/(float)passes;
+   alpha = color[3];
+   color[3]= alpha/(float)passes;
glColor4fv(color);

/* set the 'jitter amount' */
@@ -456,6 +457,9 @@
}

glDisable( GL_BLEND );
+   
+   color[3] = alpha;
+   glColor4fv(color);
 }
 
 /* (old, used in outliner) plain antialiased filled box */
@@ -706,6 +710,8 @@
else if(but-flag  UI_ACTIVE);
else blend= -60;
}
+   if (but-flag  UI_BUT_DISABLED) blend = -100;
+   
UI_icon_draw_aspect_blended(xs, ys, icon, aspect, blend);

glDisable(GL_BLEND);
@@ -909,6 +915,7 @@
 /* shaded round button */
 static void round_button_shaded(int type, int colorid, float asp, float x1, 
float y1, float x2, float y2, int flag, int rad)
 {
+   int alpha_offs= (flag  UI_BUT_DISABLED)?UI_DISABLED_ALPHA_OFFS:0;
float shadefac;

/* colour shading */
@@ -928,7 +935,7 @@
gl_round_box_shade(GL_POLYGON, x1, y1, x2, y2, rad, shadefac, 
-shadefac);

/* outline */
-   UI_ThemeColorBlendShade(TH_BUT_OUTLINE, TH_BACK, 0.1, -40);
+   UI_ThemeColorBlendShadeAlpha(TH_BUT_OUTLINE, TH_BACK, 0.1, -40, 
alpha_offs);

uiRoundRectFakeAA(x1, y1, x2, y2, rad, asp);
/* end outline */   
@@ -937,6 +944,8 @@
 /* base round flat button */
 static void round_button_flat(int colorid, float asp, float x1, float y1, 
float x2, float y2, int flag, float rad)
 {  
+   int alpha_offs= (flag  UI_BUT_DISABLED)?UI_DISABLED_ALPHA_OFFS:0;
+   
/* colour shading */
if(flag  UI_SELECT) {
if (flag  UI_ACTIVE) UI_ThemeColorShade(colorid, -20);
@@ -952,7 +961,7 @@
gl_round_box(GL_POLYGON, x1, y1, x2, y2, rad);

/* outline */
-   UI_ThemeColorBlendShade(TH_BUT_OUTLINE, TH_BACK, 0.1, -30);
+   UI_ThemeColorBlendShadeAlpha(TH_BUT_OUTLINE, TH_BACK, 0.1, -30, 
alpha_offs);

uiRoundRectFakeAA(x1, y1, x2, y2, rad, asp);
/* end outline */

Modified: 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18311] trunk/blender/config/linux2-config .py: C files reference libredcode/format.h, which only exist in extern/ libredcodec/format.h, so for now

2009-01-03 Thread Campbell Barton
Revision: 18311
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=18311
Author:   campbellbarton
Date: 2009-01-04 08:56:51 +0100 (Sun, 04 Jan 2009)

Log Message:
---
C files reference libredcode/format.h, which only exist in 
extern/libredcodec/format.h, so for now adding extern/ as an include when 
redcode is enabled lets it compile,
noticed there are some win32 ifdef's that don't do anything.

should be fixed properly but this at least compiles for now.

Modified Paths:
--
trunk/blender/config/linux2-config.py

Modified: trunk/blender/config/linux2-config.py
===
--- trunk/blender/config/linux2-config.py   2009-01-04 07:50:41 UTC (rev 
18310)
+++ trunk/blender/config/linux2-config.py   2009-01-04 07:56:51 UTC (rev 
18311)
@@ -163,7 +163,8 @@
 WITH_BF_REDCODE = False  
 BF_REDCODE = '#extern/libredcode'
 BF_REDCODE_LIB = ''
-BF_REDCODE_INC = '${BF_REDCODE}/include'
+# BF_REDCODE_INC = '${BF_REDCODE}/include'
+BF_REDCODE_INC = '${BF_REDCODE}/../' #C files request libredcode/format.h 
which is in #extern/libredcode/format.h, stupid but compiles for now.
 BF_REDCODE_LIBPATH='${BF_REDCODE}/lib'
 
 # Mesa Libs should go here if your using them as well


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