Merging r37437 through r37478 from trunk into soc-2011-tomato

This commit is contained in:
Sergey Sharybin 2011-06-14 16:08:39 +00:00
commit 7b40210025
47 changed files with 373 additions and 242 deletions

@ -226,9 +226,6 @@ if(WITH_PYTHON_MODULE)
set(WITH_HEADLESS ON)
endif()
# remove old vars
unset(WITH_INSTALL CACHE)
TEST_SSE_SUPPORT()
#-----------------------------------------------------------------------------
@ -237,6 +234,9 @@ TEST_SSE_SUPPORT()
# linux only, not cached
set(WITH_BINRELOC OFF)
# MAXOSX only, set to avoid uninitialized
set(EXETYPE "")
# these are added to later on.
set(C_WARNINGS "")
set(CXX_WARNINGS "")

@ -18,10 +18,18 @@ set(_Python_ABI_FLAGS
"m;mu;u; ")
string(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION})
set(_Python_PATHS
"$ENV{HOME}/py${_PYTHON_VERSION_NO_DOTS}" "/opt/py${_PYTHON_VERSION_NO_DOTS}" "/usr" "/usr/local")
if(NOT DEFINED PYTHON_INCLUDE_DIRS)
set(_Python_PATHS
"$ENV{HOME}/py${_PYTHON_VERSION_NO_DOTS}"
"/opt/py${_PYTHON_VERSION_NO_DOTS}"
"/usr"
"/usr/local"
)
if(NOT DEFINED PYTHON_INCLUDE_DIRS OR
NOT DEFINED PYTHON_LIBRARY OR
NOT DEFINED PYTHON_LIBPATH)
message(STATUS "Looking for include Python.h")
set(_Found_PYTHON_H OFF)
@ -59,6 +67,14 @@ if(NOT DEFINED PYTHON_INCLUDE_DIRS)
unset(_CURRENT_ABI_FLAGS)
unset(_CURRENT_PATH)
set(PYTHON_INCLUDE_DIRS "${PYTHON}/include/python${PYTHON_VERSION}${PYTHON_ABI_FLAGS}" CACHE STRING "")
mark_as_advanced(PYTHON_INCLUDE_DIRS)
set(PYTHON_LIBRARY "python${PYTHON_VERSION}${PYTHON_ABI_FLAGS}" CACHE STRING "")
mark_as_advanced(PYTHON_LIBRARY)
set(PYTHON_LIBPATH ${PYTHON}/lib CACHE STRING "")
mark_as_advanced(PYTHON_LIBPATH)
# set(PYTHON_BINARY ${PYTHON_EXECUTABLE} CACHE STRING "")
endif()
unset(_Python_ABI_FLAGS)
@ -68,14 +84,6 @@ unset(_Python_PATHS)
# now the python versions are found
set(PYTHON_INCLUDE_DIRS "${PYTHON}/include/python${PYTHON_VERSION}${PYTHON_ABI_FLAGS}" CACHE STRING "")
mark_as_advanced(PYTHON_INCLUDE_DIRS)
set(PYTHON_LIBRARY "python${PYTHON_VERSION}${PYTHON_ABI_FLAGS}" CACHE STRING "")
mark_as_advanced(PYTHON_LIBRARY)
set(PYTHON_LIBPATH ${PYTHON}/lib CACHE STRING "")
mark_as_advanced(PYTHON_LIBPATH)
# set(PYTHON_BINARY ${PYTHON_EXECUTABLE} CACHE STRING "")
if(NOT EXISTS "${PYTHON_INCLUDE_DIRS}/Python.h")
message(FATAL_ERROR " Missing python header: ${PYTHON_INCLUDE_DIRS}/Python.h")
endif()

@ -23,15 +23,16 @@
# <pep8 compliant>
IGNORE = \
"/test/",\
"/decimate_glut_test/",\
"/BSP_GhostTest/",\
"/release/",\
"/xembed/",\
"/decimation/intern/future/",\
"/TerraplayNetwork/",\
"/ik_glut_test/"
IGNORE = (
"/test/",
"/decimate_glut_test/",
"/BSP_GhostTest/",
"/release/",
"/xembed/",
"/decimation/intern/future/",
"/TerraplayNetwork/",
"/ik_glut_test/",
)
import os
from os.path import join, dirname, normpath, abspath, splitext
@ -104,7 +105,7 @@ def cmake_get_src(f):
found = True
break
if "list(APPEND SRC" in l:
if "list(APPEND SRC" in l or ('list(APPEND ' in l and l.endswith("SRC")):
if l.endswith(")"):
raise Exception("strict formatting not kept 'list(APPEND SRC...)' on 1 line %s:%d" % (f, i))
found = True
@ -136,7 +137,9 @@ def cmake_get_src(f):
if not l:
pass
elif l.startswith("$"):
print("Cant use var '%s' %s:%d" % (l, f, i))
# assume if it ends with SRC we know about it
if not l.split("}")[0].endswith("SRC"):
print("Can't use var '%s' %s:%d" % (l, f, i))
elif len(l.split()) > 1:
raise Exception("Multi-line define '%s' %s:%d" % (l, f, i))
else:

@ -484,8 +484,8 @@ macro(blender_project_hack_post)
unset(_reset_standard_cflags_rel)
unset(_reset_standard_cxxflags_rel)
# --------------------------------------------------
# workaround for omission in cmake 2.8.4's GNU.cmake
# ------------------------------------------------------------------
# workaround for omission in cmake 2.8.4's GNU.cmake, fixed in 2.8.5
if(CMAKE_COMPILER_IS_GNUCC)
if(NOT DARWIN)
set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-isystem ")

@ -118,7 +118,7 @@ BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
BF_FREETYPE_LIB = 'freetype2ST'
BF_FREETYPE_LIBPATH = '${BF_FREETYPE}/lib'
WITH_BF_QUICKTIME = True # -DWITH_QUICKTIME
WITH_BF_QUICKTIME = False # -DWITH_QUICKTIME
BF_QUICKTIME = LIBDIR + '/QTDevWin'
BF_QUICKTIME_INC = '${BF_QUICKTIME}/CIncludes'
BF_QUICKTIME_LIB = 'qtmlClient'

@ -345,9 +345,9 @@ Utility functions
.. function:: getAverageFrameRate()
Gets the estimated average framerate
Gets the estimated/average framerate for all the active scenes, not only the current scene.
:return: The estimed average framerate in frames per second
:return: The estimated average framerate in frames per second
:rtype: float
.. function:: getBlendFileList(path = "//")

@ -710,6 +710,12 @@ Game Engine bge.types Module
Applies changes to a camera.
.. attribute:: damping
strength of of the camera following movement.
:type: float
.. attribute:: min
minimum distance to the target object maintained by the actuator.

