- bpy.data.sounds was a collection of ID's rather then Sounds
authorCampbell Barton <ideasman42@gmail.com>
Wed, 16 Sep 2009 15:55:00 +0000 (15:55 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 16 Sep 2009 15:55:00 +0000 (15:55 +0000)
- last commit, missed include for rna_object_api.c & bad args to find_basis_mball
- use enum for GHOST tablet type None/Stylus/Eraser, had duplicate definition for these in C. Only tested X11, may need to cast to an int for other OS's.

intern/ghost/GHOST_Types.h
intern/ghost/intern/GHOST_SystemX11.cpp
intern/ghost/intern/GHOST_WindowCarbon.cpp
intern/ghost/intern/GHOST_WindowWin32.cpp
intern/ghost/intern/GHOST_WindowX11.cpp
source/blender/editors/interface/interface_handlers.c
source/blender/makesrna/intern/rna_main.c
source/blender/makesrna/intern/rna_object_api.c
source/blender/windowmanager/WM_types.h
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/wm_event_types.h

index 2441251dc330a7c1765b8cb3cfa99d7ae4c3dedc..73ed0bdd1faa7970f4ee0c1840810337904d99c5 100644 (file)
@@ -64,8 +64,14 @@ typedef enum
  * the pen's angle in 3D space vertically downwards on to the XY plane
  * --Matt
  */
+typedef enum {
+       GHOST_kTabletModeNone = 0,
+       GHOST_kTabletModeStylus,
+       GHOST_kTabletModeEraser
+} GHOST_TTabletMode;
+
 typedef struct GHOST_TabletData {
-       char Active; /* 0=None, 1=Stylus, 2=Eraser */
+       GHOST_TTabletMode Active; /* 0=None, 1=Stylus, 2=Eraser */
        float Pressure; /* range 0.0 (not touching) to 1.0 (full pressure) */
        float Xtilt;    /* range 0.0 (upright) to 1.0 (tilted fully against the tablet surface) */
        float Ytilt;    /* as above */
index 5dba76adb02a009834ec3d36a89c781e42159ae6..9f6f3b4d5b018dd18abcd518d37d4037971d3eac 100644 (file)
@@ -684,12 +684,12 @@ GHOST_SystemX11::processEvent(XEvent *xe)
                        {
                                XProximityNotifyEvent* data = (XProximityNotifyEvent*)xe;
                                if(data->deviceid == window->GetXTablet().StylusID)
-                                       window->GetXTablet().CommonData.Active= 1;
+                                       window->GetXTablet().CommonData.Active= GHOST_kTabletModeStylus;
                                else if(data->deviceid == window->GetXTablet().EraserID)
-                                       window->GetXTablet().CommonData.Active= 2;
+                                       window->GetXTablet().CommonData.Active= GHOST_kTabletModeEraser;
                        }
                        else if(xe->type == window->GetXTablet().ProxOutEvent)
-                               window->GetXTablet().CommonData.Active= 0;
+                               window->GetXTablet().CommonData.Active= GHOST_kTabletModeNone;
 
                        break;
                }
index 87bb86a37e7d9b8bfd870cb3dffb621ca6069442..362e949a0a4f14554826686966ed0e7c73ae5370 100644 (file)
@@ -183,7 +183,7 @@ GHOST_WindowCarbon::GHOST_WindowCarbon(
         updateDrawingContext();
         activateDrawingContext();        
 
-       m_tablet.Active = 0;
+       m_tablet.Active = GHOST_kTabletModeNone;
     }
 }
 
index 366adb3ab8640857e1c2c8cccc91f8506d9955a5..7cc759790306e0087bb23545bf8d0ac0418b9c81 100644 (file)
@@ -244,7 +244,7 @@ GHOST_WindowWin32::GHOST_WindowWin32(
                                m_tablet = fpWTOpen( m_hWnd, &lc, TRUE );
                                if (m_tablet) {
                                        m_tabletData = new GHOST_TabletData();
-                                       m_tabletData->Active = 0;
+                                       m_tabletData->Active = GHOST_kTabletModeNone;
                                }
                        }
                }
@@ -704,7 +704,7 @@ void GHOST_WindowWin32::processWin32TabletInitEvent()
                                }
                        }
 
-                       m_tabletData->Active = 0;
+                       m_tabletData->Active = GHOST_kTabletModeNone;
                }
        }
 }
index 3aff9d64a17edfaa41b957249607e9bf5dfac427..708256f75f5411e1d8201a53222df6c530b619e4 100644 (file)
@@ -425,7 +425,7 @@ void GHOST_WindowX11::initXInputDevices()
                        XDeviceInfo* device_info = XListInputDevices(m_display, &device_count);
                        m_xtablet.StylusDevice = 0;
                        m_xtablet.EraserDevice = 0;
-                       m_xtablet.CommonData.Active= 0;
+                       m_xtablet.CommonData.Active= GHOST_kTabletModeNone;
 
                        /* Install our error handler to override Xlib's termination behavior */
                        old_handler = XSetErrorHandler(ApplicationErrorHandler) ;
