added mesh skin to the face key menu and added a python slot here.
authorCampbell Barton <ideasman42@gmail.com>
Mon, 19 Mar 2007 03:22:42 +0000 (03:22 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 19 Mar 2007 03:22:42 +0000 (03:22 +0000)
release/scripts/mesh_skin.py
source/blender/python/BPY_interface.c
source/blender/python/BPY_menus.c
source/blender/python/BPY_menus.h
source/blender/src/editmesh_add.c

index a3b2df3c6e06baa89c070fbfd9eb04d08e960a1d..7673209bccadedc8463c310cab6c723460a4d7f5 100644 (file)
@@ -1,9 +1,9 @@
 #!BPY
 
 """
-Name: 'Bridge Faces/Edge-Loops'
+Name: 'Skin Faces/Edge-Loops'
 Blender: 243
-Group: 'Mesh'
+Group: 'MeshFaceKey'
 Tooltip: 'Select 2 vert loops, then run this script.'
 """
 
index 5bd2fa2496ab67d12ec20a5897a95139edc3862a..fa3f7747d4668e7c4a4c92c42718b532e661c27e 100644 (file)
@@ -769,6 +769,7 @@ int BPY_menu_do_python( short menutype, int event )
        case PYMENU_RENDER:
        case PYMENU_WIZARDS:
        case PYMENU_SCRIPTTEMPLATE:
+       case PYMENU_MESHFACEKEY:
                break;
 
        default:
index 580d84aaa3cb043558bdaae210f1fc59b61f27e2..d4fc6f9a0de2fb247db7042a56b25d26d1e5c5c7 100644 (file)
@@ -109,6 +109,8 @@ static int bpymenu_group_atoi( char *str )
                return PYMENU_ARMATURE;
        else if( !strcmp( str, "ScriptTemplate" ) )
                return PYMENU_SCRIPTTEMPLATE;
+       else if( !strcmp( str, "MeshFaceKey" ) )
+               return PYMENU_MESHFACEKEY;
        /* "Misc" or an inexistent group name: use misc */
        else
                return PYMENU_MISC;
@@ -182,7 +184,10 @@ char *BPyMenu_group_itoa( short menugroup )
                break;
        case PYMENU_SCRIPTTEMPLATE:
                return "ScriptTemplate";
-               break;  
+               break;
+       case PYMENU_MESHFACEKEY:
+               return "MeshFaceKey";
+               break;
        case PYMENU_MISC:
                return "Misc";
                break;
index dfa168531573057ac1f54b9c664818897be522e6..443960c369c71a5958d8d11771bf66f8ec7dfb9a 100644 (file)
@@ -105,7 +105,7 @@ typedef enum {
        PYMENU_HELP,/*Main Help menu items - prob best to leave for 'official' ones*/
        PYMENU_HELPSYSTEM,/* Resources, troubleshooting, system tools */
        PYMENU_HELPWEBSITES,/* Help -> Websites submenu */
-
+       PYMENU_MESHFACEKEY, /* face key in mesh editmode */
        PYMENU_TOTAL
 } PYMENUHOOKS;
 
index 0ec3ee3125c7fcef47adc1c864e073b049c2bd2e..f82669f32b20f192659935e449408ffcbc94f286 100644 (file)
 
 #include "editmesh.h"
 
+/* bpymenu */
+#include "BPY_extern.h"
+#include "BPY_menus.h"
+
 static float icovert[12][3] = {
        {0,0,-200}, 
        {144.72, -105.144,-89.443},
@@ -680,10 +684,39 @@ void addedgeface_mesh(void)
                return;
        }
        else if(amount > 4) {
-               int ret= pupmenu("Make Faces %t|Auto|Make FGon|Clear FGon");
+               
+               /* Python Menu */
+               BPyMenu *pym;
+               char menu_number[3];
+               int i=0, has_pymenu=0, ret;
+               
+               /* facemenu, will add python items */
+               char facemenu[4096]= "Make Faces%t|Auto%x1|Make FGon%x2|Clear FGon%x3";
+               
+               /* note that we account for the 10 previous entries with i+4: */
+               for (pym = BPyMenuTable[PYMENU_MESHFACEKEY]; pym; pym = pym->next, i++) {
+                       
+                       if (!has_pymenu) {
+                               strcat(facemenu, "|%l");
+                               has_pymenu = 1;
+                       }
+                       
+                       strcat(facemenu, "|");
+                       strcat(facemenu, pym->name);
+                       strcat(facemenu, " %x");
+                       sprintf(menu_number, "%d", i+4);
+                       strcat(facemenu, menu_number);
+               }
+               
+               ret= pupmenu(facemenu);
+               
                if(ret==1) addfaces_from_edgenet();
                else if(ret==2) make_fgon(1);
                else if(ret==3) make_fgon(0);
+               else if (ret >= 4) {
+                       BPY_menu_do_python(PYMENU_MESHFACEKEY, ret - 4);
+                       return;
+               }
                return;
        }
        else if(amount<2) {