From f4eb0f507f96eedae9f110aaaf46b5ef4ab40b6b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 4 Dec 2011 17:24:34 +0000 Subject: [PATCH 01/14] `#if 0` use of Object.nlastrips, there is no way to add or remove these from blender so better not run. --- source/blender/blenkernel/BKE_effect.h | 5 --- source/blender/blenkernel/intern/armature.c | 9 +++- source/blender/blenkernel/intern/effect.c | 37 ----------------- source/blender/blenkernel/intern/group.c | 22 ++++++---- source/blender/blenkernel/intern/library.c | 18 ++++---- source/blender/blenloader/intern/readfile.c | 46 ++++++++++++++++++--- 6 files changed, 72 insertions(+), 65 deletions(-) diff --git a/source/blender/blenkernel/BKE_effect.h b/source/blender/blenkernel/BKE_effect.h index 7f4e809718c..3ebd57dde39 100644 --- a/source/blender/blenkernel/BKE_effect.h +++ b/source/blender/blenkernel/BKE_effect.h @@ -109,15 +109,10 @@ typedef struct EffectorCache { int flag; } EffectorCache; -void free_effect(struct Effect *eff); -void free_effects(struct ListBase *lb); struct Effect *copy_effect(struct Effect *eff); void copy_effects(struct ListBase *lbn, struct ListBase *lb); void deselectall_eff(struct Object *ob); -struct PartEff *give_parteff(struct Object *ob); - - void free_partdeflect(struct PartDeflect *pd); struct ListBase *pdInitEffectors(struct Scene *scene, struct Object *ob_src, struct ParticleSystem *psys_src, struct EffectorWeights *weights); void pdEndEffectors(struct ListBase **effectors); diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index 2157bd5999b..68d2cf940af 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -2120,6 +2120,8 @@ void pchan_calc_mat(bPoseChannel *pchan) pchan_to_mat4(pchan, pchan->chan_mat); } +#if 0 /* XXX OLD ANIMSYS, NLASTRIPS ARE NO LONGER USED */ + /* NLA strip modifiers */ static void do_strip_modifiers(Scene *scene, Object *armob, Bone *bone, bPoseChannel *pchan) { @@ -2242,6 +2244,8 @@ static void do_strip_modifiers(Scene *scene, Object *armob, Bone *bone, bPoseCha } } +#endif + /* calculate tail of posechannel */ void where_is_pose_bone_tail(bPoseChannel *pchan) { @@ -2351,9 +2355,12 @@ void where_is_pose_bone(Scene *scene, Object *ob, bPoseChannel *pchan, float cti } if(do_extra) { + +#if 0 /* XXX OLD ANIMSYS, NLASTRIPS ARE NO LONGER USED */ /* do NLA strip modifiers - i.e. curve follow */ do_strip_modifiers(scene, ob, bone, pchan); - +#endif + /* Do constraints */ if (pchan->constraints.first) { bConstraintOb *cob; diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c index 7b58c0bc00b..dcb8533d7a1 100644 --- a/source/blender/blenkernel/intern/effect.c +++ b/source/blender/blenkernel/intern/effect.c @@ -154,43 +154,6 @@ typedef struct VeNoCo { /* ***************** PARTICLES ***************** */ -/* deprecated, only keep this for readfile.c */ -PartEff *give_parteff(Object *ob) -{ - PartEff *paf; - - paf= ob->effect.first; - while(paf) { - if(paf->type==EFF_PARTICLE) return paf; - paf= paf->next; - } - return NULL; -} - -void free_effect(Effect *eff) -{ - PartEff *paf; - - if(eff->type==EFF_PARTICLE) { - paf= (PartEff *)eff; - if(paf->keys) MEM_freeN(paf->keys); - } - MEM_freeN(eff); -} - - -void free_effects(ListBase *lb) -{ - Effect *eff; - - eff= lb->first; - while(eff) { - BLI_remlink(lb, eff); - free_effect(eff); - eff= lb->first; - } -} - /* -------------------------- Effectors ------------------ */ void free_partdeflect(PartDeflect *pd) { diff --git a/source/blender/blenkernel/intern/group.c b/source/blender/blenkernel/intern/group.c index d0f09857781..7ac395212ab 100644 --- a/source/blender/blenkernel/intern/group.c +++ b/source/blender/blenkernel/intern/group.c @@ -108,16 +108,19 @@ void unlink_group(Group *group) } for(ob= bmain->object.first; ob; ob= ob->id.next) { - bActionStrip *strip; if(ob->dup_group==group) { ob->dup_group= NULL; - - /* duplicator strips use a group object, we remove it */ - for(strip= ob->nlastrips.first; strip; strip= strip->next) { - if(strip->object) - strip->object= NULL; +#if 0 /* XXX OLD ANIMSYS, NLASTRIPS ARE NO LONGER USED */ + { + bActionStrip *strip; + /* duplicator strips use a group object, we remove it */ + for(strip= ob->nlastrips.first; strip; strip= strip->next) { + if(strip->object) + strip->object= NULL; + } } +#endif } for(psys=ob->particlesystem.first; psys; psys=psys->next){ @@ -275,13 +278,14 @@ void group_tag_recalc(Group *group) } } -int group_is_animated(Object *parent, Group *group) +int group_is_animated(Object *UNUSED(parent), Group *group) { GroupObject *go; - - // XXX: old animsys depreceated... + +#if 0 /* XXX OLD ANIMSYS, NLASTRIPS ARE NO LONGER USED */ if(parent->nlastrips.first) return 1; +#endif for(go= group->gobject.first; go; go= go->next) if(go->ob && go->ob->proxy) diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 7a4780eb984..cb1c7dbec5c 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -1319,19 +1319,23 @@ static void lib_indirect_test_id(ID *id, Library *lib) if(GS(id->name)==ID_OB) { Object *ob= (Object *)id; - bActionStrip *strip; Mesh *me; int a; - + +#if 0 /* XXX OLD ANIMSYS, NLASTRIPS ARE NO LONGER USED */ // XXX old animation system! -------------------------------------- - for (strip=ob->nlastrips.first; strip; strip=strip->next){ - LIBTAG(strip->object); - LIBTAG(strip->act); - LIBTAG(strip->ipo); + { + bActionStrip *strip; + for (strip=ob->nlastrips.first; strip; strip=strip->next){ + LIBTAG(strip->object); + LIBTAG(strip->act); + LIBTAG(strip->ipo); + } } // XXX: new animation system needs something like this? - +#endif + for(a=0; atotcol; a++) { LIBTAG(ob->mat[a]); } diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index c72bc17cc1c..b5baeab5d5f 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -109,7 +109,7 @@ #include "BKE_context.h" #include "BKE_curve.h" #include "BKE_deform.h" -#include "BKE_effect.h" /* give_parteff */ +#include "BKE_effect.h" #include "BKE_fcurve.h" #include "BKE_global.h" // for G #include "BKE_group.h" @@ -7084,6 +7084,40 @@ static void do_versions_gpencil_2_50(Main *main, bScreen *screen) } } +/* deprecated, only keep this for readfile.c */ +static PartEff *do_version_give_parteff_245(Object *ob) +{ + PartEff *paf; + + paf= ob->effect.first; + while(paf) { + if(paf->type==EFF_PARTICLE) return paf; + paf= paf->next; + } + return NULL; +} +static void do_version_free_effect_245(Effect *eff) +{ + PartEff *paf; + + if(eff->type==EFF_PARTICLE) { + paf= (PartEff *)eff; + if(paf->keys) MEM_freeN(paf->keys); + } + MEM_freeN(eff); +} +static void do_version_free_effects_245(ListBase *lb) +{ + Effect *eff; + + eff= lb->first; + while(eff) { + BLI_remlink(lb, eff); + do_version_free_effect_245(eff); + eff= lb->first; + } +} + static void do_version_mtex_factor_2_50(MTex **mtex_array, short idtype) { MTex *mtex; @@ -7659,7 +7693,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) Object *ob = main->object.first; PartEff *paf; while (ob) { - paf = give_parteff(ob); + paf = do_version_give_parteff_245(ob); if (paf) { if (paf->staticstep == 0) { paf->staticstep= 5; @@ -8868,7 +8902,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } - paf = give_parteff(ob); + paf = do_version_give_parteff_245(ob); if (paf) { if(paf->disp == 0) paf->disp = 100; @@ -9876,7 +9910,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } /* convert old particles to new system */ - if((paf = give_parteff(ob))) { + if((paf = do_version_give_parteff_245(ob))) { ParticleSystem *psys; ModifierData *md; ParticleSystemModifierData *psmd; @@ -9989,7 +10023,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) part->type = PART_FLUID; } - free_effects(&ob->effect); + do_version_free_effects_245(&ob->effect); printf("Old particle system converted to new system.\n"); } @@ -13444,7 +13478,7 @@ static void expand_object(FileData *fd, Main *mainvar, Object *ob) expand_doit(fd, mainvar, ob->mat[a]); } - paf = give_parteff(ob); + paf = do_version_give_parteff_245(ob); if (paf && paf->group) expand_doit(fd, mainvar, paf->group); From 143b7ec10a60f9a162124ef3f4e51b5b179648d4 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 4 Dec 2011 17:35:17 +0000 Subject: [PATCH 02/14] remove unused SpaceTime.redraws. now there are no more use of deprecated struct member warnings. --- source/blender/blenloader/intern/readfile.c | 5 ----- source/blender/editors/space_time/space_time.c | 1 - source/blender/makesdna/DNA_space_types.h | 14 +++++--------- 3 files changed, 5 insertions(+), 15 deletions(-) diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index b5baeab5d5f..1759fa67569 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -8709,11 +8709,6 @@ static void do_versions(FileData *fd, Library *lib, Main *main) View3D *v3d= (View3D *)sl; if(v3d->twtype==0) v3d->twtype= V3D_MANIP_TRANSLATE; } - else if(sl->spacetype==SPACE_TIME) { - SpaceTime *stime= (SpaceTime *)sl; - if(stime->redraws==0) - stime->redraws= TIME_ALL_3D_WIN|TIME_ALL_ANIM_WIN; - } } } } diff --git a/source/blender/editors/space_time/space_time.c b/source/blender/editors/space_time/space_time.c index b3baccde5c9..65ef3273e30 100644 --- a/source/blender/editors/space_time/space_time.c +++ b/source/blender/editors/space_time/space_time.c @@ -580,7 +580,6 @@ static SpaceLink *time_new(const bContext *C) stime= MEM_callocN(sizeof(SpaceTime), "inittime"); stime->spacetype= SPACE_TIME; - stime->redraws= TIME_ALL_3D_WIN|TIME_ALL_ANIM_WIN; // XXX: depreceated stime->flag |= TIME_DRAWFRAMES; /* header */ diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 649b849ea5e..6bcea71b5e9 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -376,14 +376,11 @@ typedef struct SpaceTime { float blockscale DNA_DEPRECATED; View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */ - - ListBase caches; - int cache_display, pad; - - int flag; - int redraws DNA_DEPRECATED; /* redraws is deprecated... moved to screen */ - + ListBase caches; + + int cache_display; + int flag; } SpaceTime; typedef struct SpaceNode { @@ -397,9 +394,8 @@ typedef struct SpaceNode { View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */ struct ID *id, *from; /* context, no need to save in file? well... pinning... */ - short flag, menunr; /* menunr: browse id block in header */ + short flag, pad1; /* menunr: browse id block in header */ float aspect; - void *curfont; float xof, yof; /* offset for drawing the backdrop */ float zoom, padf; /* zoom for backdrop */ From 937c5494c4933c65635450e66aeacffed74939f2 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Sun, 4 Dec 2011 17:36:13 +0000 Subject: [PATCH 03/14] A (hopefully last) bunch of fixes and tweaks to UI label and messages (found while translating in french). --- source/blender/editors/mesh/mesh_data.c | 2 +- source/blender/editors/space_clip/clip_ops.c | 2 +- source/blender/makesrna/intern/rna_brush.c | 2 +- source/blender/makesrna/intern/rna_lamp.c | 6 +-- source/blender/makesrna/intern/rna_material.c | 4 +- source/blender/makesrna/intern/rna_particle.c | 18 +++---- .../makesrna/intern/rna_sculpt_paint.c | 4 +- source/blender/makesrna/intern/rna_sensor.c | 52 +++++++++---------- .../blender/makesrna/intern/rna_sequencer.c | 4 +- 9 files changed, 47 insertions(+), 47 deletions(-) diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c index aa94b48c1e9..7253d426ca6 100644 --- a/source/blender/editors/mesh/mesh_data.c +++ b/source/blender/editors/mesh/mesh_data.c @@ -418,7 +418,7 @@ void MESH_OT_drop_named_image(wmOperatorType *ot) { /* identifiers */ ot->name= "Assign Image to UV Map"; - ot->description= "Assigns Image to active UV Map, or creates a UV Map"; + ot->description= "Assign Image to active UV Map, or create an UV Map"; ot->idname= "MESH_OT_drop_named_image"; /* api callbacks */ diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c index 7b1dbc82e82..491014357e4 100644 --- a/source/blender/editors/space_clip/clip_ops.c +++ b/source/blender/editors/space_clip/clip_ops.c @@ -929,7 +929,7 @@ void CLIP_OT_rebuild_proxy(wmOperatorType *ot) /* identifiers */ ot->name= "Rebuild Proxy and Timecode Indices"; ot->idname= "CLIP_OT_rebuild_proxy"; - ot->description= "Rebuild all selected proxies and timecode indeces in the background"; + ot->description= "Rebuild all selected proxies and timecode indices in the background"; /* api callbacks */ ot->exec= clip_rebuild_proxy_exec; diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index 60658e98c8d..4fb672fd203 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -336,7 +336,7 @@ static void rna_def_brush_texture_slot(BlenderRNA *brna) prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "rot"); RNA_def_property_range(prop, 0, M_PI*2); - RNA_def_property_ui_text(prop, "Angle", "Defines brush texture rotation"); + RNA_def_property_ui_text(prop, "Angle", "Brush texture rotation"); RNA_def_property_update(prop, 0, "rna_TextureSlot_update"); prop= RNA_def_property(srna, "map_mode", PROP_ENUM, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_lamp.c b/source/blender/makesrna/intern/rna_lamp.c index c783fc2238c..7de2d550875 100644 --- a/source/blender/makesrna/intern/rna_lamp.c +++ b/source/blender/makesrna/intern/rna_lamp.c @@ -172,9 +172,9 @@ static void rna_def_lamp_mtex(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_texture_coordinates_items[] = { - {TEXCO_GLOB, "GLOBAL", 0, "Global", "Uses global coordinates for the texture coordinates"}, - {TEXCO_VIEW, "VIEW", 0, "View", "Uses view coordinates for the texture coordinates"}, - {TEXCO_OBJECT, "OBJECT", 0, "Object", "Uses linked object's coordinates for texture coordinates"}, + {TEXCO_GLOB, "GLOBAL", 0, "Global", "Use global coordinates for the texture coordinates"}, + {TEXCO_VIEW, "VIEW", 0, "View", "Use view coordinates for the texture coordinates"}, + {TEXCO_OBJECT, "OBJECT", 0, "Object", "Use linked object's coordinates for texture coordinates"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "LampTextureSlot", "TextureSlot"); diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index 6400946d582..35c720b5069 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -480,12 +480,12 @@ static void rna_def_material_mtex(BlenderRNA *brna) prop= RNA_def_property(srna, "use_map_diffuse", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_REF); - RNA_def_property_ui_text(prop, "Diffuse", "The texture to affects the value of the materials diffuse reflectivity"); + RNA_def_property_ui_text(prop, "Diffuse", "The texture affects the value of diffuse reflectivity"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "use_map_specular", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_SPEC); - RNA_def_property_ui_text(prop, "Specular", "The texture to affects the value of specular reflectivity"); + RNA_def_property_ui_text(prop, "Specular", "The texture affects the value of specular reflectivity"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "use_map_ambient", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index fb6e837365d..2c71fffb5b5 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -1233,18 +1233,18 @@ static void rna_def_particle_settings_mtex(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem texco_items[] = { - {TEXCO_GLOB, "GLOBAL", 0, "Global", "Uses global coordinates for the texture coordinates"}, - {TEXCO_OBJECT, "OBJECT", 0, "Object", "Uses linked object's coordinates for texture coordinates"}, - {TEXCO_UV, "UV", 0, "UV", "Uses UV coordinates for texture coordinates"}, - {TEXCO_ORCO, "ORCO", 0, "Generated", "Uses the original undeformed coordinates of the object"}, - {TEXCO_STRAND, "STRAND", 0, "Strand / Particle", "Uses normalized strand texture coordinate (1D) or particle age (X) and trail position (Y)"}, + {TEXCO_GLOB, "GLOBAL", 0, "Global", "Use global coordinates for the texture coordinates"}, + {TEXCO_OBJECT, "OBJECT", 0, "Object", "Use linked object's coordinates for texture coordinates"}, + {TEXCO_UV, "UV", 0, "UV", "Use UV coordinates for texture coordinates"}, + {TEXCO_ORCO, "ORCO", 0, "Generated", "Use the original undeformed coordinates of the object"}, + {TEXCO_STRAND, "STRAND", 0, "Strand / Particle", "Use normalized strand texture coordinate (1D) or particle age (X) and trail position (Y)"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_mapping_items[] = { - {MTEX_FLAT, "FLAT", 0, "Flat", "Maps X and Y coordinates directly"}, - {MTEX_CUBE, "CUBE", 0, "Cube", "Maps using the normal vector"}, - {MTEX_TUBE, "TUBE", 0, "Tube", "Maps with Z as central axis"}, - {MTEX_SPHERE, "SPHERE", 0, "Sphere", "Maps with Z as central axis"}, + {MTEX_FLAT, "FLAT", 0, "Flat", "Map X and Y coordinates directly"}, + {MTEX_CUBE, "CUBE", 0, "Cube", "Map using the normal vector"}, + {MTEX_TUBE, "TUBE", 0, "Tube", "Map with Z as central axis"}, + {MTEX_SPHERE, "SPHERE", 0, "Sphere", "Map with Z as central axis"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_x_mapping_items[] = { diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c index d0a50ba6bad..a15ca5de5c1 100644 --- a/source/blender/makesrna/intern/rna_sculpt_paint.c +++ b/source/blender/makesrna/intern/rna_sculpt_paint.c @@ -304,7 +304,7 @@ static void rna_def_vertex_paint(BlenderRNA *brna) prop= RNA_def_property(srna, "use_normal", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_NORMALS); - RNA_def_property_ui_text(prop, "Normals", "Applies the vertex normal before painting"); + RNA_def_property_ui_text(prop, "Normals", "Apply the vertex normal before painting"); prop= RNA_def_property(srna, "use_spray", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_SPRAY); @@ -348,7 +348,7 @@ static void rna_def_image_paint(BlenderRNA *brna) prop= RNA_def_property(srna, "use_clone_layer", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_LAYER_CLONE); RNA_def_property_ui_text(prop, "Clone Map", - "Use another UV map as clone source, otherwise use 3D the cursor as the source"); + "Use another UV map as clone source, otherwise use the 3D cursor as the source"); /* integers */ diff --git a/source/blender/makesrna/intern/rna_sensor.c b/source/blender/makesrna/intern/rna_sensor.c index ba58a66a2d6..6459c145a3a 100644 --- a/source/blender/makesrna/intern/rna_sensor.c +++ b/source/blender/makesrna/intern/rna_sensor.c @@ -387,7 +387,7 @@ static void rna_def_mouse_sensor(BlenderRNA *brna) prop= RNA_def_property(srna, "mouse_event", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, mouse_event_items); - RNA_def_property_ui_text(prop, "Mouse Event", "Specify the type of event this mouse sensor should trigger on"); + RNA_def_property_ui_text(prop, "Mouse Event", "Type of event this mouse sensor should trigger on"); RNA_def_property_update(prop, NC_LOGIC, NULL); } @@ -442,7 +442,7 @@ static void rna_def_keyboard_sensor(BlenderRNA *brna) prop= RNA_def_property(srna, "target", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "targetName"); - RNA_def_property_ui_text(prop, "Target", "Property that receive the keystrokes in case a string is logged"); + RNA_def_property_ui_text(prop, "Target", "Property that receives the keystrokes in case a string is logged"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "log", PROP_STRING, PROP_NONE); @@ -490,12 +490,12 @@ static void rna_def_property_sensor(BlenderRNA *brna) prop= RNA_def_property(srna, "value_min", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "value"); - RNA_def_property_ui_text(prop, "Minimum Value", "Specify minimum value in Interval type"); + RNA_def_property_ui_text(prop, "Minimum Value", "Minimum value in Interval type"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "value_max", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "maxvalue"); - RNA_def_property_ui_text(prop, "Maximum Value", "Specify maximum value in Interval type"); + RNA_def_property_ui_text(prop, "Maximum Value", "Maximum value in Interval type"); RNA_def_property_update(prop, NC_LOGIC, NULL); } @@ -533,7 +533,7 @@ static void rna_def_armature_sensor(BlenderRNA *brna) prop= RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "value"); - RNA_def_property_ui_text(prop, "Compare Value", "Specify value to be used in comparison"); + RNA_def_property_ui_text(prop, "Compare Value", "Value to be used in comparison"); RNA_def_property_update(prop, NC_LOGIC, NULL); } @@ -574,7 +574,7 @@ static void rna_def_delay_sensor(BlenderRNA *brna) prop= RNA_def_property(srna, "use_repeat", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SENS_DELAY_REPEAT); - RNA_def_property_ui_text(prop, "Repeat", "Toggle repeat option. If selected, the sensor restarts after Delay+Dur logic tics"); + RNA_def_property_ui_text(prop, "Repeat", "Toggle repeat option (if selected, the sensor restarts after Delay+Duration logic tics)"); RNA_def_property_update(prop, NC_LOGIC, NULL); } @@ -589,7 +589,7 @@ static void rna_def_collision_sensor(BlenderRNA *brna) prop= RNA_def_property(srna, "use_pulse", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", SENS_COLLISION_PULSE); - RNA_def_property_ui_text(prop, "Pulse", "Changes to the set of colliding objects generates pulse"); + RNA_def_property_ui_text(prop, "Pulse", "Change to the set of colliding objects generates pulse"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "use_material", PROP_BOOLEAN, PROP_NONE); @@ -599,13 +599,13 @@ static void rna_def_collision_sensor(BlenderRNA *brna) prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "name"); - RNA_def_property_ui_text(prop, "Property", "Only look for Objects with this property (blank = all objects)"); + RNA_def_property_ui_text(prop, "Property", "Only look for objects with this property (blank = all objects)"); RNA_def_property_update(prop, NC_LOGIC, NULL); //XXX to make a setFunction to create a lookup with all materials in Blend File (not only this object mat.) prop= RNA_def_property(srna, "material", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "materialName"); - RNA_def_property_ui_text(prop, "Material", "Only look for Objects with this material (blank = all objects)"); + RNA_def_property_ui_text(prop, "Material", "Only look for objects with this material (blank = all objects)"); RNA_def_property_update(prop, NC_LOGIC, NULL); /*//XXX either use a datablock look up to store the string name (material) @@ -614,7 +614,7 @@ static void rna_def_collision_sensor(BlenderRNA *brna) RNA_def_property_struct_type(prop, "Material"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_pointer_sdna(prop, NULL, "ma"); - RNA_def_property_ui_text(prop, "Material", "Only look for Objects with this material (blank = all objects)"); + RNA_def_property_ui_text(prop, "Material", "Only look for objects with this material (blank = all objects)"); */ } @@ -637,12 +637,12 @@ static void rna_def_radar_sensor(BlenderRNA *brna) prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "name"); - RNA_def_property_ui_text(prop, "Property", "Only look for Objects with this property (blank = all objects)"); + RNA_def_property_ui_text(prop, "Property", "Only look for objects with this property (blank = all objects)"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, axis_items); - RNA_def_property_ui_text(prop, "Axis", "Specify along which axis the radar cone is cast"); + RNA_def_property_ui_text(prop, "Axis", "Along which axis the radar cone is cast"); RNA_def_property_update(prop, NC_LOGIC, NULL); //XXX TODO - use radians internally then change to PROP_ANGLE @@ -669,7 +669,7 @@ static void rna_def_random_sensor(BlenderRNA *brna) prop= RNA_def_property(srna, "seed", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 0, 1000); - RNA_def_property_ui_text(prop, "Seed", "Initial seed of the generator. (Choose 0 for not random)"); + RNA_def_property_ui_text(prop, "Seed", "Initial seed of the generator (choose 0 for not random)"); RNA_def_property_update(prop, NC_LOGIC, NULL); } @@ -703,12 +703,12 @@ static void rna_def_ray_sensor(BlenderRNA *brna) prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "propname"); - RNA_def_property_ui_text(prop, "Property", "Only look for Objects with this property (blank = all objects)"); + RNA_def_property_ui_text(prop, "Property", "Only look for objects with this property (blank = all objects)"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "material", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "matname"); - RNA_def_property_ui_text(prop, "Material", "Only look for Objects with this material (blank = all objects)"); + RNA_def_property_ui_text(prop, "Material", "Only look for objects with this material (blank = all objects)"); RNA_def_property_update(prop, NC_LOGIC, NULL); /* //XXX either use a datablock look up to store the string name (material) @@ -717,7 +717,7 @@ static void rna_def_ray_sensor(BlenderRNA *brna) RNA_def_property_struct_type(prop, "Material"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_pointer_sdna(prop, NULL, "ma"); - RNA_def_property_ui_text(prop, "Material", "Only look for Objects with this material (blank = all objects)"); + RNA_def_property_ui_text(prop, "Material", "Only look for objects with this material (blank = all objects)"); */ prop= RNA_def_property(srna, "use_x_ray", PROP_BOOLEAN, PROP_NONE); @@ -733,7 +733,7 @@ static void rna_def_ray_sensor(BlenderRNA *brna) prop= RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "axisflag"); RNA_def_property_enum_items(prop, axis_items); - RNA_def_property_ui_text(prop, "Axis", "Specify along which axis the ray is cast"); + RNA_def_property_ui_text(prop, "Axis", "Along which axis the ray is cast"); RNA_def_property_update(prop, NC_LOGIC, NULL); } @@ -747,7 +747,7 @@ static void rna_def_message_sensor(BlenderRNA *brna) RNA_def_struct_sdna_from(srna, "bMessageSensor", "data"); prop= RNA_def_property(srna, "subject", PROP_STRING, PROP_NONE); - RNA_def_property_ui_text(prop, "Subject", "Optional subject filter: only accept messages with this subject, or empty for all"); + RNA_def_property_ui_text(prop, "Subject", "Optional subject filter: only accept messages with this subject, or empty to accept all"); RNA_def_property_update(prop, NC_LOGIC, NULL); } @@ -788,7 +788,7 @@ static void rna_def_joystick_sensor(BlenderRNA *brna) prop= RNA_def_property(srna, "joystick_index", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "joyindex"); - RNA_def_property_ui_text(prop, "Index", "Specify which joystick to use"); + RNA_def_property_ui_text(prop, "Index", "Which joystick to use"); RNA_def_property_range(prop, 0, SENS_JOY_MAXINDEX-1); RNA_def_property_update(prop, NC_LOGIC, NULL); @@ -800,26 +800,26 @@ static void rna_def_joystick_sensor(BlenderRNA *brna) prop= RNA_def_property(srna, "use_all_events", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SENS_JOY_ANY_EVENT); - RNA_def_property_ui_text(prop, "All Events", "Triggered by all events on this joysticks current type (axis/button/hat)"); + RNA_def_property_ui_text(prop, "All Events", "Triggered by all events on this joystick's current type (axis/button/hat)"); RNA_def_property_update(prop, NC_LOGIC, NULL); /* Button */ prop= RNA_def_property(srna, "button_number", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "button"); - RNA_def_property_ui_text(prop, "Button Number", "Specify which button to use"); + RNA_def_property_ui_text(prop, "Button Number", "Which button to use"); RNA_def_property_range(prop, 0, 18); RNA_def_property_update(prop, NC_LOGIC, NULL); /* Axis */ prop= RNA_def_property(srna, "axis_number", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "axis"); - RNA_def_property_ui_text(prop, "Axis Number", "Specify which axis pair to use, 1 is usually the main direction input"); + RNA_def_property_ui_text(prop, "Axis Number", "Which axis pair to use, 1 is usually the main direction input"); RNA_def_property_range(prop, 1, 8); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "axis_threshold", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "precision"); - RNA_def_property_ui_text(prop, "Axis Threshold", "Specify the precision of the axis"); + RNA_def_property_ui_text(prop, "Axis Threshold", "Precision of the axis"); RNA_def_property_range(prop, 0, 32768); RNA_def_property_update(prop, NC_LOGIC, NULL); @@ -832,21 +832,21 @@ static void rna_def_joystick_sensor(BlenderRNA *brna) /* Single Axis */ prop= RNA_def_property(srna, "single_axis_number", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "axis_single"); - RNA_def_property_ui_text(prop, "Axis Number", "Specify a single axis (verticle/horizontal/other) to detect"); + RNA_def_property_ui_text(prop, "Axis Number", "Single axis (vertical/horizontal/other) to detect"); RNA_def_property_range(prop, 1, 16); RNA_def_property_update(prop, NC_LOGIC, NULL); /* Hat */ prop= RNA_def_property(srna, "hat_number", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "hat"); - RNA_def_property_ui_text(prop, "Hat Number", "Specify which hat to use"); + RNA_def_property_ui_text(prop, "Hat Number", "Which hat to use"); RNA_def_property_range(prop, 1, 2); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "hat_direction", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "hatf"); RNA_def_property_enum_items(prop, hat_direction_items); - RNA_def_property_ui_text(prop, "Hat Direction", "Specify hat direction"); + RNA_def_property_ui_text(prop, "Hat Direction", "Hat direction"); RNA_def_property_update(prop, NC_LOGIC, NULL); } diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index 4db23443895..64adac7dd5e 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -1618,7 +1618,7 @@ static void rna_def_glow(BlenderRNA *brna) prop= RNA_def_property(srna, "clamp", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "fClamp"); RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_ui_text(prop, "Clamp", "rightness limit of intensity"); + RNA_def_property_ui_text(prop, "Clamp", "Brightness limit of intensity"); RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); prop= RNA_def_property(srna, "boost_factor", PROP_FLOAT, PROP_NONE); @@ -1722,7 +1722,7 @@ static void rna_def_solid_color(BlenderRNA *brna) PropertyRNA *prop; srna = RNA_def_struct(brna, "ColorSequence", "EffectSequence"); - RNA_def_struct_ui_text(srna, "Color Sequence", "Sequence strip creating an image filled with a single g"); + RNA_def_struct_ui_text(srna, "Color Sequence", "Sequence strip creating an image filled with a single color"); RNA_def_struct_sdna_from(srna, "SolidColorVars", "effectdata"); prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR); From 229dd30f37d222845f2902148d50070dcc12246d Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Sun, 4 Dec 2011 18:49:41 +0000 Subject: [PATCH 04/14] Slight optimization of track preview widget (the same approach as in tomato branch) --- source/blender/editors/interface/interface_draw.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index da94fd9237a..f3a99ecf6b8 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -1475,14 +1475,18 @@ static ImBuf *scale_trackpreview_ibuf(ImBuf *ibuf, float zoomx, float zoomy) { ImBuf *scaleibuf; int x, y, w= ibuf->x*zoomx, h= ibuf->y*zoomy; + const float scalex= 1.0f/zoomx; + const float scaley= 1.0f/zoomy; + scaleibuf= IMB_allocImBuf(w, h, 32, IB_rect); for(y= 0; yy; y++) { for (x= 0; xx; x++) { int pixel= scaleibuf->x*y + x; - int orig_pixel= ibuf->x*(int)(((float)y)/zoomy) + (int)(((float)x)/zoomx); + int orig_pixel= ibuf->x*(int)(scaley*(float)y) + (int)(scalex*(float)x); char *rrgb= (char*)scaleibuf->rect + pixel*4; char *orig_rrgb= (char*)ibuf->rect + orig_pixel*4; + rrgb[0]= orig_rrgb[0]; rrgb[1]= orig_rrgb[1]; rrgb[2]= orig_rrgb[2]; From bf77a177d406c378a74bf4572717159994d1faaf Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 4 Dec 2011 19:49:35 +0000 Subject: [PATCH 05/14] remove mesh PartialVisibility, it wasnt being version patches or used anywhere, other then save/load/free. --- source/blender/blenkernel/BKE_mesh.h | 6 -- source/blender/blenkernel/intern/mesh.c | 79 ------------------- source/blender/blenloader/intern/readfile.c | 19 ++--- source/blender/blenloader/intern/writefile.c | 24 +----- source/blender/editors/object/object_edit.c | 3 - .../blender/editors/object/object_modifier.c | 3 - source/blender/makesdna/DNA_mesh_types.h | 2 - source/blender/makesdna/DNA_meshdata_types.h | 8 -- 8 files changed, 8 insertions(+), 136 deletions(-) diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h index 900835940c7..232aa46575e 100644 --- a/source/blender/blenkernel/BKE_mesh.h +++ b/source/blender/blenkernel/BKE_mesh.h @@ -132,12 +132,6 @@ void create_vert_face_map(ListBase **map, IndexNode **mem, const struct MFace *m void create_vert_edge_map(ListBase **map, IndexNode **mem, const struct MEdge *medge, const int totvert, const int totedge); -/* Partial Mesh Visibility */ -struct PartialVisibility *mesh_pmv_copy(struct PartialVisibility *); -void mesh_pmv_free(struct PartialVisibility *); -void mesh_pmv_revert(struct Mesh *me); -void mesh_pmv_off(struct Mesh *me); - /* functions for making menu's from customdata layers */ int mesh_layers_menu_charlen(struct CustomData *data, int type); /* use this to work out how many chars to allocate */ void mesh_layers_menu_concat(struct CustomData *data, int type, char *str); diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index 736c24e2c06..43958457edb 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -113,23 +113,11 @@ void unlink_mesh(Mesh *me) if(me->texcomesh) me->texcomesh= NULL; } - /* do not free mesh itself */ void free_mesh(Mesh *me) { unlink_mesh(me); - if(me->pv) { - if(me->pv->vert_map) MEM_freeN(me->pv->vert_map); - if(me->pv->edge_map) MEM_freeN(me->pv->edge_map); - if(me->pv->old_faces) MEM_freeN(me->pv->old_faces); - if(me->pv->old_edges) MEM_freeN(me->pv->old_edges); - me->totvert= me->pv->totvert; - me->totedge= me->pv->totedge; - me->totface= me->pv->totface; - MEM_freeN(me->pv); - } - CustomData_free(&me->vdata, me->totvert); CustomData_free(&me->edata, me->totedge); CustomData_free(&me->fdata, me->totface); @@ -230,7 +218,6 @@ Mesh *copy_mesh(Mesh *me) men->mselect= NULL; men->edit_mesh= NULL; - men->pv= NULL; /* looks like this is no-longer supported but NULL just incase */ men->bb= MEM_dupallocN(men->bb); @@ -1456,72 +1443,6 @@ void create_vert_edge_map(ListBase **map, IndexNode **mem, const MEdge *medge, c } } -/* Partial Mesh Visibility */ -PartialVisibility *mesh_pmv_copy(PartialVisibility *pmv) -{ - PartialVisibility *n= MEM_dupallocN(pmv); - n->vert_map= MEM_dupallocN(pmv->vert_map); - n->edge_map= MEM_dupallocN(pmv->edge_map); - n->old_edges= MEM_dupallocN(pmv->old_edges); - n->old_faces= MEM_dupallocN(pmv->old_faces); - return n; -} - -void mesh_pmv_free(PartialVisibility *pv) -{ - MEM_freeN(pv->vert_map); - MEM_freeN(pv->edge_map); - MEM_freeN(pv->old_faces); - MEM_freeN(pv->old_edges); - MEM_freeN(pv); -} - -void mesh_pmv_revert(Mesh *me) -{ - if(me->pv) { - unsigned i; - MVert *nve, *old_verts; - - /* Reorder vertices */ - nve= me->mvert; - old_verts = MEM_mallocN(sizeof(MVert)*me->pv->totvert,"PMV revert verts"); - for(i=0; ipv->totvert; ++i) - old_verts[i]= nve[me->pv->vert_map[i]]; - - /* Restore verts, edges and faces */ - CustomData_free_layer_active(&me->vdata, CD_MVERT, me->totvert); - CustomData_free_layer_active(&me->edata, CD_MEDGE, me->totedge); - CustomData_free_layer_active(&me->fdata, CD_MFACE, me->totface); - - CustomData_add_layer(&me->vdata, CD_MVERT, CD_ASSIGN, old_verts, me->pv->totvert); - CustomData_add_layer(&me->edata, CD_MEDGE, CD_ASSIGN, me->pv->old_edges, me->pv->totedge); - CustomData_add_layer(&me->fdata, CD_MFACE, CD_ASSIGN, me->pv->old_faces, me->pv->totface); - mesh_update_customdata_pointers(me); - - me->totvert= me->pv->totvert; - me->totedge= me->pv->totedge; - me->totface= me->pv->totface; - - me->pv->old_edges= NULL; - me->pv->old_faces= NULL; - - /* Free maps */ - MEM_freeN(me->pv->edge_map); - me->pv->edge_map= NULL; - MEM_freeN(me->pv->vert_map); - me->pv->vert_map= NULL; - } -} - -void mesh_pmv_off(Mesh *me) -{ - if(me->pv) { - mesh_pmv_revert(me); - MEM_freeN(me->pv); - me->pv= NULL; - } -} - /* basic vertex data functions */ int minmax_mesh(Mesh *me, float min[3], float max[3]) { diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 1759fa67569..e352e783c24 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -3718,22 +3718,13 @@ static void direct_link_mesh(FileData *fd, Mesh *mesh) mesh->adt= newdataadr(fd, mesh->adt); direct_link_animdata(fd, mesh->adt); - /* Partial-mesh visibility (do this before using totvert, totface, or totedge!) */ - mesh->pv= newdataadr(fd, mesh->pv); - if(mesh->pv) { - mesh->pv->vert_map= newdataadr(fd, mesh->pv->vert_map); - mesh->pv->edge_map= newdataadr(fd, mesh->pv->edge_map); - mesh->pv->old_faces= newdataadr(fd, mesh->pv->old_faces); - mesh->pv->old_edges= newdataadr(fd, mesh->pv->old_edges); - } - /* normally direct_link_dverts should be called in direct_link_customdata, but for backwards compat in do_versions to work we do it here */ - direct_link_dverts(fd, mesh->pv ? mesh->pv->totvert : mesh->totvert, mesh->dvert); + direct_link_dverts(fd, mesh->totvert, mesh->dvert); - direct_link_customdata(fd, &mesh->vdata, mesh->pv ? mesh->pv->totvert : mesh->totvert); - direct_link_customdata(fd, &mesh->edata, mesh->pv ? mesh->pv->totedge : mesh->totedge); - direct_link_customdata(fd, &mesh->fdata, mesh->pv ? mesh->pv->totface : mesh->totface); + direct_link_customdata(fd, &mesh->vdata, mesh->totvert); + direct_link_customdata(fd, &mesh->edata, mesh->totedge); + direct_link_customdata(fd, &mesh->fdata, mesh->totface); mesh->bb= NULL; mesh->mselect = NULL; @@ -3787,7 +3778,7 @@ static void direct_link_mesh(FileData *fd, Mesh *mesh) TFace *tf= mesh->tface; unsigned int i; - for (i=0; i< (mesh->pv ? mesh->pv->totface : mesh->totface); i++, tf++) { + for (i=0; i< (mesh->totface); i++, tf++) { SWITCH_INT(tf->col[0]); SWITCH_INT(tf->col[1]); SWITCH_INT(tf->col[2]); diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index ad5eda03872..00710e67cf2 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -1691,27 +1691,9 @@ static void write_meshs(WriteData *wd, ListBase *idbase) writedata(wd, DATA, sizeof(void *)*mesh->totcol, mesh->mat); - if(mesh->pv) { - write_customdata(wd, &mesh->id, mesh->pv->totvert, &mesh->vdata, -1, 0); - write_customdata(wd, &mesh->id, mesh->pv->totedge, &mesh->edata, - CD_MEDGE, mesh->totedge); - write_customdata(wd, &mesh->id, mesh->pv->totface, &mesh->fdata, - CD_MFACE, mesh->totface); - } - else { - write_customdata(wd, &mesh->id, mesh->totvert, &mesh->vdata, -1, 0); - write_customdata(wd, &mesh->id, mesh->totedge, &mesh->edata, -1, 0); - write_customdata(wd, &mesh->id, mesh->totface, &mesh->fdata, -1, 0); - } - - /* PMV data */ - if(mesh->pv) { - writestruct(wd, DATA, "PartialVisibility", 1, mesh->pv); - writedata(wd, DATA, sizeof(unsigned int)*mesh->pv->totvert, mesh->pv->vert_map); - writedata(wd, DATA, sizeof(int)*mesh->pv->totedge, mesh->pv->edge_map); - writestruct(wd, DATA, "MFace", mesh->pv->totface, mesh->pv->old_faces); - writestruct(wd, DATA, "MEdge", mesh->pv->totedge, mesh->pv->old_edges); - } + write_customdata(wd, &mesh->id, mesh->totvert, &mesh->vdata, -1, 0); + write_customdata(wd, &mesh->id, mesh->totedge, &mesh->edata, -1, 0); + write_customdata(wd, &mesh->id, mesh->totface, &mesh->fdata, -1, 0); } mesh= mesh->id.next; } diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index fc6f0937c3d..07ab80f6d15 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -439,9 +439,6 @@ void ED_object_enter_editmode(bContext *C, int flag) ob->mode= OB_MODE_EDIT; if(ob->type==OB_MESH) { - Mesh *me= ob->data; - - if(me->pv) mesh_pmv_off(me); ok= 1; scene->obedit= ob; // context sees this diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 86477eb9dbd..240fb8017f2 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -456,7 +456,6 @@ static int modifier_apply_shape(ReportList *reports, Scene *scene, Object *ob, M BKE_report(reports, RPT_ERROR, "Only deforming modifiers can be applied to Shapes"); return 0; } - mesh_pmv_off(me); dm = mesh_create_derived_for_modifier(scene, ob, md); if (!dm) { @@ -506,8 +505,6 @@ static int modifier_apply_obdata(ReportList *reports, Scene *scene, Object *ob, return 0; } - mesh_pmv_off(me); - /* Multires: ensure that recent sculpting is applied */ if(md->type == eModifierType_Multires) multires_force_update(ob); diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h index b7d9208e595..7d57e2c295c 100644 --- a/source/blender/makesdna/DNA_mesh_types.h +++ b/source/blender/makesdna/DNA_mesh_types.h @@ -48,7 +48,6 @@ struct MSticky; struct Mesh; struct OcInfo; struct Multires; -struct PartialVisibility; struct EditMesh; struct AnimData; @@ -100,7 +99,6 @@ typedef struct Mesh { short totcol; struct Multires *mr DNA_DEPRECATED; /* deprecated multiresolution modeling data, only keep for loading old files */ - struct PartialVisibility *pv; } Mesh; /* deprecated by MTFace, only here for file reading */ diff --git a/source/blender/makesdna/DNA_meshdata_types.h b/source/blender/makesdna/DNA_meshdata_types.h index b6fc8106ba0..d772324cd72 100644 --- a/source/blender/makesdna/DNA_meshdata_types.h +++ b/source/blender/makesdna/DNA_meshdata_types.h @@ -174,14 +174,6 @@ typedef struct Multires { /** End Multires **/ -typedef struct PartialVisibility { - unsigned int *vert_map; /* vert_map[Old Index]= New Index */ - int *edge_map; /* edge_map[Old Index]= New Index, -1= hidden */ - MFace *old_faces; - MEdge *old_edges; - unsigned int totface, totedge, totvert, pad; -} PartialVisibility; - typedef struct MRecast{ int i; } MRecast; From 577730daad29cc9b4d7c1b5a9a64007fe8f3dc9d Mon Sep 17 00:00:00 2001 From: Daniel Salazar Date: Sun, 4 Dec 2011 22:48:23 +0000 Subject: [PATCH 06/14] --- .../object_randomize_transform.py | 29 +++++++++---------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/release/scripts/startup/bl_operators/object_randomize_transform.py b/release/scripts/startup/bl_operators/object_randomize_transform.py index 7aea18487f3..965231218a4 100644 --- a/release/scripts/startup/bl_operators/object_randomize_transform.py +++ b/release/scripts/startup/bl_operators/object_randomize_transform.py @@ -22,7 +22,7 @@ import bpy from bpy.types import Operator -def randomize_selected(seed, delta, loc, rot, scale, scale_even): +def randomize_selected(seed, delta, loc, rot, scale, scale_even, scale_min): import random from random import uniform @@ -62,20 +62,16 @@ def randomize_selected(seed, delta, loc, rot, scale, scale_even): else: org_sca_x, org_sca_y, org_sca_z = obj.scale - if scale_even: - sca_x = sca_y = sca_z = uniform(scale[0], - scale[0]) - uniform(0.0, 0.0), uniform(0.0, 0.0) - else: - sca_x, sca_y, sca_z = rand_vec(scale) + sca_x, sca_y, sca_z = uniform(-scale[0]+2, scale[0]), uniform(-scale[1]+2, scale[1]), uniform(-scale[2]+2, scale[2]) if scale_even: - aX = -(sca_x * org_sca_x) + org_sca_x - aY = -(sca_x * org_sca_y) + org_sca_y - aZ = -(sca_x * org_sca_z) + org_sca_z + aX = sca_x * org_sca_x + aY = sca_x * org_sca_y + aZ = sca_x * org_sca_z else: - aX = sca_x + org_sca_x - aY = sca_y + org_sca_y - aZ = sca_z + org_sca_z + aX = sca_x * org_sca_x + aY = sca_y * org_sca_y + aZ = sca_z * org_sca_z if delta: obj.delta_scale = aX, aY, aZ @@ -85,7 +81,7 @@ def randomize_selected(seed, delta, loc, rot, scale, scale_even): uniform(0.0, 0.0), uniform(0.0, 0.0), uniform(0.0, 0.0) -from bpy.props import IntProperty, BoolProperty, FloatVectorProperty +from bpy.props import IntProperty, BoolProperty, FloatProperty, FloatVectorProperty class RandomizeLocRotSize(Operator): @@ -98,7 +94,7 @@ class RandomizeLocRotSize(Operator): name="Random Seed", description="Seed value for the random generator", min=0, - max=1000, + max=10000, default=0, ) use_delta = BoolProperty( @@ -157,7 +153,7 @@ class RandomizeLocRotSize(Operator): description="Maximum scale randomization over each axis", min=-100.0, max=100.0, - default=(0.0, 0.0, 0.0), + default=(1.0, 1.0, 1.0), subtype='TRANSLATION', ) @@ -174,7 +170,8 @@ class RandomizeLocRotSize(Operator): scale_even = self.scale_even #scale_min = self.scale_min + scale_min = 0 - randomize_selected(seed, delta, loc, rot, scale, scale_even) + randomize_selected(seed, delta, loc, rot, scale, scale_even, scale_min) return {'FINISHED'} From eb233d933223a3795f3ff5204c4412f7a0fd6782 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 4 Dec 2011 23:04:43 +0000 Subject: [PATCH 07/14] syncing some minor formatting edits from bmesh branch. --- source/blender/blenkernel/BKE_customdata.h | 3 ++- source/blender/blenkernel/BKE_utildefines.h | 8 +++++- .../blender/blenkernel/intern/subsurf_ccg.c | 8 +++--- .../blender/blenlib/intern/math_base_inline.c | 4 +-- source/blender/editors/include/ED_object.h | 7 +++-- source/blender/editors/object/object_add.c | 6 +++-- source/blender/editors/object/object_vgroup.c | 1 + .../blender/editors/space_view3d/drawobject.c | 26 +++++++++++-------- .../editors/space_view3d/view3d_header.c | 14 +++++----- .../editors/transform/transform_generics.c | 4 +-- source/blender/makesdna/DNA_object_types.h | 2 +- 11 files changed, 51 insertions(+), 32 deletions(-) diff --git a/source/blender/blenkernel/BKE_customdata.h b/source/blender/blenkernel/BKE_customdata.h index 5497866b9df..f6b4240a026 100644 --- a/source/blender/blenkernel/BKE_customdata.h +++ b/source/blender/blenkernel/BKE_customdata.h @@ -285,7 +285,8 @@ void CustomData_validate_layer_name(const struct CustomData *data, int type, cha int CustomData_verify_versions(struct CustomData *data, int index); /*BMesh specific customdata stuff*/ -void CustomData_to_bmeshpoly(struct CustomData *fdata, struct CustomData *pdata, struct CustomData *ldata); +void CustomData_to_bmeshpoly(struct CustomData *fdata, struct CustomData *pdata, + struct CustomData *ldata); void CustomData_from_bmeshpoly(struct CustomData *fdata, struct CustomData *pdata, struct CustomData *ldata, int total); void CustomData_bmesh_init_pool(struct CustomData *data, int allocsize); diff --git a/source/blender/blenkernel/BKE_utildefines.h b/source/blender/blenkernel/BKE_utildefines.h index 3222167c56e..b5b3c7e67eb 100644 --- a/source/blender/blenkernel/BKE_utildefines.h +++ b/source/blender/blenkernel/BKE_utildefines.h @@ -36,6 +36,10 @@ #ifndef BKE_UTILDEFINES_H #define BKE_UTILDEFINES_H +#ifdef __cplusplus +extern "C" { +#endif + /* these values need to be hardcoded in structs, dna does not recognize defines */ /* also defined in DNA_space_types.h */ #ifndef FILE_MAXDIR @@ -81,6 +85,8 @@ /* bit-row */ #define BROW(min, max) (((max)>=31? 0xFFFFFFFF: (1<<(max+1))-1) - ((min)? ((1<<(min))-1):0) ) -#define BMEMSET(mem, val, size) {unsigned int _i; char *_c = (char*) mem; for (_i=0; _iv3); fVerts[3] = SET_INT_IN_POINTER(mf->v4); - // this is very bad, means mesh is internally consistent. - // it is not really possible to continue without modifying - // other parts of code significantly to handle missing faces. - // since this really shouldn't even be possible we just bail. + /* this is very bad, means mesh is internally inconsistent. + * it is not really possible to continue without modifying + * other parts of code significantly to handle missing faces. + * since this really shouldn't even be possible we just bail.*/ if(ccgSubSurf_syncFace(ss, SET_INT_IN_POINTER(i), fVerts[3] ? 4 : 3, fVerts, &f) == eCCGError_InvalidValue) { static int hasGivenError = 0; diff --git a/source/blender/blenlib/intern/math_base_inline.c b/source/blender/blenlib/intern/math_base_inline.c index ae3cba7e94f..0b2411af009 100644 --- a/source/blender/blenlib/intern/math_base_inline.c +++ b/source/blender/blenlib/intern/math_base_inline.c @@ -39,7 +39,7 @@ #define BLI_MATH_BASE_INLINE_H /* A few small defines. Keep'em local! */ -#define SMALL_NUMBER 1.e-8 +#define SMALL_NUMBER 1.e-8f MINLINE float sqrt3f(float f) { @@ -106,7 +106,7 @@ MINLINE float interpf(float target, float origin, float fac) * the distance gets very high, 180d would be inf, but this case isn't valid */ MINLINE float shell_angle_to_dist(const float angle) { - return (angle < (float)SMALL_NUMBER) ? 1.0f : fabsf(1.0f / cosf(angle)); + return (angle < SMALL_NUMBER) ? 1.0f : fabsf(1.0f / cosf(angle)); } /* used for zoom values*/ diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h index 39d6ba8bc1b..5c7d9249c5f 100644 --- a/source/blender/editors/include/ED_object.h +++ b/source/blender/editors/include/ED_object.h @@ -102,8 +102,11 @@ float ED_object_new_primitive_matrix(struct bContext *C, struct Object *editob, void ED_object_add_generic_props(struct wmOperatorType *ot, int do_editmode); int ED_object_add_generic_invoke(struct bContext *C, struct wmOperator *op, struct wmEvent *event); -int ED_object_add_generic_get_opts(struct bContext *C, struct wmOperator *op, float *loc, float *rot, int *enter_editmode, unsigned int *layer); -struct Object *ED_object_add_type(struct bContext *C, int type, float *loc, float *rot, int enter_editmode, unsigned int layer); +int ED_object_add_generic_get_opts(struct bContext *C, struct wmOperator *op, + float *loc, float *rot, int *enter_editmode, unsigned int *layer); + +struct Object *ED_object_add_type(struct bContext *C, int type, float *loc, + float *rot, int enter_editmode, unsigned int layer); void ED_object_single_users(struct Main *bmain, struct Scene *scene, int full); void ED_object_single_user(struct Scene *scene, struct Object *ob); diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index f1bc63aa746..855b67b71bc 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -244,7 +244,8 @@ int ED_object_add_generic_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(ev return op->type->exec(C, op); } -int ED_object_add_generic_get_opts(bContext *C, wmOperator *op, float *loc, float *rot, int *enter_editmode, unsigned int *layer) +int ED_object_add_generic_get_opts(bContext *C, wmOperator *op, float *loc, + float *rot, int *enter_editmode, unsigned int *layer) { View3D *v3d = CTX_wm_view3d(C); int a, layer_values[20]; @@ -305,7 +306,8 @@ int ED_object_add_generic_get_opts(bContext *C, wmOperator *op, float *loc, floa /* for object add primitive operators */ /* do not call undo push in this function (users of this function have to) */ -Object *ED_object_add_type(bContext *C, int type, float *loc, float *rot, int enter_editmode, unsigned int layer) +Object *ED_object_add_type(bContext *C, int type, float *loc, float *rot, + int enter_editmode, unsigned int layer) { Main *bmain= CTX_data_main(C); Scene *scene= CTX_data_scene(C); diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index 16073434cc7..55d72bcf165 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -99,6 +99,7 @@ int ED_vgroup_object_is_edit_mode(Object *ob) bDeformGroup *ED_vgroup_add_name(Object *ob, const char *name) { bDeformGroup *defgroup; + if(!ob || !OB_TYPE_SUPPORT_VGROUP(ob->type)) return NULL; diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 36f6e5c6ff7..547d89cd1a2 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -2473,7 +2473,8 @@ static void draw_dm_bweights(Scene *scene, DerivedMesh *dm) /* EditMesh drawing routines*/ -static void draw_em_fancy_verts(Scene *scene, View3D *v3d, Object *obedit, DerivedMesh *cageDM, EditVert *eve_act) +static void draw_em_fancy_verts(Scene *scene, View3D *v3d, Object *obedit, + DerivedMesh *cageDM, EditVert *eve_act) { ToolSettings *ts= scene->toolsettings; int sel; @@ -2530,7 +2531,9 @@ static void draw_em_fancy_verts(Scene *scene, View3D *v3d, Object *obedit, Deriv glPointSize(1.0); } -static void draw_em_fancy_edges(Scene *scene, View3D *v3d, Mesh *me, DerivedMesh *cageDM, short sel_only, EditEdge *eed_act) +static void draw_em_fancy_edges(Scene *scene, View3D *v3d, + Mesh *me, DerivedMesh *cageDM, short sel_only, + EditEdge *eed_act) { ToolSettings *ts= scene->toolsettings; int pass; @@ -2588,7 +2591,8 @@ static void draw_em_fancy_edges(Scene *scene, View3D *v3d, Mesh *me, DerivedMesh } } -static void draw_em_measure_stats(View3D *v3d, RegionView3D *rv3d, Object *ob, EditMesh *em, UnitSettings *unit) +static void draw_em_measure_stats(View3D *v3d, RegionView3D *rv3d, + Object *ob, EditMesh *em, UnitSettings *unit) { Mesh *me= ob->data; EditEdge *eed; @@ -2799,11 +2803,11 @@ static void draw_em_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d, if(CHECK_OB_DRAWTEXTURE(v3d, dt)) { if(draw_glsl_material(scene, ob, v3d, dt)) { glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW); - + finalDM->drawMappedFacesGLSL(finalDM, GPU_enable_material, - draw_em_fancy__setGLSLFaceOpts, NULL); + draw_em_fancy__setGLSLFaceOpts, em); GPU_disable_material(); - + glFrontFace(GL_CCW); } else { @@ -2814,12 +2818,11 @@ static void draw_em_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d, /* 3 floats for position, * 3 for normal and times two because the faces may actually be quads instead of triangles */ glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, me->flag & ME_TWOSIDED); - + glEnable(GL_LIGHTING); glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW); - finalDM->drawMappedFaces(finalDM, draw_em_fancy__setFaceOpts, GPU_enable_material, NULL, NULL, 0); - + glFrontFace(GL_CCW); glDisable(GL_LIGHTING); } @@ -2908,7 +2911,7 @@ static void draw_em_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d, if(me->drawflag & ME_DRAWBWEIGHTS) { draw_dm_bweights(scene, cageDM); } - + draw_em_fancy_edges(scene, v3d, me, cageDM, 0, eed_act); } if(em) { @@ -6904,7 +6907,8 @@ static void bbs_mesh_solid__drawCenter(void *UNUSED(userData), int index, float } /* two options, facecolors or black */ -static void bbs_mesh_solid_EM(Scene *scene, View3D *v3d, Object *ob, DerivedMesh *dm, int facecol) +static void bbs_mesh_solid_EM(Scene *scene, View3D *v3d, + Object *ob, DerivedMesh *dm, int facecol) { cpack(0); diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index b9513ab0880..0c9ea3c6a2a 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -283,16 +283,16 @@ static char *view3d_modeselect_pup(Scene *scene) BLI_strncpy(str, title, sizeof(string)); str += modeselect_addmode(str, N_("Object Mode"), OB_MODE_OBJECT, ICON_OBJECT_DATA); - + if(ob==NULL || ob->data==NULL) return string; if(ob->id.lib) return string; - + if(!((ID *)ob->data)->lib) { /* if active object is editable */ if ( ((ob->type == OB_MESH) || (ob->type == OB_CURVE) || (ob->type == OB_SURF) || (ob->type == OB_FONT) || (ob->type == OB_MBALL) || (ob->type == OB_LATTICE))) { - + str += modeselect_addmode(str, N_("Edit Mode"), OB_MODE_EDIT, ICON_EDITMODE_HLT); } else if (ob->type == OB_ARMATURE) { @@ -310,7 +310,7 @@ static char *view3d_modeselect_pup(Scene *scene) str += modeselect_addmode(str, N_("Weight Paint"), OB_MODE_WEIGHT_PAINT, ICON_WPAINT_HLT); } } - + /* if active object is an armature */ if (ob->type==OB_ARMATURE) { str += modeselect_addmode(str, N_("Pose Mode"), OB_MODE_POSE, ICON_POSE_HLT); @@ -485,10 +485,12 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C) uiBlockSetEmboss(block, UI_EMBOSS); /* mode */ - if(ob) + if(ob) { v3d->modeselect = ob->mode; - else + } + else { v3d->modeselect = OB_MODE_OBJECT; + } row= uiLayoutRow(layout, 1); uiDefIconTextButS(block, MENU, B_MODESELECT, object_mode_icon(v3d->modeselect), view3d_modeselect_pup(scene) , diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 72f10a532d7..d0857958a4b 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -1552,7 +1552,7 @@ void calculateCenter(TransInfo *t) if(t->obedit->type == OB_MESH) { EditSelection ese; EditMesh *em = BKE_mesh_get_editmesh(t->obedit->data); - + if (EM_get_actSelection(em, &ese)) { EM_editselection_center(t->center, &ese); calculateCenter2D(t); @@ -1570,7 +1570,7 @@ void calculateCenter(TransInfo *t) } } } /* END EDIT MODE ACTIVE ELEMENT */ - + calculateCenterMedian(t); if((t->flag & (T_EDIT|T_POSE))==0) { diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index f5d327f50da..e4237197fca 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -135,7 +135,7 @@ typedef struct Object { /* materials */ struct Material **mat; /* material slots */ - char *matbits; /* 1 if material linked to object */ + char *matbits; /* a boolean field, with each byte 1 if corrusponding material is linked to object */ int totcol; /* copy of mesh or curve or meta */ int actcol; /* currently selected material in the UI */ From 8582495c161076f6ee4cfa72afacee8af024b831 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 5 Dec 2011 07:56:31 +0000 Subject: [PATCH 08/14] Minor whitespace fixes --- extern/libmv/libmv-capi.cpp | 6 +++--- source/blender/blenkernel/intern/tracking.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/extern/libmv/libmv-capi.cpp b/extern/libmv/libmv-capi.cpp index ed89f8cbfb3..dd98d0828dc 100644 --- a/extern/libmv/libmv-capi.cpp +++ b/extern/libmv/libmv-capi.cpp @@ -132,7 +132,7 @@ libmv_RegionTracker *libmv_hybridRegionTrackerNew(int max_iterations, int half_w esm_region_tracker->min_determinant = 1e-4; libmv::BruteRegionTracker *brute_region_tracker = new libmv::BruteRegionTracker; - brute_region_tracker->half_window_size = half_window_size; + brute_region_tracker->half_window_size = half_window_size; libmv::HybridRegionTracker *hybrid_region_tracker = new libmv::HybridRegionTracker(brute_region_tracker, esm_region_tracker); @@ -494,7 +494,7 @@ double libmv_reporojectionErrorForTrack(libmv_Reconstruction *libmv_reconstructi { libmv::EuclideanReconstruction *reconstruction = &libmv_reconstruction->reconstruction; libmv::CameraIntrinsics *intrinsics = &libmv_reconstruction->intrinsics; - libmv::vector markers = libmv_reconstruction->tracks.MarkersForTrack(track); + libmv::vector markers = libmv_reconstruction->tracks.MarkersForTrack(track); int num_reprojected = 0; double total_error = 0.0; @@ -678,7 +678,7 @@ void libmv_destroyFeatures(struct libmv_Features *libmv_features) /* ************ camera intrinsics ************ */ struct libmv_CameraIntrinsics *libmv_ReconstructionExtractIntrinsics(struct libmv_Reconstruction *libmv_Reconstruction) { - return (struct libmv_CameraIntrinsics *)&libmv_Reconstruction->intrinsics; + return (struct libmv_CameraIntrinsics *)&libmv_Reconstruction->intrinsics; } struct libmv_CameraIntrinsics *libmv_CameraIntrinsicsNew(double focal_length, double principal_x, double principal_y, diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c index 4b5dc917cb6..66c0c0265a1 100644 --- a/source/blender/blenkernel/intern/tracking.c +++ b/source/blender/blenkernel/intern/tracking.c @@ -1145,7 +1145,7 @@ int BKE_tracking_next(MovieTrackingContext *context) if(!ibuf_new) return 0; - #pragma omp parallel for private(a) shared(ibuf_new, ok) if(map_size>1) + #pragma omp parallel for private(a) shared(ibuf_new, ok) if(map_size>1) for(a= 0; a Date: Mon, 5 Dec 2011 11:02:54 +0000 Subject: [PATCH 09/14] fix for dscale which was set to 0,0,0 from files saved between Nov 29 and Dec 4. --- source/blender/blenkernel/BKE_blender.h | 2 +- source/blender/blenloader/intern/readfile.c | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h index 8738dc0830a..36e61c62069 100644 --- a/source/blender/blenkernel/BKE_blender.h +++ b/source/blender/blenkernel/BKE_blender.h @@ -42,7 +42,7 @@ extern "C" { * and keep comment above the defines. * Use STRINGIFY() rather than defining with quotes */ #define BLENDER_VERSION 260 -#define BLENDER_SUBVERSION 6 +#define BLENDER_SUBVERSION 7 #define BLENDER_MINVERSION 250 #define BLENDER_MINSUBVERSION 0 diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index e352e783c24..13e2ed49e6a 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -12642,6 +12642,18 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } } + /* sigh, this dscale vs dsize version patching was not done right, fix for fix, + * this intentionally checks an exact subversion, also note this was never in a release, + * at some point this could be removed. */ + else if (main->versionfile == 260 && main->subversionfile == 6) + { + Object *ob; + for (ob= main->object.first; ob; ob= ob->id.next) { + if (is_zero_v3(ob->dscale)) { + fill_vn_fl(ob->dscale, 3, 1.0f); + } + } + } /* put compatibility code here until next subversion bump */ { From c9eb206c060b3f2221b223b5cb0730e055c04bab Mon Sep 17 00:00:00 2001 From: Miika Hamalainen Date: Mon, 5 Dec 2011 13:36:41 +0000 Subject: [PATCH 10/14] Fix: Dynamic Paint sub-steps didn't work for constraint controlled brush objects. --- .../blender/blenkernel/intern/dynamicpaint.c | 28 +++++++++++++++++-- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c index 59139886fe6..b592e078db3 100644 --- a/source/blender/blenkernel/intern/dynamicpaint.c +++ b/source/blender/blenkernel/intern/dynamicpaint.c @@ -24,6 +24,7 @@ #include "BLI_utildefines.h" #include "DNA_anim_types.h" +#include "DNA_constraint_types.h" #include "DNA_dynamicpaint_types.h" #include "DNA_group_types.h" /*GroupObject*/ #include "DNA_material_types.h" @@ -39,6 +40,7 @@ #include "BKE_bvhutils.h" /* bvh tree */ #include "BKE_blender.h" #include "BKE_cdderivedmesh.h" +#include "BKE_constraint.h" #include "BKE_context.h" #include "BKE_customdata.h" #include "BKE_colortools.h" @@ -453,15 +455,35 @@ static void object_cacheIgnoreClear(Object *ob, int state) static void subframe_updateObject(Scene *scene, Object *ob, int flags, float frame) { DynamicPaintModifierData *pmd = (DynamicPaintModifierData *)modifiers_findByType(ob, eModifierType_DynamicPaint); + bConstraint *con; /* if other is dynamic paint canvas, dont update */ if (pmd && pmd->canvas) return; - /* if object has parent, update it too */ - if ((flags & UPDATE_PARENTS) && ob->parent) subframe_updateObject(scene, ob->parent, 0, frame); - if ((flags & UPDATE_PARENTS) && ob->track) subframe_updateObject(scene, ob->track, 0, frame); + /* if object has parents, update them too */ + if (flags & UPDATE_PARENTS) { + if (ob->parent) subframe_updateObject(scene, ob->parent, 0, frame); + if (ob->track) subframe_updateObject(scene, ob->track, 0, frame); + /* also update constraint targets */ + for (con = ob->constraints.first; con; con=con->next) { + bConstraintTypeInfo *cti= constraint_get_typeinfo(con); + ListBase targets = {NULL, NULL}; + + if (cti && cti->get_constraint_targets) { + bConstraintTarget *ct; + cti->get_constraint_targets(con, &targets); + for (ct= targets.first; ct; ct= ct->next) { + if (ct->tar) + subframe_updateObject(scene, ct->tar, 0, frame); + } + /* free temp targets */ + if (cti->flush_constraint_targets) + cti->flush_constraint_targets(con, &targets, 0); + } + } + } /* for curve following objects, parented curve has to be updated too */ if(ob->type==OB_CURVE) { Curve *cu= ob->data; From 9cac9579aebf3d0c2a56052dd94b799d7925e48f Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 5 Dec 2011 14:01:57 +0000 Subject: [PATCH 11/14] Fix #29506: libmv build issues on freebsd, patch by Shane Ambler. --- extern/libmv/libmv/numeric/numeric.h | 2 +- .../libmv/tracking/brute_region_tracker.cc | 11 +- extern/libmv/third_party/glog/src/config.h | 2 + .../third_party/glog/src/config_freebsd.h | 161 ++++++++++++++++++ 4 files changed, 174 insertions(+), 2 deletions(-) create mode 100644 extern/libmv/third_party/glog/src/config_freebsd.h diff --git a/extern/libmv/libmv/numeric/numeric.h b/extern/libmv/libmv/numeric/numeric.h index 21e0f067446..bb7f9b364ef 100644 --- a/extern/libmv/libmv/numeric/numeric.h +++ b/extern/libmv/libmv/numeric/numeric.h @@ -33,7 +33,7 @@ #include #include -#if _WIN32 || __APPLE__ +#if _WIN32 || __APPLE__ || __FreeBSD__ void static sincos (double x, double *sinx, double *cosx) { *sinx = sin(x); *cosx = cos(x); diff --git a/extern/libmv/libmv/tracking/brute_region_tracker.cc b/extern/libmv/libmv/tracking/brute_region_tracker.cc index c33432b7fd7..a416710ad2b 100644 --- a/extern/libmv/libmv/tracking/brute_region_tracker.cc +++ b/extern/libmv/libmv/tracking/brute_region_tracker.cc @@ -24,7 +24,7 @@ #include #endif -#ifndef __APPLE__ +#if !defined(__APPLE__) && !defined(__FreeBSD__) // Needed for memalign on Linux and _aligned_alloc on Windows. #ifdef FREE_WINDOWS /* make sure _aligned_malloc is included */ @@ -59,6 +59,15 @@ void *aligned_malloc(int size, int alignment) { // they work natively with SSE types with no further work. CHECK_EQ(alignment, 16); return malloc(size); +#elif __FreeBSD__ + void *result; + + if(posix_memalign(&result, alignment, size)) { + // non-zero means allocation error + // either no allocation or bad alignment value + return NULL; + } + return result; #else // This is for Linux. return memalign(alignment, size); #endif diff --git a/extern/libmv/third_party/glog/src/config.h b/extern/libmv/third_party/glog/src/config.h index 06ed686f87c..49c0d8905b0 100644 --- a/extern/libmv/third_party/glog/src/config.h +++ b/extern/libmv/third_party/glog/src/config.h @@ -4,6 +4,8 @@ /* Namespace for Google classes */ #ifdef __APPLE__ #include "config_mac.h" +#elif __FreeBSD__ + #include "config_freebsd.h" #elif __MINGW32__ #include "windows/config.h" #elif __GNUC__ diff --git a/extern/libmv/third_party/glog/src/config_freebsd.h b/extern/libmv/third_party/glog/src/config_freebsd.h new file mode 100644 index 00000000000..caaef9d998b --- /dev/null +++ b/extern/libmv/third_party/glog/src/config_freebsd.h @@ -0,0 +1,161 @@ +/* src/config.h. Generated from config.h.in by configure. */ +/* src/config.h.in. Generated from configure.ac by autoheader. */ + +/* Namespace for Google classes */ +#define GOOGLE_NAMESPACE google + +/* Define if you have the `dladdr' function */ +/* #undef HAVE_DLADDR */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_EXECINFO_H 1 + +/* Define if you have the `fcntl' function */ +#define HAVE_FCNTL 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_GLOB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `pthread' library (-lpthread). */ +#define HAVE_LIBPTHREAD 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LIBUNWIND_H */ + +/* define if you have google gflags library */ +#define HAVE_LIB_GFLAGS 1 + +/* define if you have google gmock library */ +/* #undef HAVE_LIB_GMOCK */ + +/* define if you have google gtest library */ +/* #undef HAVE_LIB_GTEST */ + +/* define if you have libunwind */ +/* #undef HAVE_LIB_UNWIND */ + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* define if the compiler implements namespaces */ +#define HAVE_NAMESPACES 1 + +/* Define if you have POSIX threads libraries and header files. */ +#define HAVE_PTHREAD 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_PWD_H 1 + +/* define if the compiler implements pthread_rwlock_* */ +#define HAVE_RWLOCK 1 + +/* Define if you have the `sigaltstack' function */ +#define HAVE_SIGALTSTACK 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYSCALL_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYSLOG_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SYSCALL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_UCONTEXT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_UTSNAME_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UCONTEXT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* define if the compiler supports using expression for operator */ +#define HAVE_USING_OPERATOR 1 + +/* define if your compiler has __attribute__ */ +#define HAVE___ATTRIBUTE__ 1 + +/* define if your compiler has __builtin_expect */ +#define HAVE___BUILTIN_EXPECT 1 + +/* define if your compiler has __sync_val_compare_and_swap */ +/* #undef HAVE___SYNC_VAL_COMPARE_AND_SWAP */ + +/* Name of package */ +#define PACKAGE "glog" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "opensource@google.com" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "glog" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "glog 0.3.1" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "glog" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "0.3.1" + +/* How to access the PC from a struct ucontext */ +/* #define PC_FROM_UCONTEXT uc_mcontext.gregs[REG_RIP] */ + +/* Define to necessary symbol if this constant uses a non-standard name on + your system. */ +/* #undef PTHREAD_CREATE_JOINABLE */ + +/* The size of `void *', as computed by sizeof. */ +#define SIZEOF_VOID_P 8 + +/* Define to 1 if you have the ANSI C header files. */ +/* #undef STDC_HEADERS */ + +#define STDC_HEADERS 1 +/* the namespace where STL code like vector<> is defined */ +#define STL_NAMESPACE std + +/* location of source code */ +#define TEST_SRC_DIR "." + +/* Version number of package */ +#define VERSION "0.3.1" + +/* Stops putting the code inside the Google namespace */ +#define _END_GOOGLE_NAMESPACE_ } + +/* Puts following code inside the Google namespace */ +#define _START_GOOGLE_NAMESPACE_ namespace google { + From a5434508ac871f76b6c12d528d5df8f903eda4b3 Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Mon, 5 Dec 2011 15:32:17 +0000 Subject: [PATCH 12/14] Release Cycle: * BCon4: Release candidate, important bug fixes only! --- source/blender/blenkernel/BKE_blender.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h index 36e61c62069..257a550edb4 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 a /* alpha/beta/rc/release, docs use this */ -#define BLENDER_VERSION_CYCLE beta +#define BLENDER_VERSION_CYCLE rc extern char versionstr[]; /* from blender.c */ From 72827ee53190d74ebaa083f2bb616d9bc4b2e078 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 5 Dec 2011 15:57:57 +0000 Subject: [PATCH 13/14] Fix #29507: cycles rendering of metaball animations not working. --- source/blender/makesrna/intern/rna_object_api.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index 5b8b9d9a6b2..a87d954046a 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -130,7 +130,7 @@ Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_ case OB_MBALL: { /* metaballs don't have modifiers, so just convert to mesh */ - Object *basis_ob = find_basis_mball( sce, ob ); + Object *basis_ob = find_basis_mball(sce, ob); /* todo, re-generatre for render-res */ /* metaball_polygonize(scene, ob) */ @@ -138,7 +138,15 @@ Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_ return NULL; /* only do basis metaball */ tmpmesh = add_mesh("Mesh"); - mball_to_mesh( &ob->disp, tmpmesh ); + + if(render) { + ListBase disp = {NULL, NULL}; + makeDispListMBall_forRender(sce, ob, &disp); + mball_to_mesh(&disp, tmpmesh); + freedisplist(&disp); + } + else + mball_to_mesh(&ob->disp, tmpmesh); break; } From c40d8921b8b61c0465a2fe9bca72dc418bf39c7d Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 5 Dec 2011 16:37:31 +0000 Subject: [PATCH 14/14] Fix #28107: save screenshot operator option to save full screen or only a single editor was not working. Solution is to take full screenshot and crop it on save. Also fixed screenshot showing popup menu used to execute operator. --- source/blender/editors/screen/screendump.c | 50 +++++++++++++------ source/blender/windowmanager/WM_api.h | 3 ++ source/blender/windowmanager/intern/wm_draw.c | 13 +++++ 3 files changed, 50 insertions(+), 16 deletions(-) diff --git a/source/blender/editors/screen/screendump.c b/source/blender/editors/screen/screendump.c index 7d0ec866456..7c76766affa 100644 --- a/source/blender/editors/screen/screendump.c +++ b/source/blender/editors/screen/screendump.c @@ -68,28 +68,20 @@ typedef struct ScreenshotData { unsigned int *dumprect; int dumpsx, dumpsy; + rcti crop; } ScreenshotData; /* get shot from frontbuffer */ -static unsigned int *screenshot(bContext *C, int *dumpsx, int *dumpsy, int fscreen) +static unsigned int *screenshot(bContext *C, int *dumpsx, int *dumpsy) { wmWindow *win= CTX_wm_window(C); - ScrArea *curarea= CTX_wm_area(C); int x=0, y=0; unsigned int *dumprect= NULL; - if(fscreen) { /* full screen */ - x= 0; - y= 0; - *dumpsx= win->sizex; - *dumpsy= win->sizey; - } - else { - x= curarea->totrct.xmin; - y= curarea->totrct.ymin; - *dumpsx= curarea->totrct.xmax-x; - *dumpsy= curarea->totrct.ymax-y; - } + x= 0; + y= 0; + *dumpsx= win->sizex; + *dumpsy= win->sizey; if (*dumpsx && *dumpsy) { @@ -108,15 +100,23 @@ static int screenshot_data_create(bContext *C, wmOperator *op) { unsigned int *dumprect; int dumpsx, dumpsy; + + /* do redraw so we don't show popups/menus */ + WM_redraw_windows(C); - dumprect= screenshot(C, &dumpsx, &dumpsy, RNA_boolean_get(op->ptr, "full")); + dumprect= screenshot(C, &dumpsx, &dumpsy); + if(dumprect) { ScreenshotData *scd= MEM_callocN(sizeof(ScreenshotData), "screenshot"); + ScrArea *sa= CTX_wm_area(C); scd->dumpsx= dumpsx; scd->dumpsy= dumpsy; scd->dumprect= dumprect; + if(sa) + scd->crop= sa->totrct; op->customdata= scd; + return TRUE; } else { @@ -137,6 +137,21 @@ static void screenshot_data_free(wmOperator *op) } } +static void screenshot_crop(ImBuf *ibuf, rcti crop) +{ + unsigned int *to= ibuf->rect; + unsigned int *from= ibuf->rect + crop.ymin*ibuf->x + crop.xmin; + int y, cropw= crop.xmax - crop.xmin, croph = crop.ymax - crop.ymin; + + if(cropw > 0 && croph > 0) { + for(y=0; yx) + memmove(to, from, sizeof(unsigned int)*cropw); + + ibuf->x= cropw; + ibuf->y= croph; + } +} + static int screenshot_exec(bContext *C, wmOperator *op) { ScreenshotData *scd= op->customdata; @@ -166,6 +181,10 @@ static int screenshot_exec(bContext *C, wmOperator *op) ibuf= IMB_allocImBuf(scd->dumpsx, scd->dumpsy, 24, 0); ibuf->rect= scd->dumprect; + /* crop to show only single editor */ + if(!RNA_boolean_get(op->ptr, "full")) + screenshot_crop(ibuf, scd->crop); + BKE_write_ibuf(ibuf, path, &scene->r.im_format); IMB_freeImBuf(ibuf); @@ -213,7 +232,6 @@ void SCREEN_OT_screenshot(wmOperatorType *ot) WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE, FILE_SPECIAL, FILE_SAVE, WM_FILESEL_FILEPATH); prop= RNA_def_boolean(ot->srna, "full", 1, "Full Screen", ""); - RNA_def_property_flag(prop, PROP_HIDDEN); /* hide because once the file sel is displayed, the option no longer does anything */ } /* *************** screenshot movie job ************************* */ diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index 1d8161086b0..2c0e22337c0 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -331,6 +331,9 @@ void WM_progress_clear(struct wmWindow *win); void WM_console_toggle(struct bContext *C, short show); #endif + /* Draw (for screenshot) */ +void WM_redraw_windows(struct bContext *C); + /* debugging only, convenience function to write on crash */ int write_crash_blend(void); diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c index 389049d9e59..f03680852ea 100644 --- a/source/blender/windowmanager/intern/wm_draw.c +++ b/source/blender/windowmanager/intern/wm_draw.c @@ -835,3 +835,16 @@ void wm_draw_region_clear(wmWindow *win, ARegion *ar) win->screen->do_draw= 1; } +void WM_redraw_windows(bContext *C) +{ + wmWindow *win_prev= CTX_wm_window(C); + ScrArea *area_prev= CTX_wm_area(C); + ARegion *ar_prev= CTX_wm_region(C); + + wm_draw_update(C); + + CTX_wm_window_set(C, win_prev); + CTX_wm_area_set(C, area_prev); + CTX_wm_region_set(C, ar_prev); +} +