@ -77,6 +77,10 @@ typedef struct elbeemSimulationSettings {
/* boundary types and settings for domain walls */
short domainobsType;
float domainobsPartslip;
/* what surfaces to generate */
int mFsSurfGenSetting;
/* generate speed vectors for vertices (e.g. for image based motion blur)*/
short generateVertexVectors;
/* strength of surface smoothing */
@ -108,10 +112,12 @@ typedef struct elbeemSimulationSettings {
#define OB_FLUIDSIM_PARTICLE 64
#define OB_FLUIDSIM_CONTROL 128
// defines for elbeemMesh->obstacleType below
// defines for elbeemMesh->obstacleType below (low bits) high bits (>=64) are reserved for mFsSurfGenSetting flags which are defined in solver_class.h
#define FLUIDSIM_OBSTACLE_NOSLIP 1
#define FLUIDSIM_OBSTACLE_PARTSLIP 2
#define FLUIDSIM_OBSTACLE_FREESLIP 3
#define FLUIDSIM_FSSG_NOOBS 64
#define OB_VOLUMEINIT_VOLUME 1
#define OB_VOLUMEINIT_SHELL 2

@ -182,6 +182,9 @@ int SimulationObject::initializeLbmSimulation(ntlRenderGlobals *glob)
// set initial particles
mpParts->setNumInitialParticles(mpElbeemSettings->numTracerParticles);
// surface generation flag
mpLbm->setSurfGenSettings(mpElbeemSettings->mFsSurfGenSetting);
string dinitType = string("no");
if (mpElbeemSettings->domainobsType==FLUIDSIM_OBSTACLE_PARTSLIP) dinitType = string("part");
else if(mpElbeemSettings->domainobsType==FLUIDSIM_OBSTACLE_FREESLIP) dinitType = string("free");

@ -308,6 +308,9 @@ class LbmFsgrSolver :
//! for raytracing, preprocess
void prepareVisualization( void );
/* surface generation settings */
virtual void setSurfGenSettings(short value);
protected:
//! internal quick print function (for debugging)

@ -538,6 +538,15 @@ void LbmFsgrSolver::parseAttrList()
}
/******************************************************************************
* (part of enabling chapter 6 of "Free Surface Flows with Moving and Deforming Objects for LBM")
*****************************************************************************/
void LbmFsgrSolver::setSurfGenSettings(short value)
{
mFsSurfGenSetting = value;
}
/******************************************************************************
* Initialize omegas and forces on all levels (for init/timestep change)
*****************************************************************************/

@ -271,6 +271,9 @@ class LbmSolverInterface
/*! debug object display */
virtual vector<ntlGeometryObject*> getDebugObjects() { vector<ntlGeometryObject*> empty(0); return empty; }
/* surface generation settings */
virtual void setSurfGenSettings(short value) = 0;
#if LBM_USE_GUI==1
/*! show simulation info */
virtual void debugDisplay(int) = 0;

@ -257,6 +257,7 @@ class PHYSICS_PT_domain_boundary(PhysicButtonsPanel, bpy.types.Panel):
col.prop(fluid, "slip_type", text="")
if fluid.slip_type == 'PARTIALSLIP':
col.prop(fluid, "partial_slip_factor", slider=True, text="Amount")
col.prop(fluid, "surface_noobs")
col = split.column()
col.label(text="Surface:")

@ -42,7 +42,7 @@ class SEQUENCER_HT_header(bpy.types.Header):
sub = row.row(align=True)
sub.menu("SEQUENCER_MT_view")
if (st.view_type == 'SEQUENCER') or (st.view_type == 'SEQUENCER_PREVIEW'):
if st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}:
sub.menu("SEQUENCER_MT_select")
sub.menu("SEQUENCER_MT_marker")
sub.menu("SEQUENCER_MT_add")
@ -50,17 +50,17 @@ class SEQUENCER_HT_header(bpy.types.Header):
layout.prop(st, "view_type", expand=True, text="")
if (st.view_type == 'PREVIEW') or (st.view_type == 'SEQUENCER_PREVIEW'):
if st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}:
layout.prop(st, "display_mode", expand=True, text="")
if (st.view_type == 'SEQUENCER'):
if st.view_type == 'SEQUENCER':
row = layout.row(align=True)
row.operator("sequencer.copy", text="", icon='COPYDOWN')
row.operator("sequencer.paste", text="", icon='PASTEDOWN')
layout.separator()
layout.operator("sequencer.refresh_all")
elif (st.view_type == 'SEQUENCER_PREVIEW'):
elif st.view_type == 'SEQUENCER_PREVIEW':
layout.separator()
layout.operator("sequencer.refresh_all")
layout.prop(st, "display_channel", text="Channel")
@ -101,9 +101,9 @@ class SEQUENCER_MT_view(bpy.types.Menu):
layout.separator()
if (st.view_type == 'SEQUENCER') or (st.view_type == 'SEQUENCER_PREVIEW'):
if st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}:
layout.operator("sequencer.view_all", text='View all Sequences')
if (st.view_type == 'PREVIEW') or (st.view_type == 'SEQUENCER_PREVIEW'):
if st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}:
layout.operator_context = 'INVOKE_REGION_PREVIEW'
layout.operator("sequencer.view_all_preview", text='Fit preview in window')
layout.operator("sequencer.view_zoom_ratio", text='Show preview 1:1').ratio = 1.0
@ -300,7 +300,7 @@ class SequencerButtonsPanel():
@staticmethod
def has_sequencer(context):
return (context.space_data.view_type == 'SEQUENCER') or (context.space_data.view_type == 'SEQUENCER_PREVIEW')
return (context.space_data.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'})
@classmethod
def poll(cls, context):
@ -313,7 +313,7 @@ class SequencerButtonsPanel_Output():
@staticmethod
def has_preview(context):
return (context.space_data.view_type == 'PREVIEW') or (context.space_data.view_type == 'SEQUENCER_PREVIEW')
return (context.space_data.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'})
@classmethod
def poll(cls, context):
@ -657,11 +657,17 @@ class SEQUENCER_PT_scene(SequencerButtonsPanel, bpy.types.Panel):
layout.template_ID(strip, "scene")
scene = strip.scene
if scene:
layout.prop(scene.render, "use_sequencer")
layout.label(text="Camera Override")
layout.template_ID(strip, "scene_camera")
sce = strip.scene
layout.label(text="Original frame range: %d-%d (%d)" % (sce.frame_start, sce.frame_end, sce.frame_end - sce.frame_start + 1))
if scene:
sta = scene.frame_start
end = scene.frame_end
layout.label(text="Original frame range: %d-%d (%d)" % (sta, end, end - sta + 1))
class SEQUENCER_PT_filter(SequencerButtonsPanel, bpy.types.Panel):

@ -94,7 +94,7 @@ class USERPREF_HT_header(bpy.types.Header):
layout.operator("wm.keyconfig_import")
elif userpref.active_section == 'ADDONS':
layout.operator("wm.addon_install")
layout.menu("USERPREF_MT_addons_dev_guides", text=" Addons Developer Guides", icon='INFO')
layout.menu("USERPREF_MT_addons_dev_guides")
elif userpref.active_section == 'THEMES':
layout.operator("ui.reset_default_theme")
@ -847,17 +847,14 @@ class USERPREF_PT_input(bpy.types.Panel, InputKeyMapPanel):
class USERPREF_MT_addons_dev_guides(bpy.types.Menu):
bl_label = "Addons develoment guides"
bl_label = "Develoment Guides"
# menu to open webpages with addons development guides
def draw(self, context):
layout = self.layout
layout.operator('wm.url_open', text='API Concepts'
).url = 'http://wiki.blender.org/index.php/Dev:2.5/Py/API/Intro'
layout.operator('wm.url_open', text='Addons guidelines',
).url = 'http://wiki.blender.org/index.php/Dev:2.5/Py/Scripts/Guidelines/Addons'
layout.operator('wm.url_open', text='How to share your addon',
).url = 'http://wiki.blender.org/index.php/Dev:Py/Sharing'
layout.operator('wm.url_open', text='API Concepts', icon='URL').url = 'http://wiki.blender.org/index.php/Dev:2.5/Py/API/Intro'
layout.operator('wm.url_open', text='Addon Guidelines', icon='URL').url = 'http://wiki.blender.org/index.php/Dev:2.5/Py/Scripts/Guidelines/Addons'
layout.operator('wm.url_open', text='How to share your addon', icon='URL').url = 'http://wiki.blender.org/index.php/Dev:Py/Sharing'
class USERPREF_PT_addons(bpy.types.Panel):

@ -51,22 +51,23 @@ struct GHash;
/* **** DAG relation types *** */
/* scene link to object */
#define DAG_RL_SCENE 1
#define DAG_RL_SCENE (1<<0)
/* object link to data */
#define DAG_RL_DATA 2
#define DAG_RL_DATA (1<<1)
/* object changes object (parent, track, constraints) */
#define DAG_RL_OB_OB 4
#define DAG_RL_OB_OB (1<<2)
/* object changes obdata (hooks, constraints) */
#define DAG_RL_OB_DATA 8
#define DAG_RL_OB_DATA (1<<3)
/* data changes object (vertex parent) */
#define DAG_RL_DATA_OB 16
#define DAG_RL_DATA_OB (1<<4)
/* data changes data (deformers) */
#define DAG_RL_DATA_DATA 32
#define DAG_RL_DATA_DATA (1<<5)
#define DAG_NO_RELATION 64
#define DAG_RL_ALL 63
#define DAG_RL_ALL_BUT_DATA 61
#define DAG_NO_RELATION (1<<6)
#define DAG_RL_ALL_BUT_DATA (DAG_RL_SCENE|DAG_RL_OB_OB|DAG_RL_OB_DATA|DAG_RL_DATA_OB|DAG_RL_DATA_DATA)
#define DAG_RL_ALL (DAG_RL_ALL_BUT_DATA|DAG_RL_DATA)
typedef void (*graph_action_func)(void * ob, void **data);

@ -430,6 +430,7 @@ void init_actuator(bActuator *act)
act->data= MEM_callocN(sizeof(bCameraActuator), "camact");
ca = act->data;
ca->axis = ACT_CAMERA_X;
ca->damping = 1.0/32.0;
break;
case ACT_EDIT_OBJECT:
act->data= MEM_callocN(sizeof(bEditObjectActuator), "editobact");

@ -11758,6 +11758,21 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
}
{
/* add default value for behind strength of camera actuator */
Object *ob;
bActuator *act;
for(ob = main->object.first; ob; ob= ob->id.next) {
for(act= ob->actuators.first; act; act= act->next) {
if (act->type == ACT_CAMERA) {
bCameraActuator *ba= act->data;
ba->damping = 1.0/32.0;
}
}
}
}
}
/* WATCH IT!!!: pointers from libdata have not been converted yet here! */

