diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-01-30 01:49:49 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-01-30 01:49:49 +0400 |
commit | 870aa901120fc8db499f9bea3a9a86006ef4cc3a (patch) | |
tree | b39a0a390179ba117310532545ff146dd3bb8dc5 /source | |
parent | de4eeb96946943289ac898525f09fc9c7afd4157 (diff) | |
parent | b820ec4ae4a62a05fc9ac6ca9c93a17128675407 (diff) |
svn merge ^/trunk/blender -r43733:43751
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/BKE_blender.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/BKE_customdata.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/displist.c | 3 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/dynamicpaint.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_constraint.c | 22 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 7 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 2 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_boolean_util.c | 32 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_cloth.c | 7 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 17 |
10 files changed, 64 insertions, 32 deletions
diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h index 02266801935..48f1df2bd73 100644 --- a/source/blender/blenkernel/BKE_blender.h +++ b/source/blender/blenkernel/BKE_blender.h @@ -51,7 +51,7 @@ extern "C" { /* can be left blank, otherwise a,b,c... etc with no quotes */ #define BLENDER_VERSION_CHAR /* alpha/beta/rc/release, docs use this */ -#define BLENDER_VERSION_CYCLE alpha +#define BLENDER_VERSION_CYCLE beta extern char versionstr[]; /* from blender.c */ diff --git a/source/blender/blenkernel/BKE_customdata.h b/source/blender/blenkernel/BKE_customdata.h index 4af19f7b0e7..b69ad4d1b8b 100644 --- a/source/blender/blenkernel/BKE_customdata.h +++ b/source/blender/blenkernel/BKE_customdata.h @@ -71,7 +71,7 @@ extern const CustomDataMask CD_MASK_FACECORNERS; #define CD_DUPLICATE 4 /* do a full copy of all layers, only allowed if source has same number of elements */ -#define CD_TYPE_AS_MASK(_type) (CustomDataMask)(1 << (CustomDataMask)(_type)) +#define CD_TYPE_AS_MASK(_type) (CustomDataMask)((CustomDataMask)1 << (CustomDataMask)(_type)) /* Checks if the layer at physical offset layern (in data->layers) support math * the below operations. diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index 5c945c3a17c..d944d12b0c0 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -835,6 +835,7 @@ static void curve_calc_modifiers_post(Scene *scene, Object *ob, ListBase *dispba int editmode = (!forRender && cu->editnurb); DerivedMesh *dm= NULL, *ndm; float (*vertCos)[3] = NULL; + int useCache = !forRender; if(forRender) required_mode = eModifierMode_Render; else required_mode = eModifierMode_Realtime; @@ -913,7 +914,7 @@ static void curve_calc_modifiers_post(Scene *scene, Object *ob, ListBase *dispba vertCos= NULL; } - ndm = mti->applyModifier(md, ob, dm, forRender, editmode); + ndm = mti->applyModifier(md, ob, dm, forRender, useCache); if (ndm) { /* Modifier returned a new derived mesh */ diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c index 0d0e98b816f..f4e69624839 100644 --- a/source/blender/blenkernel/intern/dynamicpaint.c +++ b/source/blender/blenkernel/intern/dynamicpaint.c @@ -3557,7 +3557,7 @@ static int dynamicPaint_paintParticles(DynamicPaintSurface *surface, /* Proceed only if particle is active */ if(pa->alive == PARS_UNBORN && (part->flag & PART_UNBORN)==0) continue; else if(pa->alive == PARS_DEAD && (part->flag & PART_DIED)==0) continue; - else if(pa->flag & PARS_NO_DISP || pa->flag & PARS_UNEXIST) continue; + else if(pa->flag & PARS_UNEXIST) continue; /* for debug purposes check if any NAN particle proceeds * For some reason they get past activity check, this should rule most of them out */ diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index 3258b8c3dcb..e12f411f81f 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -1026,15 +1026,15 @@ static void rna_def_constraint_action(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem transform_channel_items[] = { - {20, "LOCATION_X", 0, "Location X", ""}, - {21, "LOCATION_Y", 0, "Location Y", ""}, - {22, "LOCATION_Z", 0, "Location Z", ""}, - {00, "ROTATION_X", 0, "Rotation X", ""}, - {01, "ROTATION_Y", 0, "Rotation Y", ""}, - {02, "ROTATION_Z", 0, "Rotation Z", ""}, - {10, "SCALE_X", 0, "Scale X", ""}, - {11, "SCALE_Y", 0, "Scale Y", ""}, - {12, "SCALE_Z", 0, "Scale Z", ""}, + {20, "LOCATION_X", 0, "X Location", ""}, + {21, "LOCATION_Y", 0, "Y Location", ""}, + {22, "LOCATION_Z", 0, "Z Location", ""}, + {00, "ROTATION_X", 0, "X Rotation", ""}, + {01, "ROTATION_Y", 0, "Y Rotation", ""}, + {02, "ROTATION_Z", 0, "Z Rotation", ""}, + {10, "SCALE_X", 0, "Z Scale", ""}, + {11, "SCALE_Y", 0, "Y Scale", ""}, + {12, "SCALE_Z", 0, "Z Scale", ""}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "ActionConstraint", "Constraint"); @@ -2011,12 +2011,12 @@ static void rna_def_constraint_spline_ik(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "chainlen"); RNA_def_property_range(prop, 1, 255); // TODO: this should really check the max length of the chain the constraint is attached to RNA_def_property_ui_text(prop, "Chain Length", "How many bones are included in the chain"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); // XXX: this update goes wrong... needs extra flush? /* direct access to bindings */ // NOTE: only to be used by experienced users prop= RNA_def_property(srna, "joint_bindings", PROP_FLOAT, PROP_FACTOR); - RNA_def_property_array(prop, 32); // XXX this is the maximum value allowed + RNA_def_property_array(prop, 32); // XXX this is the maximum value allowed - why? RNA_def_property_flag(prop, PROP_DYNAMIC); RNA_def_property_dynamic_array_funcs(prop, "rna_SplineIKConstraint_joint_bindings_get_length"); RNA_def_property_float_funcs(prop, "rna_SplineIKConstraint_joint_bindings_get", "rna_SplineIKConstraint_joint_bindings_set", NULL); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 34764c30e97..e2c0a7cfca1 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -3156,18 +3156,21 @@ static void rna_def_scene_render_data(BlenderRNA *brna) prop= RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "xsch"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 4, 10000); RNA_def_property_ui_text(prop, "Resolution X", "Number of horizontal pixels in the rendered image"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneCamera_update"); prop= RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "ysch"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 4, 10000); RNA_def_property_ui_text(prop, "Resolution Y", "Number of vertical pixels in the rendered image"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneCamera_update"); prop= RNA_def_property(srna, "resolution_percentage", PROP_INT, PROP_PERCENTAGE); RNA_def_property_int_sdna(prop, NULL, "size"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 1, SHRT_MAX); RNA_def_property_ui_range(prop, 1, 100, 10, 1); RNA_def_property_ui_text(prop, "Resolution %", "Percentage scale for render resolution"); @@ -3187,12 +3190,14 @@ static void rna_def_scene_render_data(BlenderRNA *brna) prop= RNA_def_property(srna, "pixel_aspect_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "xasp"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 1.0f, 200.0f); RNA_def_property_ui_text(prop, "Pixel Aspect X", "Horizontal aspect ratio - for anamorphic or non-square pixel output"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneCamera_update"); prop= RNA_def_property(srna, "pixel_aspect_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "yasp"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 1.0f, 200.0f); RNA_def_property_ui_text(prop, "Pixel Aspect Y", "Vertical aspect ratio - for anamorphic or non-square pixel output"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneCamera_update"); @@ -3406,6 +3411,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) /* border */ prop= RNA_def_property(srna, "use_border", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", R_BORDER); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Border", "Render a user-defined border region, within the frame size " "(note that this disables save_buffers and full_sample)"); @@ -3437,6 +3443,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) prop= RNA_def_property(srna, "use_crop_to_border", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", R_CROP); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Crop to Border", "Crop the rendered frame to the defined border size"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 571fe05238d..799366a5234 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -2902,7 +2902,7 @@ static void rna_def_space_clip(BlenderRNA *brna) /* lock to time cursor */ prop= RNA_def_property(srna, "lock_time_cursor", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_ui_text(prop, "Lock to Time Cursor", "Lock curves view to time cursos during playback and tracking"); + RNA_def_property_ui_text(prop, "Lock to Time Cursor", "Lock curves view to time cursor during playback and tracking"); RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_LOCK_TIMECURSOR); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL); diff --git a/source/blender/modifiers/intern/MOD_boolean_util.c b/source/blender/modifiers/intern/MOD_boolean_util.c index 1f2c65e4cca..510179c01d7 100644 --- a/source/blender/modifiers/intern/MOD_boolean_util.c +++ b/source/blender/modifiers/intern/MOD_boolean_util.c @@ -374,10 +374,10 @@ static DerivedMesh *ConvertCSGDescriptorsToDerivedMesh( } // a hash table to remap materials to indices - if (mat) { - material_hash = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "CSG_mat gh"); + material_hash = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "CSG_mat gh"); + + if (mat) *totmat = 0; - } origindex_layer = result->getTessFaceDataArray(result, CD_ORIGINDEX); @@ -422,6 +422,32 @@ static DerivedMesh *ConvertCSGDescriptorsToDerivedMesh( else mface->mat_nr = GET_INT_FROM_POINTER(BLI_ghash_lookup(material_hash, orig_mat)); } + else if(orig_mat) { + if(orig_ob == ob1) { + // No need to change materian index for faces from left operand + } + else { + // for faces from right operand checn if there's needed material in left operand and if it is, + // use index of that material, otherwise fallback to first material (material with index=0) + if (!BLI_ghash_haskey(material_hash, orig_mat)) { + int a; + + mat_nr = 0; + for(a = 0; a < ob1->totcol; a++) { + if(give_current_material(ob1, a+1) == orig_mat) { + mat_nr = a; + break; + } + } + + BLI_ghash_insert(material_hash, orig_mat, SET_INT_IN_POINTER(mat_nr)); + + mface->mat_nr = mat_nr; + } + else + mface->mat_nr = GET_INT_FROM_POINTER(BLI_ghash_lookup(material_hash, orig_mat)); + } + } else mface->mat_nr = 0; diff --git a/source/blender/modifiers/intern/MOD_cloth.c b/source/blender/modifiers/intern/MOD_cloth.c index 7e46d3f0fe3..f626a2f86fe 100644 --- a/source/blender/modifiers/intern/MOD_cloth.c +++ b/source/blender/modifiers/intern/MOD_cloth.c @@ -84,6 +84,10 @@ static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, } dm = get_dm(ob, NULL, derivedData, NULL, 0); + if(dm == derivedData) + dm = CDDM_copy(dm, 0); + + CDDM_apply_vert_coords(dm, vertexCos); clothModifier_do(clmd, md->scene, ob, dm, vertexCos); @@ -92,8 +96,7 @@ static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, result->release(result); } - if(dm != derivedData) - dm->release(dm); + dm->release(dm); } static void updateDepgraph( diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index faf2d3fd352..4052c221935 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1277,22 +1277,17 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar #ifdef WITH_BUILDINFO int ver_width, rev_width; - char *version_str = NULL; - char *revision_str = NULL; char version_buf[128]; char revision_buf[128]; extern char build_rev[]; - version_str = &version_buf[0]; - revision_str = &revision_buf[0]; - - BLI_snprintf(version_str, sizeof(version_str), + BLI_snprintf(version_buf, sizeof(version_buf), "%d.%02d.%d", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION); - BLI_snprintf(revision_str, sizeof(revision_str), "r%s", build_rev); + BLI_snprintf(revision_buf, sizeof(revision_buf), "r%s", build_rev); BLF_size(style->widgetlabel.uifont_id, style->widgetlabel.points, U.dpi); - ver_width = (int)BLF_width(style->widgetlabel.uifont_id, version_str) + 5; - rev_width = (int)BLF_width(style->widgetlabel.uifont_id, revision_str) + 5; + ver_width = (int)BLF_width(style->widgetlabel.uifont_id, version_buf) + 5; + rev_width = (int)BLF_width(style->widgetlabel.uifont_id, revision_buf) + 5; #endif //WITH_BUILDINFO block= uiBeginBlock(C, ar, "_popup", UI_EMBOSS); @@ -1303,8 +1298,8 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar uiBlockSetFunc(block, wm_block_splash_refreshmenu, block, NULL); #ifdef WITH_BUILDINFO - uiDefBut(block, LABEL, 0, version_str, 494-ver_width, 282-24, ver_width, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL); - uiDefBut(block, LABEL, 0, revision_str, 494-rev_width, 282-36, rev_width, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL); + uiDefBut(block, LABEL, 0, version_buf, 494-ver_width, 282-24, ver_width, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL); + uiDefBut(block, LABEL, 0, revision_buf, 494-rev_width, 282-36, rev_width, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL); #endif //WITH_BUILDINFO layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 10, 2, 480, 110, style); |