svn merge -r37600:37700 https://svn.blender.org/svnroot/bf-blender/trunk/blender
authorCampbell Barton <ideasman42@gmail.com>
Mon, 25 Jul 2011 12:59:54 +0000 (12:59 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 25 Jul 2011 12:59:54 +0000 (12:59 +0000)
manually merged source/blender/editors/uvedit/uvedit_unwrap_ops.c

19 files changed:
1  2 
doc/python_api/examples/bpy.props.4.py
release/scripts/startup/bl_ui/space_info.py
source/blender/blenkernel/BKE_blender.h
source/blender/blenkernel/CMakeLists.txt
source/blender/blenkernel/intern/anim.c
source/blender/blenlib/CMakeLists.txt
source/blender/editors/object/object_bake.c
source/blender/editors/physics/particle_edit.c
source/blender/editors/render/CMakeLists.txt
source/blender/editors/transform/transform_snap.c
source/blender/editors/uvedit/uvedit_unwrap_ops.c
source/blender/makesrna/intern/CMakeLists.txt
source/blender/makesrna/intern/rna_object.c
source/blender/modifiers/intern/MOD_explode.c
source/blender/render/intern/include/rayobject.h
source/blender/render/intern/source/convertblender.c
source/blender/render/intern/source/strand.c
source/blender/windowmanager/CMakeLists.txt
source/creator/CMakeLists.txt

index 0000000000000000000000000000000000000000,d44f8947cb438aa9a5c632efb0afc79aa77825ad..2b44d94f72a76d63f8e89adf9221e1b413a9bbdd
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,20 +1,21 @@@
+ """
+ Update Example
+ ++++++++++++++
+ It can be useful to perform an action when a property is changed and can be
+ used to update other properties or synchronize with external data.
+ All properties define update functions except for CollectionProperty.
+ """
+ import bpy
++
+ def update_func(self, context):
+     print("my test function", self)
+ bpy.types.Scene.testprop = bpy.props.FloatProperty(update=update_func)
+ bpy.context.scene.testprop = 11.0
+ # >>> my test function <bpy_struct, Scene("Scene")>
Simple merge
index 4c7f211833cd58627c6e72cd4a15a40d38d56e0e,ae6836446fa855edbdb92ab1bba2eb1feb511e1a..b1558a98ff682cc14aee15862e0751e1d5aa2a60
@@@ -142,17 -134,48 +142,59 @@@ static int ED_uvedit_ensure_uvs(bContex
  
  /****************** Parametrizer Conversion ***************/
  
 -static int uvedit_have_selection(Scene *scene, EditMesh *em, short implicit)
++static int uvedit_have_selection(Scene *scene, BMEditMesh *em, short implicit)
+ {
++#if 0 // BMESH_TODO
+       EditFace *efa;
+       MTFace *tf;
+       /* verify if we have any selected uv's before unwrapping,
+          so we can cancel the operator early */
+       for(efa= em->faces.first; efa; efa= efa->next) {
+               if(scene->toolsettings->uv_flag & UV_SYNC_SELECTION) {
+                       if(efa->h)
+                               continue;
+               }
+               else if((efa->h) || ((efa->f & SELECT)==0))
+                       continue;
+               tf= (MTFace *)CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
+               if(!tf)
+                       return 1; /* default selected if doesn't exists */
+               
+               if(implicit &&
+                       !(      uvedit_uv_selected(scene, efa, tf, 0) ||
+                               uvedit_uv_selected(scene, efa, tf, 1) ||
+                               uvedit_uv_selected(scene, efa, tf, 2) ||
+                               (efa->v4 && uvedit_uv_selected(scene, efa, tf, 3)) )
+               ) {
+                       continue;
+               }
+               return 1;
+       }
+       return 0;
++#else
++      (void)scene;
++      (void)em;
++      (void)implicit;
++      return 0;
++#endif
+ }
 -static ParamHandle *construct_param_handle(Scene *scene, EditMesh *em, short implicit, short fill, short sel, short correct_aspect)
 +static ParamHandle *construct_param_handle(Scene *scene, BMEditMesh *em, 
 +                                  short implicit, short fill, short sel, 
 +                                  short correct_aspect)
  {
        ParamHandle *handle;
 -      EditFace *efa;
 -      EditEdge *eed;
 -      EditVert *ev;
 -      MTFace *tf;
 +      BMFace *efa;
 +      BMLoop *l;
 +      BMEdge *eed;
 +      BMVert *ev;
 +      BMIter iter, liter;
 +      MTexPoly *tf;
        int a;
        
        handle = param_construct_begin();
@@@ -312,9 -291,15 +354,14 @@@ static int minimize_stretch_init(bConte
  {
        Scene *scene= CTX_data_scene(C);
        Object *obedit= CTX_data_edit_object(C);
 -      EditMesh *em= BKE_mesh_get_editmesh((Mesh*)obedit->data);
 +      BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh;
        MinStretch *ms;
        int fill_holes= RNA_boolean_get(op->ptr, "fill_holes");
 -              BKE_mesh_end_editmesh(obedit->data, em);
+       short implicit= 1;
+       if(!uvedit_have_selection(scene, em, implicit)) {
+               return 0;
+       }
  
        ms= MEM_callocN(sizeof(MinStretch), "MinStretch");
        ms->scene= scene;
@@@ -495,8 -489,14 +551,13 @@@ static int pack_islands_exec(bContext *
  {
        Scene *scene= CTX_data_scene(C);
        Object *obedit= CTX_data_edit_object(C);
 -      EditMesh *em= BKE_mesh_get_editmesh((Mesh*)obedit->data);
 +      BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh;
        ParamHandle *handle;
 -              BKE_mesh_end_editmesh(obedit->data, em);
+       short implicit= 1;
+       if(!uvedit_have_selection(scene, em, implicit)) {
+               return OPERATOR_CANCELLED;
+       }
  
        if(RNA_property_is_set(op->ptr, "margin")) {
                scene->toolsettings->uvcalc_margin= RNA_float_get(op->ptr, "margin");
@@@ -537,10 -538,16 +598,15 @@@ static int average_islands_scale_exec(b
  {
        Scene *scene= CTX_data_scene(C);
        Object *obedit= CTX_data_edit_object(C);
 -      EditMesh *em= BKE_mesh_get_editmesh((Mesh*)obedit->data);
 +      BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh;
        ParamHandle *handle;
+       short implicit= 1;
  
-       handle= construct_param_handle(scene, em, 1, 0, 1, 1);
+       if(!uvedit_have_selection(scene, em, implicit)) {
 -              BKE_mesh_end_editmesh(obedit->data, em);
+               return OPERATOR_CANCELLED;
+       }
+       handle= construct_param_handle(scene, em, implicit, 0, 1, 1);
        param_average(handle);
        param_flush(handle);
        param_delete(handle);
@@@ -577,9 -585,11 +643,9 @@@ void ED_uvedit_live_unwrap_begin(Scene 
                return;
        }
  
-       liveHandle = construct_param_handle(scene, em, 0, fillholes, 0, 1);
+       liveHandle = construct_param_handle(scene, em, 0, fillholes, 1, 1);
  
        param_lscm_begin(liveHandle, PARAM_TRUE, abf);
 -      BKE_mesh_end_editmesh(obedit->data, em);
  }
  
  void ED_uvedit_live_unwrap_re_solve(void)
@@@ -878,7 -891,8 +944,8 @@@ static void uv_map_clip_correct(BMEditM
  /* assumes UV layer is checked, doesn't run update funcs */
  void ED_unwrap_lscm(Scene *scene, Object *obedit, const short sel)
  {
 -      EditMesh *em= BKE_mesh_get_editmesh((Mesh*)obedit->data);
 +      BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh;
+       ParamHandle *handle;
  
        const short fill_holes= scene->toolsettings->uvcalc_flag & UVCALC_FILLHOLES;
        const short correct_aspect= !(scene->toolsettings->uvcalc_flag & UVCALC_NO_ASPECT_CORRECT);
@@@ -900,11 -917,18 +968,15 @@@ static int unwrap_exec(bContext *C, wmO
  {
        Scene *scene= CTX_data_scene(C);
        Object *obedit= CTX_data_edit_object(C);
-       /* BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh; */ /*UNUSED*/
-       /* ParamHandle *handle; */ /*UNUSED*/
 -      EditMesh *em= BKE_mesh_get_editmesh((Mesh*)obedit->data);
++      BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh;
        int method = RNA_enum_get(op->ptr, "method");
        int fill_holes = RNA_boolean_get(op->ptr, "fill_holes");
        int correct_aspect = RNA_boolean_get(op->ptr, "correct_aspect");
 -              BKE_mesh_end_editmesh(obedit->data, em);
+       short implicit= 0;
+       if(!uvedit_have_selection(scene, em, implicit)) {
 -
 -      BKE_mesh_end_editmesh(obedit->data, em);
+               return 0;
+       }
        
        /* add uvs if they don't exist yet */
        if(!ED_uvedit_ensure_uvs(C, scene, obedit)) {
Simple merge