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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-11-28 09:03:30 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-11-28 09:03:30 +0300
commit34ea1cf0b23977ab76b23b06f6ceb1fda5631f88 (patch)
treefe8ed20a86405a088270ba5e8fef53ae1cb68972 /source/blender/editors
parent9d3a17922cad62f1f73ba60eef669a091a2b8687 (diff)
minor changes to the python api.
- pep8 script was giving an error on non utf8 scons source files. - use PyList_SET_ITEM macro when list type is ensured. - all mathutils types use subtypes to create new types when available. - use defines MAT3_UNITY, MAT4_UNITY to initialize unit matrices.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/armature/editarmature.c18
-rw-r--r--source/blender/editors/curve/editcurve.c3
-rw-r--r--source/blender/editors/interface/interface_draw.c2
-rw-r--r--source/blender/editors/physics/particle_edit.c9
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c3
-rw-r--r--source/blender/editors/transform/transform.c2
-rw-r--r--source/blender/editors/transform/transform_constraints.c3
-rw-r--r--source/blender/editors/transform/transform_manipulator.c3
8 files changed, 12 insertions, 31 deletions
diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c
index fc9324d1742..3bb0124bf03 100644
--- a/source/blender/editors/armature/editarmature.c
+++ b/source/blender/editors/armature/editarmature.c
@@ -5779,13 +5779,8 @@ EditBone * test_subdivideByCorrelation(Scene *scene, Object *obedit, ReebArc *ar
if (scene->toolsettings->skgen_options & SKGEN_CUT_CORRELATION)
{
- float invmat[4][4] = { {1, 0, 0, 0},
- {0, 1, 0, 0},
- {0, 0, 1, 0},
- {0, 0, 0, 1}};
- float tmat[3][3] = { {1, 0, 0},
- {0, 1, 0},
- {0, 0, 1}};
+ float invmat[4][4]= MAT4_UNITY;
+ float tmat[3][3]= MAT3_UNITY;
ReebArcIterator arc_iter;
BArcIterator *iter = (BArcIterator*)&arc_iter;
bArmature *arm= obedit->data;
@@ -5831,13 +5826,8 @@ EditBone * test_subdivideByLength(Scene *scene, Object *obedit, ReebArc *arc, Re
if ((scene->toolsettings->skgen_options & SKGEN_CUT_LENGTH) &&
arcLengthRatio(arc) >= G.scene->toolsettings->skgen_length_ratio)
{
- float invmat[4][4] = { {1, 0, 0, 0},
- {0, 1, 0, 0},
- {0, 0, 1, 0},
- {0, 0, 0, 1}};
- float tmat[3][3] = { {1, 0, 0},
- {0, 1, 0},
- {0, 0, 1}};
+ float invmat[4][4]= MAT4_UNITY;
+ float tmat[3][3]= MAT3_UNITY;
ReebArcIterator arc_iter;
BArcIterator *iter = (BArcIterator*)&arc_iter;
bArmature *arm= obedit->data;
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index b35657cb266..5349cc0e421 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -5754,8 +5754,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob)
int a, b, cutype, stype;
int force_3d = ((Curve *)obedit->data)->flag & CU_3D; /* could be adding to an existing 3D curve */
- float umat[4][4];
- unit_m4(umat);
+ float umat[4][4]= MAT4_UNITY;
cutype= type & CU_TYPE; // poly, bezier, nurbs, etc
stype= type & CU_PRIMITIVE;
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c
index 1e818289d1e..0f298f5cbef 100644
--- a/source/blender/editors/interface/interface_draw.c
+++ b/source/blender/editors/interface/interface_draw.c
@@ -808,7 +808,7 @@ void ui_draw_but_WAVEFORM(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol),
int i, c;
float w, w3, h, alpha, yofs;
GLint scissor[4];
- float colors[3][3] = {{1,0,0},{0,1,0},{0,0,1}};
+ float colors[3][3]= MAT3_UNITY;
float colorsycc[3][3] = {{1,0,1},{1,1,0},{0,1,1}};
float colors_alpha[3][3], colorsycc_alpha[3][3]; /* colors pre multiplied by alpha for speed up */
float min, max;
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c
index 1fd9e91095f..12370e5b1ac 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -593,7 +593,7 @@ static void foreach_mouse_hit_key(PEData *data, ForKeyMatFunc func, int selected
ParticleSystemModifierData *psmd = NULL;
ParticleEditSettings *pset= PE_settings(data->scene);
POINT_P; KEY_K;
- float mat[4][4], imat[4][4];
+ float mat[4][4]= MAT4_UNITY, imat[4][4]= MAT4_UNITY;
if(edit->psys)
psmd= psys_get_modifier(data->ob, edit->psys);
@@ -602,9 +602,6 @@ static void foreach_mouse_hit_key(PEData *data, ForKeyMatFunc func, int selected
if(pset->selectmode==SCE_SELECT_PATH)
selected= 0;
- unit_m4(imat);
- unit_m4(mat);
-
LOOP_VISIBLE_POINTS {
if(pset->selectmode==SCE_SELECT_END) {
/* only do end keys */
@@ -1605,7 +1602,7 @@ int PE_lasso_select(bContext *C, short mcords[][2], short moves, short extend, s
ParticleSystem *psys = edit->psys;
ParticleSystemModifierData *psmd = psys_get_modifier(ob, psys);
POINT_P; KEY_K;
- float co[3], mat[4][4];
+ float co[3], mat[4][4]= MAT4_UNITY;
short vertco[2];
PEData data;
@@ -1619,8 +1616,6 @@ int PE_lasso_select(bContext *C, short mcords[][2], short moves, short extend, s
/* only for depths */
PE_set_view3d_data(C, &data);
- unit_m4(mat);
-
LOOP_VISIBLE_POINTS {
if(edit->psys && !(psys->flag & PSYS_GLOBAL_HAIR))
psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, psys->particles + p, mat);
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 0d07583c28c..73ca3bad5c2 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -516,8 +516,7 @@ float calc_overlap(StrokeCache *cache, const char symm, const char axis, const f
flip_coord(mirror, cache->true_location, symm);
if(axis != 0) {
- float mat[4][4];
- unit_m4(mat);
+ float mat[4][4]= MAT4_UNITY;
rotate_m4(mat, axis, angle);
mul_m4_v3(mat, mirror);
}
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index 34c0e17f7d2..f18839836c0 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -560,7 +560,7 @@ wmKeyMap* transform_modal_keymap(wmKeyConfig *keyconf)
int transformEvent(TransInfo *t, wmEvent *event)
{
- float mati[3][3] = {{1.0f, 0.0f, 0.0f}, {0.0f, 1.0f, 0.0f}, {0.0f, 0.0f, 1.0f}};
+ float mati[3][3]= MAT3_UNITY;
char cmode = constraintModeToChar(t);
int handled = 1;
diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c
index f002bf9aeb9..60df20998e2 100644
--- a/source/blender/editors/transform/transform_constraints.c
+++ b/source/blender/editors/transform/transform_constraints.c
@@ -560,9 +560,8 @@ void setUserConstraint(TransInfo *t, short orientation, int mode, const char fte
switch(orientation) {
case V3D_MANIP_GLOBAL:
{
- float mtx[3][3];
+ float mtx[3][3]= MAT3_UNITY;
sprintf(text, ftext, "global");
- unit_m3(mtx);
setConstraint(t, mtx, mode, text);
}
break;
diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c
index b03c5ef5395..25d19f18d34 100644
--- a/source/blender/editors/transform/transform_manipulator.c
+++ b/source/blender/editors/transform/transform_manipulator.c
@@ -1316,8 +1316,7 @@ static void draw_manipulator_rotate_cyl(View3D *v3d, RegionView3D *rv3d, int mov
/* Screen aligned view rot circle */
if(drawflags & MAN_ROT_V) {
- float unitmat[4][4];
- unit_m4(unitmat);
+ float unitmat[4][4]= MAT4_UNITY;
if(G.f & G_PICKSEL) glLoadName(MAN_ROT_V);
UI_ThemeColor(TH_TRANSFORM);