Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2009-09-16 19:55:00 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-09-16 19:55:00 +0400
commit7c5695c8011d128d7a40b28bf2146fdaab063dbe (patch)
treed86b54ce75709c642c1e2ae76a897b9fee3068df
parentb5b0a62c9715130ac371356cd2511371e14b9d40 (diff)
- bpy.data.sounds was a collection of ID's rather then Sounds
- 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.
-rw-r--r--intern/ghost/GHOST_Types.h8
-rw-r--r--intern/ghost/intern/GHOST_SystemX11.cpp6
-rw-r--r--intern/ghost/intern/GHOST_WindowCarbon.cpp2
-rw-r--r--intern/ghost/intern/GHOST_WindowWin32.cpp4
-rw-r--r--intern/ghost/intern/GHOST_WindowX11.cpp2
-rw-r--r--source/blender/editors/interface/interface_handlers.c2
-rw-r--r--source/blender/makesrna/intern/rna_main.c4
-rw-r--r--source/blender/makesrna/intern/rna_object_api.c3
-rw-r--r--source/blender/windowmanager/WM_types.h6
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c4
-rw-r--r--source/blender/windowmanager/wm_event_types.h2
11 files changed, 23 insertions, 20 deletions
diff --git a/intern/ghost/GHOST_Types.h b/intern/ghost/GHOST_Types.h
index 2441251dc33..73ed0bdd1fa 100644
--- a/intern/ghost/GHOST_Types.h
+++ b/intern/ghost/GHOST_Types.h
@@ -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 */
diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp
index 5dba76adb02..9f6f3b4d5b0 100644
--- a/intern/ghost/intern/GHOST_SystemX11.cpp
+++ b/intern/ghost/intern/GHOST_SystemX11.cpp
@@ -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;
}
diff --git a/intern/ghost/intern/GHOST_WindowCarbon.cpp b/intern/ghost/intern/GHOST_WindowCarbon.cpp
index 87bb86a37e7..362e949a0a4 100644
--- a/intern/ghost/intern/GHOST_WindowCarbon.cpp
+++ b/intern/ghost/intern/GHOST_WindowCarbon.cpp
@@ -183,7 +183,7 @@ GHOST_WindowCarbon::GHOST_WindowCarbon(
updateDrawingContext();
activateDrawingContext();
- m_tablet.Active = 0;
+ m_tablet.Active = GHOST_kTabletModeNone;
}
}
diff --git a/intern/ghost/intern/GHOST_WindowWin32.cpp b/intern/ghost/intern/GHOST_WindowWin32.cpp
index 366adb3ab86..7cc75979030 100644
--- a/intern/ghost/intern/GHOST_WindowWin32.cpp
+++ b/intern/ghost/intern/GHOST_WindowWin32.cpp
@@ -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;
}
}
}
diff --git a/intern/ghost/intern/GHOST_WindowX11.cpp b/intern/ghost/intern/GHOST_WindowX11.cpp
index 3aff9d64a17..708256f75f5 100644
--- a/intern/ghost/intern/GHOST_WindowX11.cpp
+++ b/intern/ghost/intern/GHOST_WindowX11.cpp
@@ -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) ;
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 152695c9162..1041418b059 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -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;
}
diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c
index 344135acaff..910a15890cb 100644
--- a/source/blender/makesrna/intern/rna_main.c
+++ b/source/blender/makesrna/intern/rna_main.c
@@ -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},
diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c
index cfbd363e358..e51dcbe3c57 100644
--- a/source/blender/makesrna/intern/rna_object_api.c
+++ b/source/blender/makesrna/intern/rna_object_api.c
@@ -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");
diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h
index 806f5409b0a..c24cf783063 100644
--- a/source/blender/windowmanager/WM_types.h
+++ b/source/blender/windowmanager/WM_types.h
@@ -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 */
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index 306b99dcfcc..9d5bd13ea25 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -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;
diff --git a/source/blender/windowmanager/wm_event_types.h b/source/blender/windowmanager/wm_event_types.h
index 3da621bda85..b331e036b9e 100644
--- a/source/blender/windowmanager/wm_event_types.h
+++ b/source/blender/windowmanager/wm_event_types.h
@@ -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