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>2012-01-24 20:18:20 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-01-24 20:18:20 +0400
commit4af4863baf64e14959454a10443e0ae06b518e7e (patch)
tree06696b03fd54211a971e60f01fd176fcfe963fb9 /source/blender
parent644e44e7b6f5d10915f44282fcd728153d71e4fe (diff)
parent1f9e25ac1a7851ab2503b88564c0d480b9e125cf (diff)
svn merge ^/trunk/blender -r43639:43664
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/intern/constraint.c11
-rw-r--r--source/blender/blenkernel/intern/smoke.c14
-rw-r--r--source/blender/blenkernel/intern/tracking.c2
-rw-r--r--source/blender/editors/sculpt_paint/paint_ops.c2
-rw-r--r--source/blender/editors/space_clip/tracking_ops.c2
-rw-r--r--source/blender/editors/space_outliner/outliner_edit.c2
-rw-r--r--source/blender/editors/space_text/text_ops.c10
-rw-r--r--source/blender/editors/space_time/space_time.c4
-rw-r--r--source/blender/editors/space_view3d/view3d_select.c5
-rw-r--r--source/blender/editors/uvedit/uvedit_smart_stitch.c16
-rw-r--r--source/blender/editors/uvedit/uvedit_unwrap_ops.c15
-rw-r--r--source/blender/makesdna/DNA_smoke_types.h3
-rw-r--r--source/blender/makesrna/intern/rna_cloth.c4
-rw-r--r--source/blender/makesrna/intern/rna_scene.c8
-rw-r--r--source/blender/modifiers/intern/MOD_boolean_util.c9
-rw-r--r--source/blender/python/mathutils/mathutils_Matrix.c29
16 files changed, 102 insertions, 34 deletions
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index 7cdd61e1402..e207334bd45 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -2777,8 +2777,7 @@ static void stretchto_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
/* store Z orientation before destroying obmat */
normalize_v3_v3(zz, cob->matrix[2]);
- dist = len_v3v3(cob->matrix[3], ct->matrix[3]);
- /* XXX What was all that for??? Makes the constraint buggy with scaled objects, see #29940. */
+ /* XXX That makes the constraint buggy with asymmetrically scaled objects, see #29940. */
/* sub_v3_v3v3(vec, cob->matrix[3], ct->matrix[3]);*/
/* vec[0] /= size[0];*/
/* vec[1] /= size[1];*/
@@ -2786,10 +2785,14 @@ static void stretchto_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
/* dist = normalize_v3(vec);*/
+ dist = len_v3v3(cob->matrix[3], ct->matrix[3]);
+ /* Only Y constrained object axis scale should be used, to keep same length when scaling it. */
+ dist /= size[1];
+
/* data->orglength==0 occurs on first run, and after 'R' button is clicked */
- if (data->orglength == 0)
+ if (data->orglength == 0)
data->orglength = dist;
- if (data->bulge == 0)
+ if (data->bulge == 0)
data->bulge = 1.0;
scale[1] = dist/data->orglength;
diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c
index 038e48f5769..cd2d4c0c1f8 100644
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -77,6 +77,9 @@
#include "BKE_smoke.h"
+/* UNUSED so far, may be enabled later */
+/* #define USE_SMOKE_COLLISION_DM */
+
#ifdef WITH_SMOKE
#ifdef _WIN32
@@ -617,9 +620,11 @@ static void smokeModifier_freeCollision(SmokeModifierData *smd)
smd->coll->bvhtree = NULL;
}
+#ifdef USE_SMOKE_COLLISION_DM
if(smd->coll->dm)
smd->coll->dm->release(smd->coll->dm);
smd->coll->dm = NULL;
+#endif
MEM_freeN(smd->coll);
smd->coll = NULL;
@@ -682,9 +687,11 @@ void smokeModifier_reset(struct SmokeModifierData *smd)
smd->coll->bvhtree = NULL;
}
+#ifdef USE_SMOKE_COLLISION_DM
if(smd->coll->dm)
smd->coll->dm->release(smd->coll->dm);
smd->coll->dm = NULL;
+#endif
}
}
@@ -772,7 +779,10 @@ void smokeModifier_createType(struct SmokeModifierData *smd)
smd->coll->points = NULL;
smd->coll->numpoints = 0;
smd->coll->bvhtree = NULL;
+
+#ifdef USE_SMOKE_COLLISION_DM
smd->coll->dm = NULL;
+#endif
}
}
}
@@ -1339,11 +1349,13 @@ void smokeModifier_do(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedM
{
// XXX TODO
smd->time = scene->r.cfra;
-
+
+#ifdef USE_SMOKE_COLLISION_DM
if(smd->coll->dm)
smd->coll->dm->release(smd->coll->dm);
smd->coll->dm = CDDM_copy(dm, 1);
+#endif
// rigid movement support
copy_m4_m4(smd->coll->mat_old, smd->coll->mat);
diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c
index 73170612ff7..0c3c43bebc3 100644
--- a/source/blender/blenkernel/intern/tracking.c
+++ b/source/blender/blenkernel/intern/tracking.c
@@ -1062,7 +1062,7 @@ void BKE_tracking_disable_imbuf_channels(ImBuf *ibuf, int disable_red, int disab
static void disable_imbuf_channels(ImBuf *ibuf, MovieTrackingTrack *track, int grayscale)
{
BKE_tracking_disable_imbuf_channels(ibuf, track->flag&TRACK_DISABLE_RED,
- track->flag&TRACK_DISABLE_GREEN, track->flag&TRACK_DISABLE_RED, grayscale);
+ track->flag&TRACK_DISABLE_GREEN, track->flag&TRACK_DISABLE_BLUE, grayscale);
}
static ImBuf *get_area_imbuf(ImBuf *ibuf, MovieTrackingTrack *track, MovieTrackingMarker *marker,
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c
index c2026b30ab2..757f501d296 100644
--- a/source/blender/editors/sculpt_paint/paint_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_ops.c
@@ -359,7 +359,7 @@ static void BRUSH_OT_uv_sculpt_tool_set(wmOperatorType *ot)
extern EnumPropertyItem uv_sculpt_tool_items[];
/* identifiers */
ot->name = "UV Sculpt Tool Set";
- ot->description = "Set the uv sculpt tool";
+ ot->description = "Set the UV sculpt tool";
ot->idname = "BRUSH_OT_uv_sculpt_tool_set";
/* api callbacks */
diff --git a/source/blender/editors/space_clip/tracking_ops.c b/source/blender/editors/space_clip/tracking_ops.c
index 6cf8a988571..7fcd761fc49 100644
--- a/source/blender/editors/space_clip/tracking_ops.c
+++ b/source/blender/editors/space_clip/tracking_ops.c
@@ -1208,7 +1208,7 @@ static int track_count_markers(SpaceClip *sc, MovieClip *clip)
track= tracksbase->first;
while(track) {
if(TRACK_VIEW_SELECTED(sc, track) && (track->flag&TRACK_LOCKED)==0) {
- MovieTrackingMarker *marker= BKE_tracking_exact_marker(track, framenr);
+ MovieTrackingMarker *marker= BKE_tracking_get_marker(track, framenr);
if (!marker || (marker->flag&MARKER_DISABLED) == 0)
tot++;
diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c
index 12f4af3637e..562cbf45e86 100644
--- a/source/blender/editors/space_outliner/outliner_edit.c
+++ b/source/blender/editors/space_outliner/outliner_edit.c
@@ -1689,7 +1689,7 @@ void OUTLINER_OT_parent_clear(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Drop to Clear Parent";
- ot->description = "Drag to clear parent in outliner";
+ ot->description = "Drag to clear parent in Outliner";
ot->idname= "OUTLINER_OT_parent_clear";
/* api callbacks */
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c
index 29583a9356e..5517f428678 100644
--- a/source/blender/editors/space_text/text_ops.c
+++ b/source/blender/editors/space_text/text_ops.c
@@ -2412,7 +2412,7 @@ static void text_cursor_set_to_pos_wrapped(SpaceText *st, ARegion *ar, int x, in
{
Text *text = st->text;
int max = wrap_width(st, ar); /* view */
- int charp; /* mem */
+ int charp = -1; /* mem */
int loop = 1, found = 0; /* flags */
char ch;
@@ -2513,9 +2513,11 @@ static void text_cursor_set_to_pos_wrapped(SpaceText *st, ARegion *ar, int x, in
y--;
}
-
- if(sel) { text->sell = linep; text->selc = charp; }
- else { text->curl = linep; text->curc = charp; }
+
+ if (linep && charp != -1) {
+ if(sel) { text->sell = linep; text->selc = charp; }
+ else { text->curl = linep; text->curc = charp; }
+ }
}
static void text_cursor_set_to_pos(SpaceText *st, ARegion *ar, int x, int y, int sel)
diff --git a/source/blender/editors/space_time/space_time.c b/source/blender/editors/space_time/space_time.c
index 65ef3273e30..bf1b1ddc18a 100644
--- a/source/blender/editors/space_time/space_time.c
+++ b/source/blender/editors/space_time/space_time.c
@@ -193,6 +193,10 @@ static void time_draw_cache(SpaceTime *stime, Object *ob)
col[0] = 1.0; col[1] = 0.1; col[2] = 0.75;
col[3] = 0.1;
break;
+ default:
+ BLI_assert(0);
+ col[0] = 1.0; col[1] = 0.0; col[2] = 1.0;
+ col[3] = 0.1;
}
glColor4fv(col);
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c
index b4217441640..80fd404772e 100644
--- a/source/blender/editors/space_view3d/view3d_select.c
+++ b/source/blender/editors/space_view3d/view3d_select.c
@@ -2460,6 +2460,7 @@ static short pchan_circle_doSelectJoint(void *userData, bPoseChannel *pchan, int
static void pose_circle_select(ViewContext *vc, int select, const int mval[2], float rad)
{
struct {ViewContext *vc; short select; int mval[2]; float radius; } data;
+ bArmature *arm = vc->obact->data;
bPose *pose = vc->obact->pose;
bPoseChannel *pchan;
int change= FALSE;
@@ -2478,6 +2479,10 @@ static void pose_circle_select(ViewContext *vc, int select, const int mval[2], f
short sco1[2], sco2[2], didpoint=0;
float vec[3];
+ /* skip invisible bones */
+ if (PBONE_VISIBLE(arm, pchan->bone) == 0)
+ continue;
+
/* project head location to screenspace */
mul_v3_m4v3(vec, vc->obact->obmat, pchan->pose_head);
project_short(vc->ar, vec, sco1);
diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.c b/source/blender/editors/uvedit/uvedit_smart_stitch.c
index 43fdcff2e61..8634aa90dd3 100644
--- a/source/blender/editors/uvedit/uvedit_smart_stitch.c
+++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c
@@ -569,7 +569,7 @@ static void stitch_validate_stichability(UvElement *element, StitchState *state,
static int stitch_process_data(StitchState *state, Scene *scene, int final)
{
int i;
- StitchPreviewer *preview = uv_get_stitch_previewer();
+ StitchPreviewer *preview;
IslandStitchData *island_stitch_data = NULL;
int previous_island = state->static_island;
EditFace *efa;
@@ -1458,11 +1458,15 @@ void UV_OT_stitch(wmOperatorType *ot)
/* properties */
RNA_def_boolean(ot->srna, "use_limit", 0, "Use Limit", "Stitch UVs within a specified limit distance");
- RNA_def_boolean(ot->srna, "snap_islands", 1, "Snap Islands", "Snap islands together. On edge stitch mode, rotates the islands too");
-
- RNA_def_float(ot->srna, "limit", 0.01f, 0.0f, FLT_MAX, "Limit", "Limit distance in normalized coordinates", 0.0, FLT_MAX);
- RNA_def_int(ot->srna, "static_island", 0, 0, INT_MAX, "Static Island", "Island that stays in place when stitching islands", 0, INT_MAX);
- RNA_def_boolean(ot->srna, "midpoint_snap", 0, "Snap At Midpoint", "Uv's are stitched at midpoint instead of at static island");
+ RNA_def_boolean(ot->srna, "snap_islands", 1, "Snap Islands",
+ "Snap islands together (on edge stitch mode, rotates the islands too)");
+
+ RNA_def_float(ot->srna, "limit", 0.01f, 0.0f, FLT_MAX, "Limit",
+ "Limit distance in normalized coordinates", 0.0, FLT_MAX);
+ RNA_def_int(ot->srna, "static_island", 0, 0, INT_MAX, "Static Island",
+ "Island that stays in place when stitching islands", 0, INT_MAX);
+ RNA_def_boolean(ot->srna, "midpoint_snap", 0, "Snap At Midpoint",
+ "UVs are stitched at midpoint instead of at static island");
prop = RNA_def_collection_runtime(ot->srna, "selection", &RNA_SelectedUvElement, "Selection", "");
/* Selection should not be editable or viewed in toolbar */
RNA_def_property_flag(prop, PROP_HIDDEN);
diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
index 11ea0f12a9e..55e71b8ebcf 100644
--- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c
+++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
@@ -352,7 +352,6 @@ static ParamHandle *construct_param_handle_subsurfed(Scene *scene, EditMesh *edi
MFace *face;
MEdge *edge;
EditVert *editVert;
- MTFace *texface;
EditFace *editFace, **editFaceTmp;
EditEdge *editEdge, **editEdgeTmp;
int i;
@@ -367,7 +366,7 @@ static ParamHandle *construct_param_handle_subsurfed(Scene *scene, EditMesh *edi
MVert *subsurfedVerts;
MEdge *subsurfedEdges;
MFace *subsurfedFaces;
- MTFace *subsurfedTexfaces;
+ /* MTFace *subsurfedTexfaces; */ /* UNUSED */
/* number of vertices and faces for subsurfed mesh*/
int numOfEdges, numOfFaces;
@@ -386,7 +385,7 @@ static ParamHandle *construct_param_handle_subsurfed(Scene *scene, EditMesh *edi
if(eface) {
float aspx, aspy;
- texface= CustomData_em_get(&editMesh->fdata, eface->data, CD_MTFACE);
+ MTFace *texface= CustomData_em_get(&editMesh->fdata, eface->data, CD_MTFACE);
ED_image_uv_aspect(texface->tpage, &aspx, &aspy);
@@ -414,7 +413,7 @@ static ParamHandle *construct_param_handle_subsurfed(Scene *scene, EditMesh *edi
origEdgeIndices = derivedMesh->getEdgeDataArray(derivedMesh, CD_ORIGINDEX);
origFaceIndices = derivedMesh->getFaceDataArray(derivedMesh, CD_ORIGINDEX);
- subsurfedTexfaces = derivedMesh->getFaceDataArray(derivedMesh, CD_MTFACE);
+ /* subsurfedTexfaces = derivedMesh->getFaceDataArray(derivedMesh, CD_MTFACE); */ /* UNUSED */
numOfEdges = derivedMesh->getNumEdges(derivedMesh);
numOfFaces = derivedMesh->getNumFaces(derivedMesh);
@@ -473,7 +472,7 @@ static ParamHandle *construct_param_handle_subsurfed(Scene *scene, EditMesh *edi
}
/* Now we feed the rest of the data from the subsurfed faces */
- texface= subsurfedTexfaces+i;
+ /* texface= subsurfedTexfaces+i; */ /* UNUSED */
/* We will not check for v4 here. Subsurfed mfaces always have 4 vertices. */
key = (ParamKey)face;
@@ -1245,8 +1244,10 @@ void UV_OT_unwrap(wmOperatorType *ot)
"Virtual fill holes in mesh before unwrapping, to better avoid overlaps and preserve symmetry");
RNA_def_boolean(ot->srna, "correct_aspect", 1, "Correct Aspect",
"Map UVs taking image aspect ratio into account");
- RNA_def_boolean(ot->srna, "use_subsurf_data", 0, "Use Subsurf Data", "Map UV's taking vertex position after subsurf into account");
- RNA_def_int(ot->srna, "uv_subsurf_level", 1, 1, 6, "SubSurf Target", "Number of times to subdivide before calculating UV's", 1, 6);
+ RNA_def_boolean(ot->srna, "use_subsurf_data", 0, "Use Subsurf Data",
+ "Map UVs taking vertex position after subsurf into account");
+ RNA_def_int(ot->srna, "uv_subsurf_level", 1, 1, 6, "SubSurf Target",
+ "Number of times to subdivide before calculating UVs", 1, 6);
}
/**************** Project From View operator **************/
diff --git a/source/blender/makesdna/DNA_smoke_types.h b/source/blender/makesdna/DNA_smoke_types.h
index ed764c4f644..753f1374774 100644
--- a/source/blender/makesdna/DNA_smoke_types.h
+++ b/source/blender/makesdna/DNA_smoke_types.h
@@ -138,7 +138,8 @@ typedef struct SmokeFlowSettings {
typedef struct SmokeCollSettings {
struct SmokeModifierData *smd; /* for fast RNA access */
struct BVHTree *bvhtree; /* bounding volume hierarchy for this cloth object */
- struct DerivedMesh *dm;
+
+// struct DerivedMesh *dm; // UNUSED, ifdef'd in code for now.
float *points;
float *points_old;
float *vel;
diff --git a/source/blender/makesrna/intern/rna_cloth.c b/source/blender/makesrna/intern/rna_cloth.c
index 839c67f6297..1327a205c19 100644
--- a/source/blender/makesrna/intern/rna_cloth.c
+++ b/source/blender/makesrna/intern/rna_cloth.c
@@ -292,7 +292,9 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "vel_damping", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "vel_damping");
RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_ui_text(prop, "Velocity Damping", "Damp velocity to help cloth reach the resting position faster. [1.0 = no damping, 0.0 = fully dampened]");
+ RNA_def_property_ui_text(prop, "Velocity Damping",
+ "Damp velocity to help cloth reach the resting position faster "
+ "(1.0 = no damping, 0.0 = fully dampened)");
RNA_def_property_update(prop, 0, "rna_cloth_update");
prop= RNA_def_property(srna, "use_pin_cloth", PROP_BOOLEAN, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 56167fe0dc7..a3712d17938 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -1459,13 +1459,13 @@ static void rna_def_tool_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_uv_sculpt", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "use_uv_sculpt", 1);
- RNA_def_property_ui_text(prop, "UV Sculpt", "Enable brush for uv sculpting");
+ RNA_def_property_ui_text(prop, "UV Sculpt", "Enable brush for UV sculpting");
RNA_def_property_ui_icon(prop, ICON_TPAINT_HLT, 0);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_SpaceImageEditor_uv_sculpt_update");
prop= RNA_def_property(srna, "uv_sculpt_lock_borders", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uv_sculpt_settings", UV_SCULPT_LOCK_BORDERS);
- RNA_def_property_ui_text(prop, "Lock Borders", "Disables editing of boundary edges");
+ RNA_def_property_ui_text(prop, "Lock Borders", "Disable editing of boundary edges");
prop= RNA_def_property(srna, "uv_sculpt_all_islands", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uv_sculpt_settings", UV_SCULPT_ALL_ISLANDS);
@@ -3724,7 +3724,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_simplify_triangulate", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "simplify_flag", R_SIMPLE_NO_TRIANGULATE);
- RNA_def_property_ui_text(prop, "Skip Quad to Triangles", "Disables non-planer quads being triangulated");
+ RNA_def_property_ui_text(prop, "Skip Quad to Triangles", "Disable non-planar quads being triangulated");
/* Scene API */
RNA_api_scene_render(srna);
@@ -3898,7 +3898,7 @@ static void rna_def_selected_uv_element(BlenderRNA *brna)
PropertyRNA *prop;
srna= RNA_def_struct(brna, "SelectedUvElement", "PropertyGroup");
- RNA_def_struct_ui_text(srna, "Selected Uv Element", "");
+ RNA_def_struct_ui_text(srna, "Selected UV Element", "");
/* store the index to the UV element selected */
prop= RNA_def_property(srna, "element_index", PROP_INT, PROP_UNSIGNED);
diff --git a/source/blender/modifiers/intern/MOD_boolean_util.c b/source/blender/modifiers/intern/MOD_boolean_util.c
index 4c17ee54fd2..345cba5d3d1 100644
--- a/source/blender/modifiers/intern/MOD_boolean_util.c
+++ b/source/blender/modifiers/intern/MOD_boolean_util.c
@@ -350,7 +350,7 @@ static DerivedMesh *ConvertCSGDescriptorsToDerivedMesh(
GHash *material_hash = NULL;
Mesh *me1= (Mesh*)ob1->data;
Mesh *me2= (Mesh*)ob2->data;
- int i;
+ int i, *origindex_layer;
// create a new DerivedMesh
result = CDDM_new(vertex_it->num_elements, 0, face_it->num_elements, 0, 0);
@@ -379,6 +379,8 @@ static DerivedMesh *ConvertCSGDescriptorsToDerivedMesh(
*totmat = 0;
}
+ origindex_layer = result->getFaceDataArray(result, CD_ORIGINDEX);
+
// step through the face iterators
for(i = 0; !face_it->Done(face_it->it); i++) {
Mesh *orig_me;
@@ -427,6 +429,9 @@ static DerivedMesh *ConvertCSGDescriptorsToDerivedMesh(
(orig_me == me2)? mapmat: NULL);
test_index_face(mface, &result->faceData, i, csgface.vertex_number);
+
+ if(origindex_layer && orig_ob == ob2)
+ origindex_layer[i] = ORIGINDEX_NONE;
}
if (material_hash)
@@ -523,7 +528,7 @@ static DerivedMesh *NewBooleanDerivedMesh_intern(
CSG_FreeFaceDescriptor(&fd_o);
}
else
- printf("Unknown internal error in boolean");
+ printf("Unknown internal error in boolean\n");
CSG_FreeBooleanOperation(bool_op);
diff --git a/source/blender/python/mathutils/mathutils_Matrix.c b/source/blender/python/mathutils/mathutils_Matrix.c
index 7fe4b5ba5dd..efd73bf8c04 100644
--- a/source/blender/python/mathutils/mathutils_Matrix.c
+++ b/source/blender/python/mathutils/mathutils_Matrix.c
@@ -411,6 +411,34 @@ static void matrix_3x3_as_4x4(float mat[16])
/*-----------------------CLASS-METHODS----------------------------*/
//mat is a 1D array of floats - row[0][0], row[0][1], row[1][0], etc.
+PyDoc_STRVAR(C_Matrix_Identity_doc,
+".. classmethod:: Identity(size)\n"
+"\n"
+" Create an identity matrix.\n"
+"\n"
+" :arg size: The size of the identity matrix to construct [2, 4].\n"
+" :type size: int\n"
+" :return: A new identity matrix.\n"
+" :rtype: :class:`Matrix`\n"
+);
+static PyObject *C_Matrix_Identity(PyObject *cls, PyObject *args)
+{
+ int matSize;
+
+ if (!PyArg_ParseTuple(args, "i:Matrix.Identity", &matSize)) {
+ return NULL;
+ }
+
+ if (matSize < 2 || matSize > 4) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "Matrix.Identity(): "
+ "size must be between 2 and 4");
+ return NULL;
+ }
+
+ return Matrix_CreatePyObject(NULL, matSize, matSize, Py_NEW, (PyTypeObject *)cls);
+}
+
PyDoc_STRVAR(C_Matrix_Rotation_doc,
".. classmethod:: Rotation(angle, size, axis)\n"
"\n"
@@ -2246,6 +2274,7 @@ static struct PyMethodDef Matrix_methods[] = {
{"__copy__", (PyCFunction) Matrix_copy, METH_NOARGS, Matrix_copy_doc},
/* class methods */
+ {"Identity", (PyCFunction) C_Matrix_Identity, METH_VARARGS | METH_CLASS, C_Matrix_Identity_doc},
{"Rotation", (PyCFunction) C_Matrix_Rotation, METH_VARARGS | METH_CLASS, C_Matrix_Rotation_doc},
{"Scale", (PyCFunction) C_Matrix_Scale, METH_VARARGS | METH_CLASS, C_Matrix_Scale_doc},
{"Shear", (PyCFunction) C_Matrix_Shear, METH_VARARGS | METH_CLASS, C_Matrix_Shear_doc},