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>2011-10-30 05:27:49 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-10-30 05:27:49 +0400
commitbd86ba2c88aa912eefb38dc4a809f1ca1e49a31f (patch)
treeb2464a5cc64089772d52c5e9e740a73210d60e6d /source/blender
parente48d7f4c111ea61eec467e972be1005f953768b1 (diff)
parentf837b46a2b561293660a0edf9d4de5ff16922f42 (diff)
svn merge -r41335:41371
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/CMakeLists.txt4
-rw-r--r--source/blender/blenkernel/SConscript4
-rw-r--r--source/blender/blenkernel/intern/effect.c4
-rw-r--r--source/blender/blenkernel/intern/particle_system.c8
-rw-r--r--source/blender/blenlib/BLI_string.h1
-rw-r--r--source/blender/blenlib/intern/bpath.c3
-rw-r--r--source/blender/blenloader/intern/writefile.c2
-rw-r--r--source/blender/editors/include/UI_interface.h2
-rw-r--r--source/blender/editors/interface/interface_templates.c54
-rw-r--r--source/blender/editors/physics/CMakeLists.txt4
-rw-r--r--source/blender/editors/physics/physics_fluid.c6
-rw-r--r--source/blender/editors/render/render_opengl.c8
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c6
-rw-r--r--source/blender/gpu/GPU_extensions.h5
-rw-r--r--source/blender/gpu/intern/gpu_extensions.c29
-rw-r--r--source/blender/gpu/intern/gpu_material.c3
-rw-r--r--source/blender/makesrna/intern/CMakeLists.txt4
-rw-r--r--source/blender/makesrna/intern/rna_fluidsim.c4
-rw-r--r--source/blender/makesrna/intern/rna_ui_api.c3
-rw-r--r--source/blender/modifiers/CMakeLists.txt4
-rw-r--r--source/blender/modifiers/SConscript12
-rw-r--r--source/blender/modifiers/intern/MOD_fluidsim_util.c11
22 files changed, 120 insertions, 61 deletions
diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt
index 2f2811abd7e..568c5f489fa 100644
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@ -327,8 +327,8 @@ if(WITH_OPENMP)
add_definitions(-DPARALLEL=1)
endif()
-if(NOT WITH_MOD_FLUID)
- add_definitions(-DDISABLE_ELBEEM)
+if(WITH_MOD_FLUID)
+ add_definitions(-DWITH_MOD_FLUID)
endif()
if(WITH_MOD_SMOKE)
diff --git a/source/blender/blenkernel/SConscript b/source/blender/blenkernel/SConscript
index 2998d7bda5c..7ae27aadd37 100644
--- a/source/blender/blenkernel/SConscript
+++ b/source/blender/blenkernel/SConscript
@@ -80,8 +80,8 @@ if env['OURPLATFORM'] == 'darwin':
if env['WITH_BF_OPENMP']:
defs.append('PARALLEL=1')
-if env['BF_NO_ELBEEM']:
- defs.append('DISABLE_ELBEEM')
+if env['WITH_BF_FLUID']:
+ defs.append('WITH_MOD_FLUID')
if env['WITH_BF_LZO']:
incs += ' #/extern/lzo/minilzo'
diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c
index 37ad2346f17..a3d48c188d8 100644
--- a/source/blender/blenkernel/intern/effect.c
+++ b/source/blender/blenkernel/intern/effect.c
@@ -91,12 +91,12 @@
#include "RE_shader_ext.h"
/* fluid sim particle import */
-#ifndef DISABLE_ELBEEM
+#ifdef WITH_MOD_FLUID
#include "DNA_object_fluidsim.h"
#include "LBM_fluidsim.h"
#include <zlib.h>
#include <string.h>
-#endif // DISABLE_ELBEEM
+#endif // WITH_MOD_FLUID
//XXX #include "BIF_screen.h"
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index 02e65f7044c..306e897fbc8 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -95,13 +95,13 @@
#include "RE_shader_ext.h"
/* fluid sim particle import */
-#ifndef DISABLE_ELBEEM
+#ifdef WITH_MOD_FLUID
#include "DNA_object_fluidsim.h"
#include "LBM_fluidsim.h"
#include <zlib.h>
#include <string.h>
-#endif // DISABLE_ELBEEM
+#endif // WITH_MOD_FLUID
/************************************************/
/* Reacting to system events */
@@ -3916,7 +3916,7 @@ static void particles_fluid_step(ParticleSimulationData *sim, int UNUSED(cfra))
}
/* fluid sim particle import handling, actual loading of particles from file */
- #ifndef DISABLE_ELBEEM
+ #ifdef WITH_MOD_FLUID
{
FluidsimModifierData *fluidmd = (FluidsimModifierData *)modifiers_findByType(sim->ob, eModifierType_Fluidsim);
@@ -4009,7 +4009,7 @@ static void particles_fluid_step(ParticleSimulationData *sim, int UNUSED(cfra))
} // fluid sim particles done
}
- #endif // DISABLE_ELBEEM
+ #endif // WITH_MOD_FLUID
}
static int emit_particles(ParticleSimulationData *sim, PTCacheID *pid, float UNUSED(cfra))
diff --git a/source/blender/blenlib/BLI_string.h b/source/blender/blenlib/BLI_string.h
index 0cdb573c4c6..46389a9259e 100644
--- a/source/blender/blenlib/BLI_string.h
+++ b/source/blender/blenlib/BLI_string.h
@@ -132,7 +132,6 @@ int BLI_strcasecmp(const char *s1, const char *s2);
int BLI_strncasecmp(const char *s1, const char *s2, size_t len);
int BLI_natstrcmp(const char *s1, const char *s2);
size_t BLI_strnlen(const char *str, size_t maxlen);
-
void BLI_timestr(double _time, char *str); /* time var is global */
void BLI_ascii_strtolower(char *str, int len);
diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c
index e42e02fb24f..b7fe7ef5efd 100644
--- a/source/blender/blenlib/intern/bpath.c
+++ b/source/blender/blenlib/intern/bpath.c
@@ -325,8 +325,7 @@ static int rewrite_path_fixed_dirfile(char path_dir[FILE_MAXDIR], char path_file
}
if (visit_cb(userdata, path_dst, (const char *)path_src)) {
- BLI_split_dirfile(path_dst, path_dir, path_file,
- sizeof(path_dir), sizeof(path_file));
+ BLI_split_dirfile(path_dst, path_dir, path_file, FILE_MAXDIR, FILE_MAXFILE);
return TRUE;
}
else {
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 04c324bd28e..4ef2356eed6 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -2267,7 +2267,7 @@ static void write_screens(WriteData *wd, ListBase *scrbase)
static void write_libraries(WriteData *wd, Main *main)
{
- ListBase *lbarray[30];
+ ListBase *lbarray[MAX_LIBARRAY];
ID *id;
int a, tot, foundone;
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index a7ced565403..cb18ea37ffc 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -749,7 +749,7 @@ void uiTemplateTextureImage(uiLayout *layout, struct bContext *C, struct Tex *te
void uiTemplateReportsBanner(uiLayout *layout, struct bContext *C);
void uiTemplateKeymapItemProperties(uiLayout *layout, struct PointerRNA *ptr);
-void uiTemplateList(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, const char *propname, struct PointerRNA *activeptr, const char *activeprop, int rows, int maxrows, int type);
+void uiTemplateList(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, const char *propname, struct PointerRNA *activeptr, const char *activeprop, const char *prop_list, int rows, int maxrows, int type);
/* items */
void uiItemO(uiLayout *layout, const char *name, int icon, const char *opname);
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index b816d1a8f9c..19d22a432dc 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -2059,7 +2059,7 @@ static int list_item_icon_get(bContext *C, PointerRNA *itemptr, int rnaicon, int
return rnaicon;
}
-static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, PointerRNA *itemptr, int i, int rnaicon, PointerRNA *activeptr, PropertyRNA *activeprop)
+static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, PointerRNA *itemptr, int i, int rnaicon, PointerRNA *activeptr, PropertyRNA *activeprop, const char *prop_list_id)
{
uiBlock *block= uiLayoutGetBlock(layout);
uiBut *but;
@@ -2164,6 +2164,54 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe
/* nothing else special to do... */
uiItemL(sub, name, icon); /* fails, backdrop LISTROW... */
}
+ /* There is a last chance to display custom controls (in addition to the name/label):
+ * If the given item property group features a string property named as prop_list,
+ * this tries to add controls for all properties of the item listed in that string property.
+ * (colon-separated names).
+ *
+ * This is especially useful for python. E.g., if you list a collection of this property
+ * group:
+ *
+ * class TestPropertyGroup(bpy.types.PropertyGroup):
+ * bool = BoolProperty(default=False)
+ * integer = IntProperty()
+ * string = StringProperty()
+ *
+ * # A string of all identifiers (colon-separated) which property’s controls should be
+ * # displayed in a template_list.
+ * template_list_controls = StringProperty(default="integer:bool:string", options={"HIDDEN"})
+ *
+ * … you’ll get a numfield for the integer prop, a check box for the bool prop, and a textfield
+ * for the string prop, after the name of each item of the collection.
+ */
+ else if (prop_list_id) {
+ row = uiLayoutRow(sub, 1);
+ uiItemL(row, name, icon);
+
+ /* XXX: Check, as sometimes we get an itemptr looking like
+ * {id = {data = 0x0}, type = 0x0, data = 0x0}
+ * which would obviously produce a sigsev… */
+ if (itemptr->type) {
+ /* If the special property is set for the item, and it is a collection… */
+ PropertyRNA *prop_list= RNA_struct_find_property(itemptr, prop_list_id);
+
+ if(prop_list && RNA_property_type(prop_list) == PROP_STRING) {
+ int prop_names_len;
+ char *prop_names = RNA_property_string_get_alloc(itemptr, prop_list, NULL, 0, &prop_names_len);
+ char *prop_names_end= prop_names + prop_names_len;
+ char *id= prop_names;
+ char *id_next;
+ while (id < prop_names_end) {
+ if ((id_next= strchr(id, ':'))) *id_next++= '\0';
+ else id_next= prop_names_end;
+ uiItemR(row, itemptr, id, 0, NULL, 0);
+ id= id_next;
+ }
+ MEM_freeN(prop_names);
+ }
+ }
+ }
+
else
uiItemL(sub, name, icon); /* fails, backdrop LISTROW... */
@@ -2172,7 +2220,7 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe
MEM_freeN(namebuf);
}
-void uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, const char *propname, PointerRNA *activeptr, const char *activepropname, int rows, int maxrows, int listtype)
+void uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, const char *propname, PointerRNA *activeptr, const char *activepropname, const char *prop_list, int rows, int maxrows, int listtype)
{
//Scene *scene= CTX_data_scene(C);
PropertyRNA *prop= NULL, *activeprop;
@@ -2326,7 +2374,7 @@ void uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, const char *
/* create list items */
RNA_PROP_BEGIN(ptr, itemptr, prop) {
if(i >= pa->list_scroll && i<pa->list_scroll+items)
- list_item_row(C, col, ptr, &itemptr, i, rnaicon, activeptr, activeprop);
+ list_item_row(C, col, ptr, &itemptr, i, rnaicon, activeptr, activeprop, prop_list);
i++;
}
diff --git a/source/blender/editors/physics/CMakeLists.txt b/source/blender/editors/physics/CMakeLists.txt
index f98122eccbd..382e12cce6c 100644
--- a/source/blender/editors/physics/CMakeLists.txt
+++ b/source/blender/editors/physics/CMakeLists.txt
@@ -45,8 +45,8 @@ set(SRC
physics_intern.h
)
-if(NOT WITH_MOD_FLUID)
- add_definitions(-DDISABLE_ELBEEM)
+if(WITH_MOD_FLUID)
+ add_definitions(-DWITH_MOD_FLUID)
endif()
if(WITH_OPENMP)
diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c
index f0c327b9279..6e88d477d9c 100644
--- a/source/blender/editors/physics/physics_fluid.c
+++ b/source/blender/editors/physics/physics_fluid.c
@@ -85,7 +85,7 @@
#include "physics_intern.h" // own include
/* enable/disable overall compilation */
-#ifndef DISABLE_ELBEEM
+#ifdef WITH_MOD_FLUID
#include "WM_api.h"
@@ -1111,7 +1111,7 @@ void fluidsimFreeBake(Object *UNUSED(ob))
/* not implemented yet */
}
-#else /* DISABLE_ELBEEM */
+#else /* WITH_MOD_FLUID */
/* compile dummy functions for disabled fluid sim */
@@ -1135,7 +1135,7 @@ static int fluidsimBake(bContext *UNUSED(C), ReportList *UNUSED(reports), Object
return 0;
}
-#endif /* DISABLE_ELBEEM */
+#endif /* WITH_MOD_FLUID */
/***************************** Operators ******************************/
diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c
index feeb2fefca7..fa764e6eefc 100644
--- a/source/blender/editors/render/render_opengl.c
+++ b/source/blender/editors/render/render_opengl.c
@@ -154,7 +154,7 @@ static void screen_opengl_render_apply(OGLRender *oglrender)
if((scene->r.mode & R_OSA) == 0) {
ED_view3d_draw_offscreen(scene, v3d, ar, sizex, sizey, NULL, winmat);
- glReadPixels(0, 0, sizex, sizey, GL_RGBA, GL_FLOAT, rr->rectf);
+ GPU_offscreen_read_pixels(oglrender->ofs, GL_FLOAT, rr->rectf);
}
else {
/* simple accumulation, less hassle then FSAA FBO's */
@@ -167,7 +167,7 @@ static void screen_opengl_render_apply(OGLRender *oglrender)
/* first sample buffer, also initializes 'rv3d->persmat' */
ED_view3d_draw_offscreen(scene, v3d, ar, sizex, sizey, NULL, winmat);
- glReadPixels(0, 0, sizex, sizey, GL_RGBA, GL_FLOAT, accum_buffer);
+ GPU_offscreen_read_pixels(oglrender->ofs, GL_FLOAT, accum_buffer);
/* skip the first sample */
for(j=1; j < SAMPLES; j++) {
@@ -175,7 +175,7 @@ static void screen_opengl_render_apply(OGLRender *oglrender)
window_translate_m4(winmat_jitter, rv3d->persmat, jit_ofs[j][0] / sizex, jit_ofs[j][1] / sizey);
ED_view3d_draw_offscreen(scene, v3d, ar, sizex, sizey, NULL, winmat_jitter);
- glReadPixels(0, 0, sizex, sizey, GL_RGBA, GL_FLOAT, accum_tmp);
+ GPU_offscreen_read_pixels(oglrender->ofs, GL_FLOAT, accum_tmp);
add_vn_vn(accum_buffer, accum_tmp, sizex*sizey*sizeof(float));
}
@@ -278,7 +278,7 @@ static int screen_opengl_render_init(bContext *C, wmOperator *op)
sizey= (scene->r.size*scene->r.ysch)/100;
/* corrects render size with actual size, not every card supports non-power-of-two dimensions */
- ofs= GPU_offscreen_create(&sizex, &sizey, err_out);
+ ofs= GPU_offscreen_create(sizex, sizey, err_out);
if(!ofs) {
BKE_reportf(op->reports, RPT_ERROR, "Failed to create OpenGL offscreen buffer, %s", err_out);
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 20b1df6ef2c..32e553262e2 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -2379,7 +2379,7 @@ ImBuf *ED_view3d_draw_offscreen_imbuf(Scene *scene, View3D *v3d, ARegion *ar, in
glPushAttrib(GL_LIGHTING_BIT);
/* bind */
- ofs= GPU_offscreen_create(&sizex, &sizey, err_out);
+ ofs= GPU_offscreen_create(sizex, sizey, err_out);
if(ofs == NULL)
return NULL;
@@ -2403,9 +2403,9 @@ ImBuf *ED_view3d_draw_offscreen_imbuf(Scene *scene, View3D *v3d, ARegion *ar, in
ibuf= IMB_allocImBuf(sizex, sizey, 32, flag);
if(ibuf->rect_float)
- glReadPixels(0, 0, sizex, sizey, GL_RGBA, GL_FLOAT, ibuf->rect_float);
+ GPU_offscreen_read_pixels(ofs, GL_FLOAT, ibuf->rect_float);
else if(ibuf->rect)
- glReadPixels(0, 0, sizex, sizey, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect);
+ GPU_offscreen_read_pixels(ofs, GL_UNSIGNED_BYTE, ibuf->rect);
//if((scene->r.stamp & R_STAMP_ALL) && (scene->r.stamp & R_STAMP_DRAW))
// BKE_stamp_buf(scene, NULL, rr->rectf, rr->rectx, rr->recty, 4);
diff --git a/source/blender/gpu/GPU_extensions.h b/source/blender/gpu/GPU_extensions.h
index 965f317aa50..3fff79390e3 100644
--- a/source/blender/gpu/GPU_extensions.h
+++ b/source/blender/gpu/GPU_extensions.h
@@ -136,7 +136,7 @@ int GPU_texture_opengl_bindcode(GPUTexture *tex);
GPUFrameBuffer *GPU_framebuffer_create(void);
int GPU_framebuffer_texture_attach(GPUFrameBuffer *fb, GPUTexture *tex, char err_out[256]);
void GPU_framebuffer_texture_detach(GPUFrameBuffer *fb, GPUTexture *tex);
-void GPU_framebuffer_texture_bind(GPUFrameBuffer *fb, GPUTexture *tex);
+void GPU_framebuffer_texture_bind(GPUFrameBuffer *fb, GPUTexture *tex, int w, int h);
void GPU_framebuffer_texture_unbind(GPUFrameBuffer *fb, GPUTexture *tex);
void GPU_framebuffer_free(GPUFrameBuffer *fb);
@@ -146,10 +146,11 @@ void GPU_framebuffer_restore(void);
- wrapper around framebuffer and texture for simple offscreen drawing
- changes size if graphics card can't support it */
-GPUOffScreen *GPU_offscreen_create(int *width, int *height, char err_out[256]);
+GPUOffScreen *GPU_offscreen_create(int width, int height, char err_out[256]);
void GPU_offscreen_free(GPUOffScreen *ofs);
void GPU_offscreen_bind(GPUOffScreen *ofs);
void GPU_offscreen_unbind(GPUOffScreen *ofs);
+void GPU_offscreen_read_pixels(GPUOffScreen *ofs, int type, void *pixels);
/* GPU Shader
- only for fragment shaders now
diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c
index 6189062a855..e1a89daf7e2 100644
--- a/source/blender/gpu/intern/gpu_extensions.c
+++ b/source/blender/gpu/intern/gpu_extensions.c
@@ -790,7 +790,7 @@ void GPU_framebuffer_texture_detach(GPUFrameBuffer *fb, GPUTexture *tex)
tex->fb = NULL;
}
-void GPU_framebuffer_texture_bind(GPUFrameBuffer *UNUSED(fb), GPUTexture *tex)
+void GPU_framebuffer_texture_bind(GPUFrameBuffer *UNUSED(fb), GPUTexture *tex, int w, int h)
{
/* push attributes */
glPushAttrib(GL_ENABLE_BIT);
@@ -801,7 +801,7 @@ void GPU_framebuffer_texture_bind(GPUFrameBuffer *UNUSED(fb), GPUTexture *tex)
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, tex->fb->object);
/* push matrices and set default viewport and matrix */
- glViewport(0, 0, tex->w, tex->h);
+ glViewport(0, 0, w, h);
GG.currentfb = tex->fb->object;
glMatrixMode(GL_PROJECTION);
@@ -859,13 +859,19 @@ struct GPUOffScreen {
GPUFrameBuffer *fb;
GPUTexture *color;
GPUTexture *depth;
+
+ /* requested width/height, may be smaller than actual texture size due
+ to missing non-power of two support, so we compensate for that */
+ int w, h;
};
-GPUOffScreen *GPU_offscreen_create(int *width, int *height, char err_out[256])
+GPUOffScreen *GPU_offscreen_create(int width, int height, char err_out[256])
{
GPUOffScreen *ofs;
ofs= MEM_callocN(sizeof(GPUOffScreen), "GPUOffScreen");
+ ofs->w= width;
+ ofs->h= height;
ofs->fb = GPU_framebuffer_create();
if(!ofs->fb) {
@@ -873,24 +879,18 @@ GPUOffScreen *GPU_offscreen_create(int *width, int *height, char err_out[256])
return NULL;
}
- ofs->depth = GPU_texture_create_depth(*width, *height, err_out);
+ ofs->depth = GPU_texture_create_depth(width, height, err_out);
if(!ofs->depth) {
GPU_offscreen_free(ofs);
return NULL;
}
- if(*width!=ofs->depth->w || *height!=ofs->depth->h) {
- *width= ofs->depth->w;
- *height= ofs->depth->h;
- printf("Offscreen size differs from given size!\n");
- }
-
if(!GPU_framebuffer_texture_attach(ofs->fb, ofs->depth, err_out)) {
GPU_offscreen_free(ofs);
return NULL;
}
- ofs->color = GPU_texture_create_2D(*width, *height, NULL, err_out);
+ ofs->color = GPU_texture_create_2D(width, height, NULL, err_out);
if(!ofs->color) {
GPU_offscreen_free(ofs);
return NULL;
@@ -921,7 +921,7 @@ void GPU_offscreen_free(GPUOffScreen *ofs)
void GPU_offscreen_bind(GPUOffScreen *ofs)
{
glDisable(GL_SCISSOR_TEST);
- GPU_framebuffer_texture_bind(ofs->fb, ofs->color);
+ GPU_framebuffer_texture_bind(ofs->fb, ofs->color, ofs->w, ofs->h);
}
void GPU_offscreen_unbind(GPUOffScreen *ofs)
@@ -931,6 +931,11 @@ void GPU_offscreen_unbind(GPUOffScreen *ofs)
glEnable(GL_SCISSOR_TEST);
}
+void GPU_offscreen_read_pixels(GPUOffScreen *ofs, int type, void *pixels)
+{
+ glReadPixels(0, 0, ofs->w, ofs->h, GL_RGBA, type, pixels);
+}
+
/* GPUShader */
struct GPUShader {
diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c
index d0f834977c8..26c08f6cae5 100644
--- a/source/blender/gpu/intern/gpu_material.c
+++ b/source/blender/gpu/intern/gpu_material.c
@@ -1661,7 +1661,8 @@ void GPU_lamp_shadow_buffer_bind(GPULamp *lamp, float viewmat[][4], int *winsize
/* opengl */
glDisable(GL_SCISSOR_TEST);
- GPU_framebuffer_texture_bind(lamp->fb, lamp->tex);
+ GPU_framebuffer_texture_bind(lamp->fb, lamp->tex,
+ GPU_texture_opengl_width(lamp->tex), GPU_texture_opengl_height(lamp->tex));
/* set matrices */
copy_m4_m4(viewmat, lamp->viewmat);
diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt
index 33753bacc94..68f0a52c0a9 100644
--- a/source/blender/makesrna/intern/CMakeLists.txt
+++ b/source/blender/makesrna/intern/CMakeLists.txt
@@ -195,8 +195,8 @@ if(WITH_CODEC_FFMPEG)
add_definitions(-DWITH_FFMPEG)
endif()
-if(NOT WITH_MOD_FLUID)
- add_definitions(-DDISABLE_ELBEEM)
+if(WITH_MOD_FLUID)
+ add_definitions(-DWITH_MOD_FLUID)
endif()
if(WITH_FFTW3)
diff --git a/source/blender/makesrna/intern/rna_fluidsim.c b/source/blender/makesrna/intern/rna_fluidsim.c
index d2d24e083b1..a7eedf5f062 100644
--- a/source/blender/makesrna/intern/rna_fluidsim.c
+++ b/source/blender/makesrna/intern/rna_fluidsim.c
@@ -170,7 +170,7 @@ static void rna_FluidSettings_update_type(Main *bmain, Scene *scene, PointerRNA
static void rna_DomainFluidSettings_memory_estimate_get(PointerRNA *ptr, char *value)
{
-#ifdef DISABLE_ELBEEM
+#ifndef WITH_MOD_FLUID
(void)ptr;
value[0]= '\0';
#else
@@ -183,7 +183,7 @@ static void rna_DomainFluidSettings_memory_estimate_get(PointerRNA *ptr, char *v
static int rna_DomainFluidSettings_memory_estimate_length(PointerRNA *UNUSED(ptr))
{
-#ifdef DISABLE_ELBEEM
+#ifndef WITH_MOD_FLUID
return 0;
#else
return 31;
diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c
index 1322d1d239b..5478c9b3b6b 100644
--- a/source/blender/makesrna/intern/rna_ui_api.c
+++ b/source/blender/makesrna/intern/rna_ui_api.c
@@ -408,6 +408,9 @@ void RNA_api_ui_layout(StructRNA *srna)
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
parm= RNA_def_string(func, "active_property", "", 0, "", "Identifier of property in data, for the active element");
RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm= RNA_def_string(func, "prop_list", "", 0, "",
+ "Identifier of a string property in each data member, specifying which "
+ "of its properties should have a widget displayed in its row.");
RNA_def_int(func, "rows", 5, 0, INT_MAX, "", "Number of rows to display", 0, INT_MAX);
RNA_def_int(func, "maxrows", 5, 0, INT_MAX, "", "Maximum number of rows to display", 0, INT_MAX);
RNA_def_enum(func, "type", list_type_items, 0, "Type", "Type of list to use");
diff --git a/source/blender/modifiers/CMakeLists.txt b/source/blender/modifiers/CMakeLists.txt
index f31565dd48e..f383a9e86ea 100644
--- a/source/blender/modifiers/CMakeLists.txt
+++ b/source/blender/modifiers/CMakeLists.txt
@@ -113,8 +113,8 @@ if(WITH_MOD_DECIMATE)
)
endif()
-if(NOT WITH_MOD_FLUID)
- add_definitions(-DDISABLE_ELBEEM)
+if(WITH_MOD_FLUID)
+ add_definitions(-DWITH_MOD_FLUID)
endif()
if(WITH_GAMEENGINE)
diff --git a/source/blender/modifiers/SConscript b/source/blender/modifiers/SConscript
index c1f2ca63f6b..c330733e942 100644
--- a/source/blender/modifiers/SConscript
+++ b/source/blender/modifiers/SConscript
@@ -13,12 +13,14 @@ incs += ' ' + env['BF_ZLIB_INC']
defs = []
-# could be made optional
-defs += ['WITH_MOD_BOOLEAN']
-defs += ['WITH_MOD_DECIMATE']
+if env ['WITH_BF_BOOLEAN']:
+ defs.append('WITH_MOD_BOOLEAN')
-if env['BF_NO_ELBEEM']:
- defs.append('DISABLE_ELBEEM')
+if env ['WITH_BF_DECIMATE']:
+ defs.append('WITH_MOD_DECIMATE')
+
+if env['WITH_BF_FLUID']:
+ defs.append('WITH_MOD_FLUID')
if env['WITH_BF_GAMEENGINE']:
incs += ' #/extern/recastnavigation'
diff --git a/source/blender/modifiers/intern/MOD_fluidsim_util.c b/source/blender/modifiers/intern/MOD_fluidsim_util.c
index 5d8471e75dc..075a13985cb 100644
--- a/source/blender/modifiers/intern/MOD_fluidsim_util.c
+++ b/source/blender/modifiers/intern/MOD_fluidsim_util.c
@@ -62,9 +62,10 @@
// headers for fluidsim bobj meshes
#include "LBM_fluidsim.h"
+
void fluidsim_init(FluidsimModifierData *fluidmd)
{
-#ifndef DISABLE_ELBEEM
+#ifdef WITH_MOD_FLUID
if(fluidmd)
{
FluidsimSettings *fss = MEM_callocN(sizeof(FluidsimSettings), "fluidsimsettings");
@@ -152,7 +153,7 @@ void fluidsim_init(FluidsimModifierData *fluidmd)
void fluidsim_free(FluidsimModifierData *fluidmd)
{
-#ifndef DISABLE_ELBEEM
+#ifdef WITH_MOD_FLUID
if(fluidmd)
{
if(fluidmd->fss->meshVelocities)
@@ -169,7 +170,7 @@ void fluidsim_free(FluidsimModifierData *fluidmd)
return;
}
-#ifndef DISABLE_ELBEEM
+#ifdef WITH_MOD_FLUID
/* read .bobj.gz file into a fluidsimDerivedMesh struct */
static DerivedMesh *fluidsim_read_obj(const char *filename)
{
@@ -534,14 +535,14 @@ static DerivedMesh *fluidsim_read_cache(DerivedMesh *orgdm, FluidsimModifierData
return dm;
}
-#endif // DISABLE_ELBEEM
+#endif // WITH_MOD_FLUID
DerivedMesh *fluidsimModifier_do(FluidsimModifierData *fluidmd, Scene *scene,
Object *UNUSED(ob),
DerivedMesh *dm,
int useRenderParams, int UNUSED(isFinalCalc))
{
-#ifndef DISABLE_ELBEEM
+#ifdef WITH_MOD_FLUID
DerivedMesh *result = NULL;
int framenr;
FluidsimSettings *fss = NULL;