index 152695c91622ad9f6de2977554e38b43122930ad..1041418b059156a8a518a29274a4d3f5afdd6fbe 100644 (file)
@@ -2116,7 +2116,7 @@ static int ui_do_but_NUM(bContext *C, uiBlock *block, uiBut *but, uiHandleButton
                                wmTabletData *wmtab= event->customdata;
 
                                /* de-sensitise based on tablet pressure */
-                               if (ELEM(wmtab->Active, DEV_STYLUS, DEV_ERASER))
+                               if (wmtab->Active != EVT_TABLET_NONE)
                                        fac *= wmtab->Pressure;
                        }
                        
index 344135acaffdc62e6de6a24cde77df039bc34078..910a15890cbed327103bf99a34d170025874b47a 100644 (file)
@@ -259,9 +259,9 @@ void RNA_def_main(BlenderRNA *brna)
                {"worlds", "World", "rna_Main_world_begin", "Worlds", "World datablocks.", NULL, NULL},
                {"groups", "Group", "rna_Main_group_begin", "Groups", "Group datablocks.", NULL, NULL},
                {"keys", "Key", "rna_Main_key_begin", "Keys", "Key datablocks.", NULL, NULL},
-               {"scripts", "ID", "rna_Main_script_begin", "Scripts", "Script datablocks.", NULL, NULL},
+               {"scripts", "ID", "rna_Main_script_begin", "Scripts", "Script datablocks (DEPRECATED).", NULL, NULL},
                {"texts", "Text", "rna_Main_text_begin", "Texts", "Text datablocks.", NULL, NULL},
-               {"sounds", "ID", "rna_Main_sound_begin", "Sounds", "Sound datablocks.", NULL, NULL},
+               {"sounds", "Sound", "rna_Main_sound_begin", "Sounds", "Sound datablocks.", NULL, NULL},
                {"armatures", "Armature", "rna_Main_armature_begin", "Armatures", "Armature datablocks.", NULL, NULL},
                {"actions", "Action", "rna_Main_action_begin", "Actions", "Action datablocks.", NULL, NULL},
                {"particles", "ParticleSettings", "rna_Main_particle_begin", "Particles", "Particle datablocks.", NULL, NULL},
index cfbd363e3583badaf78fe12bb84b48c9348ff7b2..e51dcbe3c57bf4b68516bc1964f04089c9a8adb7 100644 (file)
@@ -40,6 +40,7 @@
 #include "BKE_DerivedMesh.h"
 #include "BKE_displist.h"
 #include "BKE_object.h"
+#include "BKE_mball.h"
 #include "BKE_main.h"
 
 #include "DNA_mesh_types.h"
@@ -101,7 +102,7 @@ static Mesh *rna_Object_create_render_mesh(Object *ob, bContext *C, Scene *scene
        }
        case OB_MBALL:
                /* metaballs don't have modifiers, so just convert to mesh */
-               ob = find_basis_mball( ob );
+               ob = find_basis_mball(scene, ob);
                /* todo, re-generatre for render-res */
                // metaball_polygonize(scene, ob)
                me = add_mesh("Mesh");
index 806f5409b0aacddf542e78bd312b47e83d27608b..c24cf783063824f4c3104fb22656be484e87c7a1 100644 (file)
@@ -276,12 +276,8 @@ typedef struct wmGesture {
 } wmGesture;
 
 /* ************** custom wmEvent data ************** */
-
-#define DEV_STYLUS     1
-#define DEV_ERASER  2
-
 typedef struct wmTabletData {
-       int Active;                     /* 0=None, 1=Stylus, 2=Eraser */
+       int Active;                     /* 0=EVT_TABLET_NONE, 1=EVT_TABLET_STYLUS, 2=EVT_TABLET_ERASER */
        float Pressure;         /* range 0.0 (not touching) to 1.0 (full pressure) */
        float Xtilt;            /* range 0.0 (upright) to 1.0 (tilted fully against the tablet surface) */
        float Ytilt;            /* as above */
index 306b99dcfcc25212e2f2a750181044fe0e9a0309..9d5bd13ea259ed307a8ff55f54ae79959ccead1b 100644 (file)
@@ -1498,10 +1498,10 @@ static void update_tablet_data(wmWindow *win, wmEvent *event)
        const GHOST_TabletData *td= GHOST_GetTabletData(win->ghostwin);
        
        /* if there's tablet data from an active tablet device then add it */
-       if ((td != NULL) && td->Active) {
+       if ((td != NULL) && td->Active != GHOST_kTabletModeNone) {
                struct wmTabletData *wmtab= MEM_mallocN(sizeof(wmTabletData), "customdata tablet");
                
-               wmtab->Active = td->Active;
+               wmtab->Active = (int)td->Active;
                wmtab->Pressure = td->Pressure;
                wmtab->Xtilt = td->Xtilt;
                wmtab->Ytilt = td->Ytilt;
index 3da621bda8513593e0a767b6a871b8364a625e91..b331e036b9e18302ffa73b243fe24bce5ae705a4 100644 (file)
@@ -40,7 +40,7 @@
 #define EVT_DATA_GESTURE       2
 #define EVT_DATA_TIMER         3
 
-/* tablet active */
+/* tablet active, matches GHOST_TTabletMode */
 #define EVT_TABLET_NONE                0
 #define EVT_TABLET_STYLUS      1
 #define EVT_TABLET_ERASER      2