@ -959,12 +959,12 @@ bool DocumentImporter::writeLight( const COLLADAFW::Light* light )
if(IS_EQ(linatt, 0.0f) && quadatt > 0.0f) {
att2 = quadatt;
d = (1.0f/quadatt) * 2;
d = sqrt(1.0f/quadatt);
}
// linear light
else if(IS_EQ(quadatt, 0.0f) && linatt > 0.0f) {
att1 = linatt;
d = (1.0f/linatt) * 2;
d = (1.0f/linatt);
} else if (IS_EQ(constatt, 1.0f)) {
att1 = 1.0f;
} else {
@ -987,9 +987,12 @@ bool DocumentImporter::writeLight( const COLLADAFW::Light* light )
case COLLADAFW::Light::SPOT_LIGHT:
{
lamp->type = LA_SPOT;
lamp->falloff_type = LA_FALLOFF_INVSQUARE;
lamp->att1 = att1;
lamp->att2 = att2;
if(IS_EQ(att1, 0.0f) && att2 > 0)
lamp->falloff_type = LA_FALLOFF_INVSQUARE;
if(IS_EQ(att2, 0.0f) && att1 > 0)
lamp->falloff_type = LA_FALLOFF_INVLINEAR;
lamp->spotsize = light->getFallOffAngle().getValue();
lamp->spotblend = light->getFallOffExponent().getValue();
}
@ -1004,9 +1007,12 @@ bool DocumentImporter::writeLight( const COLLADAFW::Light* light )
case COLLADAFW::Light::POINT_LIGHT:
{
lamp->type = LA_LOCAL;
lamp->falloff_type = LA_FALLOFF_INVSQUARE;
lamp->att1 = att1;
lamp->att2 = att2;
if(IS_EQ(att1, 0.0f) && att2 > 0)
lamp->falloff_type = LA_FALLOFF_INVSQUARE;
if(IS_EQ(att2, 0.0f) && att1 > 0)
lamp->falloff_type = LA_FALLOFF_INVLINEAR;
}
break;
case COLLADAFW::Light::UNDEFINED:

@ -68,20 +68,18 @@ void LightsExporter::operator()(Object *ob)
std::string la_name(id_name(la));
COLLADASW::Color col(la->r * la->energy, la->g * la->energy, la->b * la->energy);
float e, d, constatt, linatt, quadatt;
float r;
d = la->dist;
r = d/2.0f;
constatt = 1.0f;
if(la->falloff_type==LA_FALLOFF_INVLINEAR) {
linatt = 1.0f / r;
linatt = 1.0f / d;
quadatt = 0.0f;
}
else {
linatt = 0.0f;
quadatt = 1.0f / r;
quadatt = 1.0f / (d * d);
}
// sun

@ -2601,6 +2601,7 @@ static void widget_box(uiBut *but, uiWidgetColors *wcol, rcti *rect, int UNUSED(
/* store the box bg as gl clearcolor, to retrieve later when drawing semi-transparent rects
* over the top to indicate disabled buttons */
/* XXX, this doesnt work right since the color applies to buttons outside the box too. */
glClearColor(wcol->inner[0]/255.0, wcol->inner[1]/255.0, wcol->inner[2]/255.0, 1.0);
VECCOPY(wcol->inner, old_col);

@ -399,6 +399,13 @@ int ED_object_modifier_convert(ReportList *UNUSED(reports), Main *bmain, Scene *
static int modifier_apply_shape(ReportList *reports, Scene *scene, Object *ob, ModifierData *md)
{
ModifierTypeInfo *mti= modifierType_getInfo(md->type);
if (mti->isDisabled && mti->isDisabled(md, 0)) {
BKE_report(reports, RPT_ERROR, "Modifier is disabled, skipping apply");
return 0;
}
if (ob->type==OB_MESH) {
DerivedMesh *dm;
Mesh *me= ob->data;
@ -442,7 +449,7 @@ static int modifier_apply_obdata(ReportList *reports, Scene *scene, Object *ob,
{
ModifierTypeInfo *mti= modifierType_getInfo(md->type);
if (!(md->mode&eModifierMode_Realtime) || (mti->isDisabled && mti->isDisabled(md, 0))) {
if (mti->isDisabled && mti->isDisabled(md, 0)) {
BKE_report(reports, RPT_ERROR, "Modifier is disabled, skipping apply");
return 0;
}
@ -530,6 +537,8 @@ static int modifier_apply_obdata(ReportList *reports, Scene *scene, Object *ob,
int ED_object_modifier_apply(ReportList *reports, Scene *scene, Object *ob, ModifierData *md, int mode)
{
int prev_mode;
if (scene->obedit) {
BKE_report(reports, RPT_ERROR, "Modifiers cannot be applied in editmode");
return 0;
@ -541,13 +550,21 @@ int ED_object_modifier_apply(ReportList *reports, Scene *scene, Object *ob, Modi
if (md!=ob->modifiers.first)
BKE_report(reports, RPT_INFO, "Applied modifier was not first, result may not be as expected.");
/* allow apply of a not-realtime modifier, by first re-enabling realtime. */
prev_mode= md->mode;
md->mode |= eModifierMode_Realtime;
if (mode == MODIFIER_APPLY_SHAPE) {
if (!modifier_apply_shape(reports, scene, ob, md))
if (!modifier_apply_shape(reports, scene, ob, md)) {
md->mode= prev_mode;
return 0;
}
} else {
if (!modifier_apply_obdata(reports, scene, ob, md))
if (!modifier_apply_obdata(reports, scene, ob, md)) {
md->mode= prev_mode;
return 0;
}
}
BLI_remlink(&ob->modifiers, md);
modifier_free(md);

@ -56,6 +56,7 @@
#include "DNA_object_fluidsim.h"
#include "BLI_blenlib.h"
#include "BLI_fileops.h"
#include "BLI_threads.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
@ -125,7 +126,7 @@ static void get_fluid_gravity(float *gravity, Scene *scene, FluidsimSettings *fs
if (scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY) {
copy_v3_v3(gravity, scene->physics_settings.gravity);
} else {
copy_v3_v3(gravity, &fss->gravx);
copy_v3_v3(gravity, fss->grav);
}
}
@ -443,7 +444,7 @@ static void fluid_init_all_channels(bContext *C, Object *UNUSED(fsDomain), Fluid
Object *ob = fobj->object;
FluidsimModifierData *fluidmd = (FluidsimModifierData *)modifiers_findByType(ob, eModifierType_Fluidsim);
float active= (float)(fluidmd->fss->flag & OB_FLUIDSIM_ACTIVE);
float rot_d[3], old_rot[3] = {0.f, 0.f, 0.f};
float rot_d[3] = {0.f, 0.f, 0.f}, old_rot[3] = {0.f, 0.f, 0.f};
if (ELEM(fluidmd->fss->type, OB_FLUIDSIM_DOMAIN, OB_FLUIDSIM_PARTICLE))
continue;
@ -809,6 +810,44 @@ static void fluidbake_free_data(FluidAnimChannels *channels, ListBase *fobjects,
}
}
/* copied from rna_fluidsim.c: fluidsim_find_lastframe() */
static void fluidsim_delete_until_lastframe(FluidsimSettings *fss)
{
char targetDir[FILE_MAXFILE+FILE_MAXDIR], targetFile[FILE_MAXFILE+FILE_MAXDIR];
char targetDirVel[FILE_MAXFILE+FILE_MAXDIR], targetFileVel[FILE_MAXFILE+FILE_MAXDIR];
char previewDir[FILE_MAXFILE+FILE_MAXDIR], previewFile[FILE_MAXFILE+FILE_MAXDIR];
int curFrame = 1, exists = 0;
BLI_snprintf(targetDir, sizeof(targetDir), "%sfluidsurface_final_####.bobj.gz", fss->surfdataPath);
BLI_snprintf(targetDirVel, sizeof(targetDir), "%sfluidsurface_final_####.bvel.gz", fss->surfdataPath);
BLI_snprintf(previewDir, sizeof(targetDir), "%sfluidsurface_preview_####.bobj.gz", fss->surfdataPath);
BLI_path_abs(targetDir, G.main->name);
BLI_path_abs(targetDirVel, G.main->name);
BLI_path_abs(previewDir, G.main->name);
do {
BLI_strncpy(targetFile, targetDir, sizeof(targetFile));
BLI_strncpy(targetFileVel, targetDirVel, sizeof(targetFileVel));
BLI_strncpy(previewFile, previewDir, sizeof(previewFile));
BLI_path_frame(targetFile, curFrame, 0);
BLI_path_frame(targetFileVel, curFrame, 0);
BLI_path_frame(previewFile, curFrame, 0);
curFrame++;
if((exists = BLI_exist(targetFile)))
{
BLI_delete(targetFile, 0, 0);
BLI_delete(targetFileVel, 0, 0);
BLI_delete(previewFile, 0, 0);
}
} while(exists);
return;
}
static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain)
{
Scene *scene= CTX_data_scene(C);
@ -879,6 +918,9 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain)
// reset last valid frame
domainSettings->lastgoodframe = -1;
/* delete old baked files */
fluidsim_delete_until_lastframe(domainSettings);
/* rough check of settings... */
if(domainSettings->previewresxyz > domainSettings->resolutionxyz) {
snprintf(debugStrBuffer,256,"fluidsimBake::warning - Preview (%d) >= Resolution (%d)... setting equal.\n", domainSettings->previewresxyz , domainSettings->resolutionxyz);
@ -1018,6 +1060,13 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain)
else if (domainSettings->typeFlags&OB_FSBND_PARTSLIP) fsset->domainobsType = FLUIDSIM_OBSTACLE_PARTSLIP;
else if (domainSettings->typeFlags&OB_FSBND_FREESLIP) fsset->domainobsType = FLUIDSIM_OBSTACLE_FREESLIP;
fsset->domainobsPartslip = domainSettings->partSlipValue;
/* use domainobsType also for surface generation flag (bit: >=64) */
if(domainSettings->typeFlags & OB_FSSG_NOOBS)
fsset->mFsSurfGenSetting = FLUIDSIM_FSSG_NOOBS;
else
fsset->mFsSurfGenSetting = 0; // "normal" mode
fsset->generateVertexVectors = (domainSettings->domainNovecgen==0);
// init blender domain transform matrix

@ -3786,6 +3786,8 @@ static void draw_actuator_camera(uiLayout *layout, PointerRNA *ptr)
row = uiLayoutRow(layout, 1);
uiItemR(row, ptr, "min", 0, NULL, ICON_NONE);
uiItemR(row, ptr, "max", 0, NULL, ICON_NONE);
uiItemR(layout, ptr, "damping", 0, NULL, ICON_NONE);
}
static void draw_actuator_constraint(uiLayout *layout, PointerRNA *ptr, bContext *C)

@ -288,7 +288,7 @@ static void node_update(const bContext *C, bNodeTree *ntree, bNode *node)
RNA_pointer_create(&ntree->id, &RNA_Node, node, &ptr);
layout= uiBlockLayout(node->block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL,
node->locx+NODE_DYS, dy, node->butr.xmax, 20, U.uistyles.first);
node->locx+NODE_DYS, dy, node->butr.xmax, NODE_DY, U.uistyles.first);
node->typeinfo->uifunc(layout, (bContext *)C, &ptr);
uiBlockEndAlign(node->block);
@ -392,6 +392,7 @@ static void node_update_group(const bContext *C, bNodeTree *UNUSED(ntree), bNode
bNode *node;
bNodeSocket *sock, *gsock;
rctf *rect= &gnode->totr;
float node_group_frame= U.dpi*NODE_GROUP_FRAME/72;
int counter;
int dy;
@ -430,7 +431,7 @@ static void node_update_group(const bContext *C, bNodeTree *UNUSED(ntree), bNode
dy = 0.5f*(rect->ymin+rect->ymax) + NODE_DY*(BLI_countlist(&gnode->inputs)-1);
for(gsock=ngroup->inputs.first, sock=gnode->inputs.first; gsock; gsock=gsock->next, sock=sock->next) {
gsock->locx = rect->xmin;
sock->locx = rect->xmin - NODE_GROUP_FRAME;
sock->locx = rect->xmin - node_group_frame;
sock->locy = gsock->locy = dy;
/* prevent long socket lists from growing out of the group box */
@ -446,7 +447,7 @@ static void node_update_group(const bContext *C, bNodeTree *UNUSED(ntree), bNode
dy = 0.5f*(rect->ymin+rect->ymax) + NODE_DY*(BLI_countlist(&gnode->outputs)-1);
for(gsock=ngroup->outputs.first, sock=gnode->outputs.first; gsock; gsock=gsock->next, sock=sock->next) {
gsock->locx = rect->xmax;
sock->locx = rect->xmax + NODE_GROUP_FRAME;
sock->locx = rect->xmax + node_group_frame;
sock->locy = gsock->locy = dy - NODE_DYS;
/* prevent long socket lists from growing out of the group box */
@ -654,7 +655,7 @@ static uiBlock *socket_vector_menu(bContext *C, ARegion *ar, void *args_v)
block= uiBeginBlock(C, ar, "socket menu", UI_EMBOSS);
uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN);
layout= uiLayoutColumn(uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, args->x, args->y+2, args->width, 20, U.uistyles.first), 0);
layout= uiLayoutColumn(uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, args->x, args->y+2, args->width, NODE_DY, U.uistyles.first), 0);
uiItemR(layout, &args->ptr, "default_value", UI_ITEM_R_EXPAND, "", ICON_NONE);
@ -675,7 +676,7 @@ static void node_draw_socket_button(bNodeTree *ntree, bNodeSocket *sock, const c
switch (sock->type) {
case SOCK_VALUE:
bt=uiDefButR(block, NUM, B_NODE_EXEC, name,
x, y+1, width, 17,
x, y+1, width, NODE_DY-2,
&ptr, "default_value", 0, sock->ns.min, sock->ns.max, -1, -1, NULL);
if (cb)
uiButSetFunc(bt, cb, arg1, arg2);
@ -693,7 +694,7 @@ static void node_draw_socket_button(bNodeTree *ntree, bNodeSocket *sock, const c
args->arg2 = arg2;
uiDefBlockButN(block, socket_vector_menu, args, name,
x, y+1, width, 17,
x, y+1, width, NODE_DY-2,
"");
break;
@ -701,14 +702,14 @@ static void node_draw_socket_button(bNodeTree *ntree, bNodeSocket *sock, const c
labelw= width - 40;
bt=uiDefButR(block, COL, B_NODE_EXEC, "",
x, y+2, (labelw>0 ? 40 : width), 15,
x, y+2, (labelw>0 ? 40 : width), NODE_DY-2,
&ptr, "default_value", 0, sock->ns.min, sock->ns.max, -1, -1, NULL);
if (cb)
uiButSetFunc(bt, cb, arg1, arg2);
if (name[0]!='\0' && labelw>0)
uiDefBut(block, LABEL, 0, name,
x + 40, y+2, labelw, 15,
x + 40, y+2, labelw, NODE_DY-2,
NULL, 0, 0, 0, 0, "");
break;
}
@ -719,6 +720,8 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
bNodeSocket *sock;
rctf *rct= &node->totr;
float iconofs;
float socket_size= NODE_SOCKSIZE*U.dpi/72;
float iconbutw= 0.8f*UI_UNIT_X;
int color_id= node_get_colorid(node);
char showname[128]; /* 128 used below */
View2D *v2d = &ar->v2d;
@ -761,32 +764,32 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
icon_id= ICON_MATERIAL;
else
icon_id= ICON_MATERIAL_DATA;
iconofs-=15.0f;
iconofs-=iconbutw;
uiDefIconBut(node->block, LABEL, B_REDR, icon_id, iconofs, rct->ymax-NODE_DY,
UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 1.0, 0.5, "");
iconbutw, UI_UNIT_Y, NULL, 0.0, 0.0, 1.0, 0.5, "");
}
if(node->type == NODE_GROUP) {
iconofs-=15.0f;
iconofs-=iconbutw;
uiDefIconBut(node->block, LABEL, B_REDR, ICON_NODETREE, iconofs, rct->ymax-NODE_DY,
UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 1.0, 0.5, "");
iconbutw, UI_UNIT_Y, NULL, 0.0, 0.0, 1.0, 0.5, "");
}
if(node->typeinfo->flag & NODE_OPTIONS) {
iconofs-=15.0f;
iconofs-=iconbutw;
uiDefIconBut(node->block, LABEL, B_REDR, ICON_BUTS, iconofs, rct->ymax-NODE_DY,
UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 1.0, 0.5, "");
iconbutw, UI_UNIT_Y, NULL, 0.0, 0.0, 1.0, 0.5, "");
}
{ /* always hide/reveal unused sockets */
int shade;
iconofs-=15.0f;
iconofs-=iconbutw;
// XXX re-enable
/*if(node_has_hidden_sockets(node))
shade= -40;
else*/
shade= -90;
uiDefIconBut(node->block, LABEL, B_REDR, ICON_PLUS, iconofs, rct->ymax-NODE_DY,
UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 1.0, 0.5, "");
iconbutw, UI_UNIT_Y, NULL, 0.0, 0.0, 1.0, 0.5, "");
}
/* title */
@ -851,7 +854,7 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
/* socket inputs, buttons */
for(sock= node->inputs.first; sock; sock= sock->next) {
if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) {
socket_circle_draw(sock, NODE_SOCKSIZE);
socket_circle_draw(sock, socket_size);
if(node->block && sock->link==NULL) {
node_draw_socket_button(ntree, sock, sock->name, node->block, sock->locx+NODE_DYS, sock->locy-NODE_DYS, node->width-NODE_DY, node_sync_cb, snode, node);
@ -869,7 +872,7 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
float slen;
int ofs= 0;
socket_circle_draw(sock, NODE_SOCKSIZE);
socket_circle_draw(sock, socket_size);
UI_ThemeColor(TH_TEXT);
slen= snode->aspect*UI_GetStringWidth(sock->name);
@ -904,6 +907,7 @@ static void node_draw_hidden(const bContext *C, ARegion *ar, SpaceNode *snode, b
rctf *rct= &node->totr;
float dx, centy= 0.5f*(rct->ymax+rct->ymin);
float hiddenrad= 0.5f*(rct->ymax-rct->ymin);
float socket_size= NODE_SOCKSIZE*U.dpi/72;
int color_id= node_get_colorid(node);
char showname[128]; /* 128 is used below */
@ -978,12 +982,12 @@ static void node_draw_hidden(const bContext *C, ARegion *ar, SpaceNode *snode, b
/* sockets */
for(sock= node->inputs.first; sock; sock= sock->next) {
if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL)))
socket_circle_draw(sock, NODE_SOCKSIZE);
socket_circle_draw(sock, socket_size);
}
for(sock= node->outputs.first; sock; sock= sock->next) {
if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL)))
socket_circle_draw(sock, NODE_SOCKSIZE);
socket_circle_draw(sock, socket_size);
}
uiEndBlock(C, node->block);
@ -1043,17 +1047,30 @@ static void node_draw_group(const bContext *C, ARegion *ar, SpaceNode *snode, bN
{
bNodeTree *ngroup= (bNodeTree *)gnode->id;
bNodeSocket *sock;
rctf rect= gnode->totr;
int index;
uiLayout *layout;
PointerRNA ptr;
uiBut *bt;
rctf rect= gnode->totr;
float socket_size= NODE_SOCKSIZE*U.dpi/72;
float node_group_frame= U.dpi*NODE_GROUP_FRAME/72;
float group_header= 26*U.dpi/72;
float arrowbutw= 0.8f*UI_UNIT_X;
/* layout stuff for buttons on group left frame */
float col1= 6, colw1= 0.6f*node_group_frame;
float col2= col1 + colw1+6;
float col3= node_group_frame - arrowbutw - 6;
/* layout stuff for buttons on group right frame */
float cor1= 6;
float cor2= cor1 + arrowbutw + 6;
float cor3= cor2 + arrowbutw + 6, corw3= node_group_frame - cor3-6;
int index;
/* backdrop header */
glEnable(GL_BLEND);
uiSetRoundBox(3);
UI_ThemeColorShadeAlpha(TH_NODE_GROUP, 0, -70);
uiDrawBox(GL_POLYGON, rect.xmin-NODE_GROUP_FRAME, rect.ymax, rect.xmax+NODE_GROUP_FRAME, rect.ymax+26, BASIS_RAD);
uiDrawBox(GL_POLYGON, rect.xmin-node_group_frame, rect.ymax, rect.xmax+node_group_frame, rect.ymax+group_header, BASIS_RAD);
/* backdrop body */
UI_ThemeColorShadeAlpha(TH_BACK, -8, -70);
@ -1063,12 +1080,12 @@ static void node_draw_group(const bContext *C, ARegion *ar, SpaceNode *snode, bN
/* input column */
UI_ThemeColorShadeAlpha(TH_BACK, 10, -50);
uiSetRoundBox(8);
uiDrawBox(GL_POLYGON, rect.xmin-NODE_GROUP_FRAME, rect.ymin, rect.xmin, rect.ymax, BASIS_RAD);
uiDrawBox(GL_POLYGON, rect.xmin-node_group_frame, rect.ymin, rect.xmin, rect.ymax, BASIS_RAD);
/* output column */
UI_ThemeColorShadeAlpha(TH_BACK, 10, -50);
uiSetRoundBox(4);
uiDrawBox(GL_POLYGON, rect.xmax, rect.ymin, rect.xmax+NODE_GROUP_FRAME, rect.ymax, BASIS_RAD);
uiDrawBox(GL_POLYGON, rect.xmax, rect.ymin, rect.xmax+node_group_frame, rect.ymax, BASIS_RAD);
/* input column separator */
glColor4ub(200, 200, 200, 140);
@ -1088,15 +1105,15 @@ static void node_draw_group(const bContext *C, ARegion *ar, SpaceNode *snode, bN
uiSetRoundBox(15);
glColor4ub(200, 200, 200, 140);
glEnable( GL_LINE_SMOOTH );
uiDrawBox(GL_LINE_LOOP, rect.xmin-NODE_GROUP_FRAME, rect.ymin, rect.xmax+NODE_GROUP_FRAME, rect.ymax+26, BASIS_RAD);
uiDrawBox(GL_LINE_LOOP, rect.xmin-node_group_frame, rect.ymin, rect.xmax+node_group_frame, rect.ymax+group_header, BASIS_RAD);
glDisable( GL_LINE_SMOOTH );
glDisable(GL_BLEND);
/* backdrop title */
UI_ThemeColor(TH_TEXT_HI);
layout = uiBlockLayout(gnode->block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, (short)(rect.xmin+15), (short)(rect.ymax+23),
MIN2((int)(rect.xmax - rect.xmin-18.0f), 140), 20, U.uistyles.first);
layout = uiBlockLayout(gnode->block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, (short)(rect.xmin+15), (short)(rect.ymax+group_header),
MIN2((int)(rect.xmax - rect.xmin-18.0f), node_group_frame+20), group_header, U.uistyles.first);
RNA_pointer_create(&ntree->id, &RNA_Node, gnode, &ptr);
uiTemplateIDBrowse(layout, (bContext*)C, &ptr, "node_tree", NULL, NULL, NULL);
uiBlockLayoutResolve(gnode->block, NULL, NULL);
@ -1106,31 +1123,33 @@ static void node_draw_group(const bContext *C, ARegion *ar, SpaceNode *snode, bN
/* group sockets */
for(sock=ngroup->inputs.first, index=0; sock; sock=sock->next, ++index) {
socket_circle_draw(sock, NODE_SOCKSIZE);
float locx= sock->locx - node_group_frame;
socket_circle_draw(sock, socket_size);
/* small hack to use socket_circle_draw function with offset */
sock->locx -= NODE_GROUP_FRAME;
socket_circle_draw(sock, NODE_SOCKSIZE);
sock->locx += NODE_GROUP_FRAME;
sock->locx -= node_group_frame;
socket_circle_draw(sock, socket_size);
sock->locx += node_group_frame;
bt = uiDefBut(gnode->block, TEX, 0, "",
sock->locx-114, sock->locy+1, 72, NODE_DY,
locx+col1, sock->locy+1, colw1, NODE_DY,
sock->name, 0, 31, 0, 0, "");
uiButSetFunc(bt, group_verify_cb, snode, ngroup);
node_draw_socket_button(ngroup, sock, "", gnode->block,
sock->locx-114, sock->locy-NODE_DY, 72,
locx+col1, sock->locy-NODE_DY, colw1,
NULL, NULL, NULL);
uiBlockSetDirection(gnode->block, UI_TOP);
uiBlockBeginAlign(gnode->block);
bt = uiDefIconButO(gnode->block, BUT, "NODE_OT_group_socket_move_up", 0, ICON_TRIA_UP,
sock->locx-40, sock->locy, 16, 16, "");
locx+col2, sock->locy, arrowbutw, arrowbutw, "");
if (!sock->prev)
uiButSetFlag(bt, UI_BUT_DISABLED);
RNA_int_set(uiButGetOperatorPtrRNA(bt), "index", index);
RNA_enum_set(uiButGetOperatorPtrRNA(bt), "in_out", SOCK_IN);
bt = uiDefIconButO(gnode->block, BUT, "NODE_OT_group_socket_move_down", 0, ICON_TRIA_DOWN,
sock->locx-40, sock->locy-16, 16, 16, "");
locx+col2, sock->locy-arrowbutw, arrowbutw, arrowbutw, "");
if (!sock->next)
uiButSetFlag(bt, UI_BUT_DISABLED);
RNA_int_set(uiButGetOperatorPtrRNA(bt), "index", index);
@ -1140,22 +1159,24 @@ static void node_draw_group(const bContext *C, ARegion *ar, SpaceNode *snode, bN
uiBlockSetEmboss(gnode->block, UI_EMBOSSN);
bt = uiDefIconButO(gnode->block, BUT, "NODE_OT_group_socket_remove", 0, ICON_X,
sock->locx-22, sock->locy-8, 16, 16, "");
locx+col3, sock->locy-0.5f*arrowbutw, arrowbutw, arrowbutw, "");
RNA_int_set(uiButGetOperatorPtrRNA(bt), "index", index);
RNA_enum_set(uiButGetOperatorPtrRNA(bt), "in_out", SOCK_IN);
uiBlockSetEmboss(gnode->block, UI_EMBOSS);
}
for(sock=ngroup->outputs.first, index=0; sock; sock=sock->next, ++index) {
socket_circle_draw(sock, NODE_SOCKSIZE);
float locx= sock->locx;
socket_circle_draw(sock, socket_size);
/* small hack to use socket_circle_draw function with offset */
sock->locx += NODE_GROUP_FRAME;
socket_circle_draw(sock, NODE_SOCKSIZE);
sock->locx -= NODE_GROUP_FRAME;
sock->locx += node_group_frame;
socket_circle_draw(sock, socket_size);
sock->locx -= node_group_frame;
uiBlockSetEmboss(gnode->block, UI_EMBOSSN);
bt = uiDefIconButO(gnode->block, BUT, "NODE_OT_group_socket_remove", 0, ICON_X,
sock->locx+6, sock->locy-8, 16, 16, "");
locx+col1, sock->locy-0.5f*arrowbutw, arrowbutw, arrowbutw, "");
RNA_int_set(uiButGetOperatorPtrRNA(bt), "index", index);
RNA_enum_set(uiButGetOperatorPtrRNA(bt), "in_out", SOCK_OUT);
uiBlockSetEmboss(gnode->block, UI_EMBOSS);
@ -1163,13 +1184,13 @@ static void node_draw_group(const bContext *C, ARegion *ar, SpaceNode *snode, bN
uiBlockSetDirection(gnode->block, UI_TOP);
uiBlockBeginAlign(gnode->block);
bt = uiDefIconButO(gnode->block, BUT, "NODE_OT_group_socket_move_up", 0, ICON_TRIA_UP,
sock->locx+24, sock->locy, 16, 16, "");
locx+cor2, sock->locy, arrowbutw, arrowbutw, "");
if (!sock->prev)
uiButSetFlag(bt, UI_BUT_DISABLED);
RNA_int_set(uiButGetOperatorPtrRNA(bt), "index", index);
RNA_enum_set(uiButGetOperatorPtrRNA(bt), "in_out", SOCK_OUT);
bt = uiDefIconButO(gnode->block, BUT, "NODE_OT_group_socket_move_down", 0, ICON_TRIA_DOWN,
sock->locx+24, sock->locy-16, 16, 16, "");
locx+cor2, sock->locy-arrowbutw, arrowbutw, arrowbutw, "");
if (!sock->next)
uiButSetFlag(bt, UI_BUT_DISABLED);
RNA_int_set(uiButGetOperatorPtrRNA(bt), "index", index);
@ -1179,17 +1200,17 @@ static void node_draw_group(const bContext *C, ARegion *ar, SpaceNode *snode, bN
if (sock->link) {
bt = uiDefBut(gnode->block, TEX, 0, "",
sock->locx+42, sock->locy-NODE_DYS+1, 72, NODE_DY,
locx+cor3, sock->locy-NODE_DYS+1, corw3, NODE_DY,
sock->name, 0, 31, 0, 0, "");
uiButSetFunc(bt, group_verify_cb, snode, ngroup);
}
else {
bt = uiDefBut(gnode->block, TEX, 0, "",
sock->locx+42, sock->locy+1, 72, NODE_DY,
locx+cor3, sock->locy+1, corw3, NODE_DY,
sock->name, 0, 31, 0, 0, "");
uiButSetFunc(bt, group_verify_cb, snode, ngroup);
node_draw_socket_button(ngroup, sock, "", gnode->block, sock->locx+42, sock->locy-NODE_DY, 72, NULL, NULL, NULL);
node_draw_socket_button(ngroup, sock, "", gnode->block, locx+cor3, sock->locy-NODE_DY, corw3, NULL, NULL, NULL);
}
}

@ -1332,7 +1332,7 @@ static int node_resize_modal(bContext *C, wmOperator *op, wmEvent *event)
}
else {
node->width= nsw->oldwidth + mx - nsw->mxstart;
CLAMP(node->width, node->typeinfo->minwidth, node->typeinfo->maxwidth);
CLAMP(node->width, UI_DPI_FAC*node->typeinfo->minwidth, UI_DPI_FAC*node->typeinfo->maxwidth);
}
}

@ -152,8 +152,8 @@ extern const char *node_context_dir[];
// XXX from BSE_node.h
#define HIDDEN_RAD 15.0f
#define BASIS_RAD 8.0f
#define NODE_DYS 10
#define NODE_DY 20
#define NODE_DYS (U.widget_unit/2)
#define NODE_DY U.widget_unit
#define NODE_SOCKSIZE 5
// XXX button events (butspace)

@ -678,8 +678,9 @@ void recalcData(TransInfo *t)
EditMesh *em = ((Mesh*)t->obedit->data)->edit_mesh;
/* mirror modifier clipping? */
if(t->state != TRANS_CANCEL) {
clipMirrorModifier(t, t->obedit);
/* apply clipping after so we never project past the clip plane [#25423] */
applyProject(t);
clipMirrorModifier(t, t->obedit);
}
if((t->options & CTX_NO_MIRROR) == 0 && (t->flag & T_MIRROR))
editmesh_apply_to_mirror(t);

@ -106,10 +106,6 @@ void ED_editors_exit(bContext *C)
if(sce->obedit) {
Object *ob= sce->obedit;
/* global in meshtools... */
mesh_octree_table(NULL, NULL, NULL, 'e');
mesh_mirrtopo_table(NULL, 'e');
if(ob) {
if(ob->type==OB_MESH) {
Mesh *me= ob->data;
@ -122,27 +118,14 @@ void ED_editors_exit(bContext *C)
else if(ob->type==OB_ARMATURE) {
ED_armature_edit_free(ob);
}
else if(ob->type==OB_FONT) {
// free_editText();
}
// else if(ob->type==OB_MBALL)
// BLI_freelistN(&editelems);
// free_editLatt();
// free_posebuf(); // XXX this is still a global...
}
}
else if(sce->basact && sce->basact->object) {
Object *ob= sce->basact->object;
}
/* if weight-painting is on, free mesh octree data */
if(ob->mode & OB_MODE_WEIGHT_PAINT) {
/* global in meshtools... */
mesh_octree_table(NULL, NULL, NULL, 'e');
mesh_mirrtopo_table(NULL, 'e');
}
}
}
}
/* ***** XXX: functions are using old blender names, cleanup later ***** */

@ -156,11 +156,11 @@ static int ed_undo_step(bContext *C, int step, const char *undoname)
int do_glob_undo= 0;
if(obact && obact->mode & OB_MODE_TEXTURE_PAINT) {
if(!ED_undo_paint_step(C, UNDO_PAINT_IMAGE, step, undoname) && undoname)
if(!ED_undo_paint_step(C, UNDO_PAINT_IMAGE, step, undoname))
do_glob_undo= 1;
}
else if(obact && obact->mode & OB_MODE_SCULPT) {
if(!ED_undo_paint_step(C, UNDO_PAINT_MESH, step, undoname) && undoname)
if(!ED_undo_paint_step(C, UNDO_PAINT_MESH, step, undoname))
do_glob_undo= 1;
}
else if(obact && obact->mode & OB_MODE_PARTICLE_EDIT) {

@ -133,7 +133,7 @@ typedef struct bIpoActuator {
typedef struct bCameraActuator {
struct Object *ob;
float height, min, max;
float pad;
float damping;
short pad1, axis;
float pad2;
} bCameraActuator ;

@ -69,7 +69,7 @@ typedef struct FluidsimSettings {
short viscosityMode;
short viscosityExponent;
/* gravity strength */
float gravx,gravy,gravz;
float grav[3];
/* anim start end time (in seconds) */
float animStart, animEnd;
/* bake start end time (in blender frames) */
@ -161,6 +161,9 @@ typedef struct FluidsimSettings {
#define OB_FSBND_FREESLIP (1<<(OB_TYPEFLAG_START+4))
#define OB_FSINFLOW_LOCALCOORD (1<<(OB_TYPEFLAG_START+5))
/* surface generation flag (part of enabling chapter 6 of "Free Surface Flows with Moving and Deforming Objects for LBM") */
#define OB_FSSG_NOOBS (1<<(OB_TYPEFLAG_START+6))
// guiDisplayMode particle flags
#define OB_FSDOM_GEOM 1
#define OB_FSDOM_PREVIEW 2

@ -922,6 +922,13 @@ static void rna_def_camera_actuator(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Max", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "damping", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "damping");
RNA_def_property_range(prop, 0, 10.0);
RNA_def_property_ui_range(prop, 0, 5.0, 1, 2);
RNA_def_property_ui_text(prop, "Damping", "Specify the strength of the constraint that drive the camera behind the target");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* x/y */
prop= RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "axis");

@ -133,7 +133,7 @@ void RNA_def_camera(BlenderRNA *brna)
prop= RNA_def_property(srna, "ortho_scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ortho_scale");
RNA_def_property_range(prop, 0.01f, 1000.0f);
RNA_def_property_range(prop, 0.01f, 4000.0f);
RNA_def_property_ui_text(prop, "Orthographic Scale", "Orthographic Camera scale (similar to zoom)");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);

@ -312,7 +312,7 @@ static void rna_def_fluidsim_domain(BlenderRNA *brna)
/* advanced settings */
prop= RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION);
RNA_def_property_float_sdna(prop, NULL, "gravx");
RNA_def_property_float_sdna(prop, NULL, "grav");
RNA_def_property_array(prop, 3);
RNA_def_property_range(prop, -1000.1, 1000.1);
RNA_def_property_ui_text(prop, "Gravity", "Gravity in X, Y and Z direction");
@ -384,6 +384,12 @@ static void rna_def_fluidsim_domain(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Generate Speed Vectors", "Generate speed vectors for vector blur");
/* no collision object surface */
prop= RNA_def_property(srna, "surface_noobs", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "typeFlags", OB_FSSG_NOOBS);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Hide fluid surface", "");
/* particles */
prop= RNA_def_property(srna, "tracer_particles", PROP_INT, PROP_NONE);

@ -95,7 +95,7 @@ static void rna_def_group_objects(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_ui_description(func, "Add this object to a group");
/* object to add */
parm= RNA_def_pointer(func, "object", "Object", "", "Object to add.");
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
/* remove object */
func= RNA_def_function(srna, "unlink", "rna_Group_objects_unlink");

@ -135,6 +135,7 @@ static void rna_Texture_update(Main *bmain, Scene *scene, PointerRNA *ptr)
DAG_id_tag_update(&tex->id, 0);
WM_main_add_notifier(NC_TEXTURE, tex);
WM_main_add_notifier(NC_MATERIAL|ND_SHADING_DRAW, NULL);
}
static void rna_Texture_voxeldata_update(Main *bmain, Scene *scene, PointerRNA *ptr)

@ -90,10 +90,10 @@ void fluidsim_init(FluidsimModifierData *fluidmd)
fss->viscosityValue = 1.0;
fss->viscosityExponent = 6;
// dg TODO: change this to []
fss->gravx = 0.0;
fss->gravy = 0.0;
fss->gravz = -9.81;
fss->grav[0] = 0.0;
fss->grav[1] = 0.0;
fss->grav[2] = -9.81;
fss->animStart = 0.0;
fss->animEnd = 4.0;
fss->gstar = 0.005; // used as normgstar
@ -111,7 +111,7 @@ void fluidsim_init(FluidsimModifierData *fluidmd)
// no bounding box needed
// todo - reuse default init from elbeem!
fss->typeFlags = OB_FSBND_PARTSLIP;
fss->typeFlags = OB_FSBND_PARTSLIP | OB_FSSG_NOOBS;
fss->domainNovecgen = 0;
fss->volumeInitType = 1; // volume
fss->partSlipValue = 0.2;

@ -45,6 +45,7 @@
#include "DNA_modifier_types.h"
#include "DNA_object_types.h"
#include "BKE_action.h" /* get_pose_channel */
#include "BKE_cdderivedmesh.h"
#include "BKE_mesh.h"
#include "BKE_modifier.h"
@ -102,7 +103,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
DerivedMesh *dm= derivedData, *result= NULL;
GHash *vertHash=NULL, *edgeHash, *faceHash;
GHashIterator *hashIter;
MDeformVert *dvert= NULL;
MDeformVert *dvert= NULL, *dv;
int numFaces=0, numEdges=0, numVerts=0;
int maxVerts, maxEdges, maxFaces;
int i;
@ -130,50 +131,46 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
/* if mode is to use selected armature bones, aggregate the bone groups */
if (mmd->mode == MOD_MASK_MODE_ARM) /* --- using selected bones --- */
{
GHash *vgroupHash, *boneHash;
GHash *vgroupHash;
Object *oba= mmd->ob_arm;
bPoseChannel *pchan;
bDeformGroup *def;
char *bone_select_array;
int bone_select_tot= 0;
/* check that there is armature object with bones to use, otherwise return original mesh */
if (ELEM(NULL, mmd->ob_arm, mmd->ob_arm->pose))
if (ELEM3(NULL, mmd->ob_arm, mmd->ob_arm->pose, ob->defbase.first))
return derivedData;
bone_select_array= MEM_mallocN(BLI_countlist(&ob->defbase) * sizeof(char), "mask array");
for (i = 0, def = ob->defbase.first; def; def = def->next, i++)
{
if (((pchan= get_pose_channel(oba->pose, def->name)) && pchan->bone && (pchan->bone->flag & BONE_SELECTED)))
{
bone_select_array[i]= TRUE;
bone_select_tot++;
}
else {
bone_select_array[i]= FALSE;
}
}
/* hashes for finding mapping of:
* - vgroups to indices -> vgroupHash (string, int)
* - bones to vgroup indices -> boneHash (index of vgroup, dummy)
*/
vgroupHash= BLI_ghash_new(BLI_ghashutil_strhash, BLI_ghashutil_strcmp, "mask vgroup gh");
boneHash= BLI_ghash_new(BLI_ghashutil_inthash, BLI_ghashutil_intcmp, "mask bone gh");
/* build mapping of names of vertex groups to indices */
for (i = 0, def = ob->defbase.first; def; def = def->next, i++)
BLI_ghash_insert(vgroupHash, def->name, SET_INT_IN_POINTER(i));
/* get selected-posechannel <-> vertexgroup index mapping */
for (pchan= oba->pose->chanbase.first; pchan; pchan= pchan->next)
{
/* check if bone is selected */
// TODO: include checks for visibility too?
// FIXME: the depsgraph needs extensions to make this work in realtime...
if ( (pchan->bone) && (pchan->bone->flag & BONE_SELECTED) )
{
/* check if hash has group for this bone */
if (BLI_ghash_haskey(vgroupHash, pchan->name))
{
int defgrp_index= GET_INT_FROM_POINTER(BLI_ghash_lookup(vgroupHash, pchan->name));
/* add index to hash (store under key only) */
BLI_ghash_insert(boneHash, SET_INT_IN_POINTER(defgrp_index), pchan);
}
}
}
/* if no bones selected, free hashes and return original mesh */
if (BLI_ghash_size(boneHash) == 0)
if (bone_select_tot == 0)
{
BLI_ghash_free(vgroupHash, NULL, NULL);
BLI_ghash_free(boneHash, NULL, NULL);
MEM_freeN(bone_select_array);
return derivedData;
}
@ -183,7 +180,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
if (dvert == NULL)
{
BLI_ghash_free(vgroupHash, NULL, NULL);
BLI_ghash_free(boneHash, NULL, NULL);
MEM_freeN(bone_select_array);
return derivedData;
}
@ -192,28 +189,29 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
vertHash= BLI_ghash_new(BLI_ghashutil_inthash, BLI_ghashutil_intcmp, "mask vert gh");
/* add vertices which exist in vertexgroups into vertHash for filtering */
for (i = 0; i < maxVerts; i++)
for (i= 0, dv= dvert; i < maxVerts; i++, dv++)
{
MDeformWeight *def_weight = NULL;
MDeformWeight *dw= dv->dw;
int j;
for (j= 0; j < dvert[i].totweight; j++)
for (j= dv->totweight; j > 0; j--, dw++)
{
if (BLI_ghash_haskey(boneHash, SET_INT_IN_POINTER(dvert[i].dw[j].def_nr)))
if (bone_select_array[dw->def_nr])
{
def_weight = &dvert[i].dw[j];
if(dw->weight != 0.0f) {
break;
}
}
}
/* check if include vert in vertHash */
if (mmd->flag & MOD_MASK_INV) {
/* if this vert is in the vgroup, don't include it in vertHash */
if (def_weight) continue;
if (dw) continue;
}
else {
/* if this vert isn't in the vgroup, don't include it in vertHash */
if (!def_weight) continue;
if (!dw) continue;
}
/* add to ghash for verts (numVerts acts as counter for mapping) */
@ -223,7 +221,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
/* free temp hashes */
BLI_ghash_free(vgroupHash, NULL, NULL);
BLI_ghash_free(boneHash, NULL, NULL);
MEM_freeN(bone_select_array);
}
else /* --- Using Nominated VertexGroup only --- */
{
@ -241,28 +239,18 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
vertHash= BLI_ghash_new(BLI_ghashutil_inthash, BLI_ghashutil_intcmp, "mask vert2 bh");
/* add vertices which exist in vertexgroup into ghash for filtering */
for (i = 0; i < maxVerts; i++)
for (i= 0, dv= dvert; i < maxVerts; i++, dv++)
{
MDeformWeight *def_weight = NULL;
int j;
for (j= 0; j < dvert[i].totweight; j++)
{
if (dvert[i].dw[j].def_nr == defgrp_index)
{
def_weight = &dvert[i].dw[j];
break;
}
}
const int weight_set= defvert_find_weight(dv, defgrp_index) != 0.0f;
/* check if include vert in vertHash */
if (mmd->flag & MOD_MASK_INV) {
/* if this vert is in the vgroup, don't include it in vertHash */
if (def_weight) continue;
if (weight_set) continue;
}
else {
/* if this vert isn't in the vgroup, don't include it in vertHash */
if (!def_weight) continue;
if (!weight_set) continue;
}
/* add to ghash for verts (numVerts acts as counter for mapping) */

@ -2192,6 +2192,7 @@ void do_material_tex(ShadeInput *shi)
}
}
else if(mtex->texco==TEXCO_REFL) {
calc_R_ref(shi);
co= shi->ref; dx= shi->dxref; dy= shi->dyref;
}
else if(mtex->texco==TEXCO_NORM) {
@ -2509,9 +2510,6 @@ void do_material_tex(ShadeInput *shi)
shi->orn[0]= -shi->vn[0];
shi->orn[1]= -shi->vn[1];
shi->orn[2]= -shi->vn[2];
/* reflection vector */
calc_R_ref(shi);
}
}

@ -543,11 +543,6 @@ void shade_input_set_strand_texco(ShadeInput *shi, StrandRen *strand, StrandVert
shi->orn[2]= -shi->vn[2];
}
if(texco & TEXCO_REFL) {
/* mirror reflection color textures (and envmap) */
calc_R_ref(shi); /* wrong location for normal maps! XXXXXXXXXXXXXX */
}
if(texco & TEXCO_STRESS) {
/* not supported */
}
@ -1205,11 +1200,6 @@ void shade_input_set_shade_texco(ShadeInput *shi)
shi->orn[2]= -shi->vn[2];
}
if(texco & TEXCO_REFL) {
/* mirror reflection color textures (and envmap) */
calc_R_ref(shi); /* wrong location for normal maps! XXXXXXXXXXXXXX */
}
if(texco & TEXCO_STRESS) {
float *s1, *s2, *s3;

@ -328,7 +328,6 @@ static void free_openrecent(void)
/* bad stuff*/
extern ListBase editelems;
extern wchar_t *copybuf;
extern wchar_t *copybufinfo;
@ -394,10 +393,6 @@ void WM_exit(bContext *C)
free_anim_drivers_copybuf();
free_fmodifiers_copybuf();
free_posebuf();
// free_vertexpaint();
// free_imagepaint();
// fsmenu_free();
BLF_exit();
@ -420,10 +415,6 @@ void WM_exit(bContext *C)
BPY_python_end();
#endif
if (!G.background) {
// XXX UI_filelist_free_icons();
}
GPU_buffer_pool_free(NULL);
GPU_free_unused_buffers();
GPU_extensions_exit();

@ -287,7 +287,8 @@ void BL_ConvertActuators(char* maggiename,
camact->height,
camact->min,
camact->max,
camact->axis=='x');
camact->axis=='x',
camact->damping);
baseact = tmpcamact;
}
break;

@ -55,10 +55,10 @@ SCA_2DFilterActuator::SCA_2DFilterActuator(
m_rasterizer(rasterizer),
m_scene(scene)
{
m_gameObj = NULL;
m_gameobj = NULL;
if(gameobj){
m_propNames = gameobj->GetPropertyNames();
m_gameObj = gameobj;
m_gameobj = gameobj;
}
}
@ -91,7 +91,7 @@ bool SCA_2DFilterActuator::Update()
}
else if(m_type < RAS_2DFilterManager::RAS_2DFILTER_NUMBER_OF_FILTERS)
{
m_scene->Update2DFilter(m_propNames, m_gameObj, m_type, m_int_arg, m_shaderText);
m_scene->Update2DFilter(m_propNames, m_gameobj, m_type, m_int_arg, m_shaderText);
}
// once the filter is in place, no need to update it again => disable the actuator
return false;

@ -42,7 +42,6 @@ class SCA_2DFilterActuator : public SCA_IActuator
private:
vector<STR_String> m_propNames;
void * m_gameObj;
RAS_2DFilterManager::RAS_2DFILTER_MODE m_type;
short m_disableMotionBlur;
float m_float_arg;

@ -54,14 +54,16 @@ KX_CameraActuator::KX_CameraActuator(
float hght,
float minhght,
float maxhght,
bool xytog
bool xytog,
float damping
):
SCA_IActuator(gameobj, KX_ACT_CAMERA),
m_ob (obj),
m_height (hght),
m_minHeight (minhght),
m_maxHeight (maxhght),
m_x (xytog)
m_x (xytog),
m_damping (damping)
{
if (m_ob)
m_ob->RegisterActuator(this);
@ -283,7 +285,7 @@ bool KX_CameraActuator::Update(double curtime, bool frame)
}
inp= fp1[0]*fp2[0] + fp1[1]*fp2[1] + fp1[2]*fp2[2];
fac= (-1.0 + inp)/32.0;
fac= (-1.0 + inp) * m_damping;
from[0]+= fac*fp1[0];
from[1]+= fac*fp1[1];
@ -390,6 +392,7 @@ PyAttributeDef KX_CameraActuator::Attributes[] = {
KX_PYATTRIBUTE_FLOAT_RW("height",-FLT_MAX,FLT_MAX,KX_CameraActuator,m_height),
KX_PYATTRIBUTE_BOOL_RW("useXY",KX_CameraActuator,m_x),
KX_PYATTRIBUTE_RW_FUNCTION("object", KX_CameraActuator, pyattr_get_object, pyattr_set_object),
KX_PYATTRIBUTE_FLOAT_RW("damping",0.f,10.f,KX_CameraActuator,m_damping),
{NULL}
};

@ -74,6 +74,9 @@ private :
/** xy toggle (pick one): true == x, false == y */
bool m_x;
/** damping (float), */
float m_damping;
/* get the KX_IGameObject with this name */
CValue *findObject(char *obName);
@ -95,7 +98,8 @@ private :
float hght,
float minhght,
float maxhght,
bool xytog
bool xytog,
float damping
);