From 686ce92fe88d166f0fa1658363c4de8c1b5009b2 Mon Sep 17 00:00:00 2001 From: Mitchell Stokes Date: Sun, 22 Jan 2012 20:25:25 +0000 Subject: [PATCH 01/10] Committing patch "[#27676] Change window size/resolution in realtime" by me. Description: This patch allows the user to change the size of the window (or the resolution in fullscreen mode) using the new bge.render.setWindowSize() method. This only works in the Blenderplayer since it doesn't make a whole lot of sense for the embedded player. --- doc/python_api/rst/bge.render.rst | 8 ++++++++ intern/ghost/GHOST_ISystem.h | 9 +++++++++ intern/ghost/intern/GHOST_System.cpp | 13 ++++++++++++ intern/ghost/intern/GHOST_System.h | 9 +++++++++ .../BlenderRoutines/KX_BlenderCanvas.cpp | 5 +++++ .../BlenderRoutines/KX_BlenderCanvas.h | 2 +- .../gameengine/GamePlayer/common/GPC_Canvas.h | 1 + .../GamePlayer/ghost/GPG_Canvas.cpp | 20 +++++++++++++++++++ .../gameengine/GamePlayer/ghost/GPG_Canvas.h | 2 ++ source/gameengine/Ketsji/KX_PythonInit.cpp | 11 ++++++++++ source/gameengine/Rasterizer/RAS_ICanvas.h | 9 +++++++++ 11 files changed, 88 insertions(+), 1 deletion(-) diff --git a/doc/python_api/rst/bge.render.rst b/doc/python_api/rst/bge.render.rst index eeb50a833ff..ddc05ac1d8c 100644 --- a/doc/python_api/rst/bge.render.rst +++ b/doc/python_api/rst/bge.render.rst @@ -77,6 +77,14 @@ Functions :rtype: integer +.. function:: setWindowSize(width, height) + + Set the width and height of the window (in pixels). This also works for fullscreen applications. + + :type width: integer + :type height: integer + + .. function:: makeScreenshot(filename) Writes a screenshot to the given filename. diff --git a/intern/ghost/GHOST_ISystem.h b/intern/ghost/GHOST_ISystem.h index 3ec8d3d2fbf..ee67694760b 100644 --- a/intern/ghost/GHOST_ISystem.h +++ b/intern/ghost/GHOST_ISystem.h @@ -271,6 +271,15 @@ public: */ virtual GHOST_TSuccess beginFullScreen(const GHOST_DisplaySetting& setting, GHOST_IWindow** window, const bool stereoVisual, const GHOST_TUns16 numOfAASamples=0) = 0; + + /** + * Updates the resolution while in fullscreen mode. + * @param setting The new setting of the display. + * @param window Window displayed in full screen. + * + * @return Indication of success. + */ + virtual GHOST_TSuccess updateFullScreen(const GHOST_DisplaySetting& setting, GHOST_IWindow** window) = 0; /** * Ends full screen mode. diff --git a/intern/ghost/intern/GHOST_System.cpp b/intern/ghost/intern/GHOST_System.cpp index 4efdcbc6519..944ade3f22b 100644 --- a/intern/ghost/intern/GHOST_System.cpp +++ b/intern/ghost/intern/GHOST_System.cpp @@ -168,6 +168,19 @@ GHOST_TSuccess GHOST_System::beginFullScreen(const GHOST_DisplaySetting& setting } +GHOST_TSuccess GHOST_System::updateFullScreen(const GHOST_DisplaySetting& setting, GHOST_IWindow** window) +{ + GHOST_TSuccess success = GHOST_kFailure; + GHOST_ASSERT(m_windowManager, "GHOST_System::updateFullScreen(): invalid window manager"); + if(m_displayManager) { + if (m_windowManager->getFullScreen()) { + success = m_displayManager->setCurrentDisplaySetting(GHOST_DisplayManager::kMainDisplay, setting); + } + } + + return success; +} + GHOST_TSuccess GHOST_System::endFullScreen(void) { GHOST_TSuccess success = GHOST_kFailure; diff --git a/intern/ghost/intern/GHOST_System.h b/intern/ghost/intern/GHOST_System.h index 6286121719d..0bb0387a287 100644 --- a/intern/ghost/intern/GHOST_System.h +++ b/intern/ghost/intern/GHOST_System.h @@ -145,6 +145,15 @@ public: */ virtual GHOST_TSuccess beginFullScreen(const GHOST_DisplaySetting& setting, GHOST_IWindow** window, const bool stereoVisual, const GHOST_TUns16 numOfAASamples=0); + + /** + * Updates the resolution while in fullscreen mode. + * @param setting The new setting of the display. + * @param window Window displayed in full screen. + * + * @return Indication of success. + */ + virtual GHOST_TSuccess updateFullScreen(const GHOST_DisplaySetting& setting, GHOST_IWindow** window); /** * Ends full screen mode. diff --git a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp index 2a21b531b6b..7e7b3d2e3d4 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp +++ b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp @@ -59,6 +59,11 @@ void KX_BlenderCanvas::SwapBuffers() BL_SwapBuffers(m_win); } +void KX_BlenderCanvas::ResizeWindow(int width, int height) +{ + // Not implemented for the embedded player +} + void KX_BlenderCanvas::BeginFrame() { glEnable(GL_DEPTH_TEST); diff --git a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h index 1f38cf9766d..44dffb5bc54 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h +++ b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h @@ -78,7 +78,7 @@ public: SwapBuffers( ); void - Resize( + ResizeWindow( int width, int height ); diff --git a/source/gameengine/GamePlayer/common/GPC_Canvas.h b/source/gameengine/GamePlayer/common/GPC_Canvas.h index 6ac1323783b..a9d7ab1b93f 100644 --- a/source/gameengine/GamePlayer/common/GPC_Canvas.h +++ b/source/gameengine/GamePlayer/common/GPC_Canvas.h @@ -103,6 +103,7 @@ public: void Resize(int width, int height); + virtual void ResizeWindow(int width, int height){}; /** * @section Methods inherited from abstract base class RAS_ICanvas. diff --git a/source/gameengine/GamePlayer/ghost/GPG_Canvas.cpp b/source/gameengine/GamePlayer/ghost/GPG_Canvas.cpp index 4b5d2bbf96a..9b01cb5786f 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_Canvas.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_Canvas.cpp @@ -108,6 +108,26 @@ void GPG_Canvas::SwapBuffers() } } +void GPG_Canvas::ResizeWindow(int width, int height) +{ + if (m_window->getState() == GHOST_kWindowStateFullScreen) + { + GHOST_ISystem* system = GHOST_ISystem::getSystem(); + GHOST_DisplaySetting setting; + setting.xPixels = width; + setting.yPixels = height; + //XXX allow these to be changed or kept from previous state + setting.bpp = 32; + setting.frequency = 60; + + system->updateFullScreen(setting, &m_window); + } + + m_window->setClientSize(width, height); + + Resize(width, height); +} + float GPG_Canvas::GetMouseNormalizedX(int x) { return float(x)/this->GetWidth(); diff --git a/source/gameengine/GamePlayer/ghost/GPG_Canvas.h b/source/gameengine/GamePlayer/ghost/GPG_Canvas.h index c1ebb09251c..217cfc5eb88 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_Canvas.h +++ b/source/gameengine/GamePlayer/ghost/GPG_Canvas.h @@ -60,6 +60,8 @@ public: virtual float GetMouseNormalizedX(int x); virtual float GetMouseNormalizedY(int y); + virtual void ResizeWindow(int width, int height); + bool BeginDraw() { return true;}; void EndDraw() {}; }; diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 114ca735265..32106b1fdd8 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -1288,6 +1288,16 @@ static PyObject* gPyDrawLine(PyObject*, PyObject* args) Py_RETURN_NONE; } +static PyObject* gPySetWindowSize(PyObject*, PyObject* args) +{ + int width, height; + if (!PyArg_ParseTuple(args, "ii:resize", &width, &height)) + return NULL; + + gp_Canvas->ResizeWindow(width, height); + Py_RETURN_NONE; +} + static struct PyMethodDef rasterizer_methods[] = { {"getWindowWidth",(PyCFunction) gPyGetWindowWidth, METH_VARARGS, "getWindowWidth doc"}, @@ -1329,6 +1339,7 @@ static struct PyMethodDef rasterizer_methods[] = { METH_VARARGS, "get the anisotropic filtering level"}, {"drawLine", (PyCFunction) gPyDrawLine, METH_VARARGS, "draw a line on the screen"}, + {"setWindowSize", (PyCFunction) gPySetWindowSize, METH_VARARGS, ""}, { NULL, (PyCFunction) NULL, 0, NULL } }; diff --git a/source/gameengine/Rasterizer/RAS_ICanvas.h b/source/gameengine/Rasterizer/RAS_ICanvas.h index d7e2f237bb0..2c2f62c946e 100644 --- a/source/gameengine/Rasterizer/RAS_ICanvas.h +++ b/source/gameengine/Rasterizer/RAS_ICanvas.h @@ -205,6 +205,15 @@ public: MakeScreenShot( const char* filename )=0; + + virtual + void + ResizeWindow( + int width, + int height + )=0; + + protected: RAS_MouseState m_mousestate; From c499f5120bc16f100ec6d38a661de0ae12c7a0d5 Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Sun, 22 Jan 2012 22:30:45 +0000 Subject: [PATCH 02/10] Ocean Modifier UI fixes: * Modifier Icon was missing in the outliner * Fluid icon was used in the rna struct, fixed Note: Ocean uses the Wave modifier icon atm, if we find a better one, this can be changed. --- source/blender/editors/space_outliner/outliner_draw.c | 2 ++ source/blender/makesrna/intern/rna_modifier.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index 0264cf5ad05..eaa04a1e09e 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -1022,6 +1022,8 @@ static void tselem_draw_icon(uiBlock *block, int xmax, float x, float y, TreeSto UI_icon_draw(x, y, ICON_MOD_VERTEX_WEIGHT); break; case eModifierType_DynamicPaint: UI_icon_draw(x, y, ICON_MOD_DYNAMICPAINT); break; + case eModifierType_Ocean: + UI_icon_draw(x, y, ICON_MOD_WAVE); break; default: UI_icon_draw(x, y, ICON_DOT); break; } diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 3f3ac6ce906..50eb3d394df 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -2901,7 +2901,7 @@ static void rna_def_modifier_ocean(BlenderRNA *brna) srna= RNA_def_struct(brna, "OceanModifier", "Modifier"); RNA_def_struct_ui_text(srna, "Ocean Modifier", "Simulate an ocean surface"); RNA_def_struct_sdna(srna, "OceanModifierData"); - RNA_def_struct_ui_icon(srna, ICON_MOD_FLUIDSIM); + RNA_def_struct_ui_icon(srna, ICON_MOD_WAVE); /* General check if blender was built with OceanSim modifier support */ prop= RNA_def_property(srna, "is_build_enabled", PROP_BOOLEAN, PROP_NONE); From b3d5224390a2e9072ed2d7971e153880c4bb73cc Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Sun, 22 Jan 2012 22:43:21 +0000 Subject: [PATCH 03/10] Cycles UI: * Use full width for the world sample as lamp properties --- intern/cycles/blender/addon/ui.py | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index 67ff79a2037..94918345db9 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -337,16 +337,13 @@ class CyclesObject_PT_ray_visibility(CyclesButtonsPanel, Panel): ob = context.object visibility = ob.cycles_visibility - split = layout.split() - - col = split.column() - col.prop(visibility, "camera") - col.prop(visibility, "diffuse") - col.prop(visibility, "glossy") - - col = split.column() - col.prop(visibility, "transmission") - col.prop(visibility, "shadow") + flow = layout.column_flow() + + flow.prop(visibility, "camera") + flow.prop(visibility, "diffuse") + flow.prop(visibility, "glossy") + flow.prop(visibility, "transmission") + flow.prop(visibility, "shadow") def find_node(material, nodetype): @@ -473,17 +470,13 @@ class CyclesWorld_PT_settings(CyclesButtonsPanel, Panel): world = context.world cworld = world.cycles - split = layout.split() - col = split.column() + col = layout.column() col.prop(cworld, "sample_as_light") row = col.row() row.active = cworld.sample_as_light row.prop(cworld, "sample_map_resolution") - col = split.column() - col.label() - class CyclesWorld_PT_volume(CyclesButtonsPanel, Panel): bl_label = "Volume" From 9dac61c74d4a56f6a7a579ee521abe07b6d09fd9 Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Sun, 22 Jan 2012 22:59:21 +0000 Subject: [PATCH 04/10] Cycles Textures: * Remove the "Use nodes" button, the TextureOutput node was never ported to trunk from the cycles branch. --- intern/cycles/blender/addon/ui.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index 94918345db9..f44c04e36f8 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -610,14 +610,9 @@ class CyclesTexture_PT_context(CyclesButtonsPanel, Panel): col.template_ID(user, "texture", new="texture.new") if tex: - row = split.row() - row.prop(tex, "use_nodes", icon="NODETREE", text="") - row.label() - - if not tex.use_nodes: - split = layout.split(percentage=0.2) - split.label(text="Type:") - split.prop(tex, "type", text="") + split = layout.split(percentage=0.2) + split.label(text="Type:") + split.prop(tex, "type", text="") class CyclesTexture_PT_nodes(CyclesButtonsPanel, Panel): From a004257e4787930f8a67a31e5c442abfa1a333dd Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Sun, 22 Jan 2012 23:13:24 +0000 Subject: [PATCH 05/10] Cycles UI: * Add World ID Block to World Shader Nodes. --- release/scripts/startup/bl_ui/space_node.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py index edbcf3ecf5b..e1a599dca2e 100644 --- a/release/scripts/startup/bl_ui/space_node.py +++ b/release/scripts/startup/bl_ui/space_node.py @@ -58,6 +58,9 @@ class NODE_HT_header(Header): # Don't show "Use Nodes" Button when Engine is BI for Lamps if snode_id and not (scene.render.use_shading_nodes == 0 and ob.type == 'LAMP'): layout.prop(snode_id, "use_nodes") + + if snode.shader_type == 'WORLD': + layout.template_ID(scene, "world", new="world.new") elif snode.tree_type == 'TEXTURE': layout.prop(snode, "texture_type", text="", expand=True) From 62963525ced6a6a286d44eac9cca952aead2ac3f Mon Sep 17 00:00:00 2001 From: Mitchell Stokes Date: Sun, 22 Jan 2012 23:15:35 +0000 Subject: [PATCH 06/10] Fix for "[#29911] Crash on reading BL_ActionActuator.channelNames" The crash occurred when an action actuator was attached to a non-armature object because objects that aren't armatures do not have pose data. A NotImplementedError is now raised if someone tries to access any of the following with an action actuator attached to a non-armature object: BL_ActionActuator.channelNames BL_ActionActuator.getChannel() BL_ActionActuator.setChannel() --- .../gameengine/Converter/BL_ActionActuator.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp index c63b32830b0..1d4edb45242 100644 --- a/source/gameengine/Converter/BL_ActionActuator.cpp +++ b/source/gameengine/Converter/BL_ActionActuator.cpp @@ -350,6 +350,12 @@ bool BL_ActionActuator::Update(double curtime, bool frame) PyObject* BL_ActionActuator::PyGetChannel(PyObject* value) { const char *string= _PyUnicode_AsString(value); + + if (GetParent()->GetGameObjectType() != SCA_IObject::OBJ_ARMATURE) + { + PyErr_SetString(PyExc_NotImplementedError, "actuator.getChannel(): Only armatures support channels"); + return NULL; + } if (!string) { PyErr_SetString(PyExc_TypeError, "expected a single string"); @@ -414,6 +420,12 @@ KX_PYMETHODDEF_DOC(BL_ActionActuator, setChannel, PyObject *pymat= NULL; PyObject *pyloc= NULL, *pysize= NULL, *pyquat= NULL; bPoseChannel *pchan; + + if (GetParent()->GetGameObjectType() != SCA_IObject::OBJ_ARMATURE) + { + PyErr_SetString(PyExc_NotImplementedError, "actuator.setChannel(): Only armatures support channels"); + return NULL; + } if(PyTuple_Size(args)==2) { if (!PyArg_ParseTuple(args,"sO:setChannel", &string, &pymat)) // matrix @@ -574,6 +586,12 @@ PyObject* BL_ActionActuator::pyattr_get_channel_names(void *self_v, const KX_PYA PyObject *ret= PyList_New(0); PyObject *item; + if (self->GetParent()->GetGameObjectType() != SCA_IObject::OBJ_ARMATURE) + { + PyErr_SetString(PyExc_NotImplementedError, "actuator.channelNames: Only armatures support channels"); + return NULL; + } + bPose *pose= ((BL_ArmatureObject*)self->GetParent())->GetOrigPose(); if(pose) { From 37e128504257db0c37e31f26a626b2f92b2d10db Mon Sep 17 00:00:00 2001 From: Daniel Genrich Date: Mon, 23 Jan 2012 01:35:14 +0000 Subject: [PATCH 07/10] Cloth: Add "velocity damping" to damping options. This will help with the "cloth wobbling" problem which accurs quite often when having animated characters with cloth. --- .../startup/bl_ui/properties_physics_cloth.py | 1 + source/blender/blenkernel/intern/cloth.c | 1 + source/blender/blenkernel/intern/implicit.c | 3 +++ source/blender/blenloader/intern/readfile.c | 14 ++++++++++++++ source/blender/makesdna/DNA_cloth_types.h | 3 ++- source/blender/makesdna/DNA_object_force.h | 2 ++ source/blender/makesrna/intern/rna_cloth.c | 6 ++++++ 7 files changed, 29 insertions(+), 1 deletion(-) diff --git a/release/scripts/startup/bl_ui/properties_physics_cloth.py b/release/scripts/startup/bl_ui/properties_physics_cloth.py index 32b94504525..dc64aacf043 100644 --- a/release/scripts/startup/bl_ui/properties_physics_cloth.py +++ b/release/scripts/startup/bl_ui/properties_physics_cloth.py @@ -87,6 +87,7 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel, Panel): col.label(text="Damping:") col.prop(cloth, "spring_damping", text="Spring") col.prop(cloth, "air_damping", text="Air") + col.prop(cloth, "vel_damping", text="Velocity") col.prop(cloth, "use_pin_cloth", text="Pinning") sub = col.column() diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c index 73428c889dc..33adc2af284 100644 --- a/source/blender/blenkernel/intern/cloth.c +++ b/source/blender/blenkernel/intern/cloth.c @@ -130,6 +130,7 @@ void cloth_init ( ClothModifierData *clmd ) clmd->sim_parms->presets = 2; /* cotton as start setting */ clmd->sim_parms->timescale = 1.0f; /* speed factor, describes how fast cloth moves */ clmd->sim_parms->reset = 0; + clmd->sim_parms->vel_damping = 1.0f; /* 1.0 = no damping, 0.0 = fully dampened */ clmd->coll_parms->self_friction = 5.0; clmd->coll_parms->friction = 5.0; diff --git a/source/blender/blenkernel/intern/implicit.c b/source/blender/blenkernel/intern/implicit.c index 00a2de369a3..757d3ddf9ac 100644 --- a/source/blender/blenkernel/intern/implicit.c +++ b/source/blender/blenkernel/intern/implicit.c @@ -1852,6 +1852,9 @@ int implicit_solver (Object *ob, float frame, ClothModifierData *clmd, ListBase while(step < tf) { + // damping velocity for artistic reasons + mul_lfvectorS(id->V, id->V, clmd->sim_parms->vel_damping, numverts); + // calculate forces cloth_calc_force(clmd, frame, id->F, id->X, id->V, id->dFdV, id->dFdX, effectors, step, id->M); diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 28f00f355de..0a92d2ca544 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -13038,6 +13038,20 @@ static void do_versions(FileData *fd, Library *lib, Main *main) /* put compatibility code here until next subversion bump */ { + { + Object *ob; + for(ob=main->object.first; ob; ob= ob->id.next) { + ModifierData *md; + + for (md=ob->modifiers.first; md; md=md->next) { + if (md->type==eModifierType_Cloth) { + ClothModifierData *clmd = (ClothModifierData*) md; + if(clmd->sim_parms) + clmd->sim_parms->vel_damping = 1.0f; + } + } + } + } } /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ diff --git a/source/blender/makesdna/DNA_cloth_types.h b/source/blender/makesdna/DNA_cloth_types.h index 5c333c3fc1f..1079f1db835 100644 --- a/source/blender/makesdna/DNA_cloth_types.h +++ b/source/blender/makesdna/DNA_cloth_types.h @@ -70,6 +70,7 @@ typedef struct ClothSimSettings float goalfrict; float velocity_smooth; /* smoothing of velocities for hair */ float collider_friction; /* friction with colliders */ + float vel_damping; /* damp the velocity to speed up getting to the resting position */ int stepsPerFrame; /* Number of time steps per frame. */ int flags; /* flags, see CSIMSETT_FLAGS enum above. */ @@ -82,7 +83,7 @@ typedef struct ClothSimSettings short shapekey_rest; /* vertex group for scaling structural stiffness */ short presets; /* used for presets on GUI */ short reset; - short pad[3]; + short pad; struct EffectorWeights *effector_weights; } ClothSimSettings; diff --git a/source/blender/makesdna/DNA_object_force.h b/source/blender/makesdna/DNA_object_force.h index 1707c0d3929..70aeaaacd44 100644 --- a/source/blender/makesdna/DNA_object_force.h +++ b/source/blender/makesdna/DNA_object_force.h @@ -186,6 +186,8 @@ typedef struct PointCache { int endframe; /* simulation end frame */ int editframe; /* frame being edited (runtime only) */ int last_exact; /* last exact frame that's cached */ + int last_valid; /* used for editing cache - what is the last baked frame */ + int pad; /* for external cache files */ int totpoint; /* number of cached points */ diff --git a/source/blender/makesrna/intern/rna_cloth.c b/source/blender/makesrna/intern/rna_cloth.c index db6cb28bd98..839c67f6297 100644 --- a/source/blender/makesrna/intern/rna_cloth.c +++ b/source/blender/makesrna/intern/rna_cloth.c @@ -289,6 +289,12 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Air Damping", "Air has normally some thickness which slows falling things down"); RNA_def_property_update(prop, 0, "rna_cloth_update"); + prop= RNA_def_property(srna, "vel_damping", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "vel_damping"); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "Velocity Damping", "Damp velocity to help cloth reach the resting position faster. [1.0 = no damping, 0.0 = fully dampened]"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); + prop= RNA_def_property(srna, "use_pin_cloth", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_SIMSETTINGS_FLAG_GOAL); RNA_def_property_ui_text(prop, "Pin Cloth", "Enable pinning of cloth vertices to other objects/positions"); From be69b8b4fd6432694ff9b3faeefe281344b77081 Mon Sep 17 00:00:00 2001 From: Daniel Salazar Date: Mon, 23 Jan 2012 03:13:55 +0000 Subject: [PATCH 08/10] modifier Apply as Shape is now Apply as Shape Key. Was confusing some users --- source/blender/editors/interface/interface_templates.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 1e5309fa603..2b0a406a421 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -850,7 +850,7 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob, uiItemEnumO(row, "OBJECT_OT_modifier_apply", IFACE_("Apply"), 0, "apply_as", MODIFIER_APPLY_DATA); if (modifier_sameTopology(md) && !modifier_nonGeometrical(md)) - uiItemEnumO(row, "OBJECT_OT_modifier_apply", IFACE_("Apply as Shape"), 0, "apply_as", MODIFIER_APPLY_SHAPE); + uiItemEnumO(row, "OBJECT_OT_modifier_apply", IFACE_("Apply as Shape Key"), 0, "apply_as", MODIFIER_APPLY_SHAPE); } uiBlockClearButLock(block); From d2f8be9aa24551e585fa39a82c56a3ffe85b825b Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 23 Jan 2012 08:48:52 +0000 Subject: [PATCH 09/10] Fix for compilation error when using scons and carve is disabled --- intern/boolop/SConscript | 1 + 1 file changed, 1 insertion(+) diff --git a/intern/boolop/SConscript b/intern/boolop/SConscript index 0efed532cb9..1c8c912614d 100644 --- a/intern/boolop/SConscript +++ b/intern/boolop/SConscript @@ -8,6 +8,7 @@ incs += ' ../../source/blender/blenlib' defs = [] if not env['WITH_BF_CARVE']: + import os sources = env.Glob('intern/*.cpp') sources.remove('intern' + os.sep + 'BOP_CarveInterface.cpp') else: From 74b4fd26d2d1dde537a46f9237839c057cd03aaf Mon Sep 17 00:00:00 2001 From: Andrew Hale Date: Mon, 23 Jan 2012 13:29:29 +0000 Subject: [PATCH 10/10] In order to maintain consistency with other uses of .remove(), these functions will be removed and reimplemented after the BMesh merge. The main issue in an implementation of these functions is the need to constantly edit the vertex array and subsequently update the face and edge arrays. --- source/blender/makesrna/intern/rna_mesh.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index 689b19b9371..2ada09f2df1 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -1699,10 +1699,11 @@ static void rna_def_mesh_vertices(BlenderRNA *brna, PropertyRNA *cprop) func= RNA_def_function(srna, "add", "ED_mesh_vertices_add"); RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_int(func, "count", 0, 0, INT_MAX, "Count", "Number of vertices to add", 0, INT_MAX); - +#if 0 // Remove until BMesh merge func= RNA_def_function(srna, "remove", "ED_mesh_vertices_remove"); RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_int(func, "count", 0, 0, INT_MAX, "Count", "Number of vertices to remove", 0, INT_MAX); +#endif } /* mesh.edges */ @@ -1722,10 +1723,11 @@ static void rna_def_mesh_edges(BlenderRNA *brna, PropertyRNA *cprop) func= RNA_def_function(srna, "add", "ED_mesh_edges_add"); RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_int(func, "count", 0, 0, INT_MAX, "Count", "Number of edges to add", 0, INT_MAX); - +#if 0 // Remove until BMesh merge func= RNA_def_function(srna, "remove", "ED_mesh_edges_remove"); RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_int(func, "count", 0, 0, INT_MAX, "Count", "Number of edges to remove", 0, INT_MAX); +#endif } /* mesh.faces */ @@ -1755,10 +1757,11 @@ static void rna_def_mesh_faces(BlenderRNA *brna, PropertyRNA *cprop) func= RNA_def_function(srna, "add", "ED_mesh_faces_add"); RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_int(func, "count", 0, 0, INT_MAX, "Count", "Number of faces to add", 0, INT_MAX); - +#if 0 // Remove until BMesh merge func= RNA_def_function(srna, "remove", "ED_mesh_faces_remove"); RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_int(func, "count", 0, 0, INT_MAX, "Count", "Number of faces to remove", 0, INT_MAX); +#endif } /* mesh.vertex_colors */