[Bf-blender-cvs] [6fc9285] GPU_data_request: cleanup: redundant include defines
Commit: 6fc928599ba7d19e7e74d9f8b02617f952d7bdd5 Author: Mike Erwin Date: Sat Mar 21 04:23:29 2015 -0400 Branches: GPU_data_request https://developer.blender.org/rB6fc928599ba7d19e7e74d9f8b02617f952d7bdd5 cleanup: redundant include defines GLEW takes care of this. VAOs are not part of OpenGL 2.1 but are very widely supported. Even so we should check before using. Current code does not check. Also minor style things I missed in the previous commit. === M source/blender/gpu/intern/gpux_vbo.c === diff --git a/source/blender/gpu/intern/gpux_vbo.c b/source/blender/gpu/intern/gpux_vbo.c index ab0482d..22d8542 100644 --- a/source/blender/gpu/intern/gpux_vbo.c +++ b/source/blender/gpu/intern/gpux_vbo.c @@ -13,15 +13,6 @@ * so we should follow that restriction on all platforms. */ #define USE_VAO (USE_VBO true) -#if USE_VAO - #ifndef glGenVertexArrays -#include OpenGL/glext.h -#define glGenVertexArrays glGenVertexArraysAPPLE -#define glDeleteVertexArrays glDeleteVertexArraysAPPLE -#define glBindVertexArray glBindVertexArrayAPPLE - #endif -#endif /* USE_VAO */ - #if TRUST_NO_ONE #include assert.h #endif /* TRUST_NO_ONE */ @@ -114,7 +105,7 @@ void attrib_print(const VertexBuffer *buff, unsigned attrib_num) unsigned comp_size = comp_sz(a-comp_type); for (unsigned v = 0; v buff-vertex_ct; ++v) { - const void* data = (byte*)a-data + v * a-stride; + const void *data = (byte*)a-data + v * a-stride; for (unsigned offset = 0; offset a-sz; ++offset) { if (offset % comp_size == 0) putchar(' '); @@ -144,7 +135,7 @@ void vertex_buffer_discard(VertexBuffer *buff) for (unsigned a_idx = 0; a_idx buff-attrib_ct; ++a_idx) { /* whatever needs doing */ - Attrib* a = buff-attribs + a_idx; + Attrib *a = buff-attribs + a_idx; #if USE_VBO if (a-vbo_id) glDeleteBuffers(1, a-vbo_id); @@ -170,7 +161,7 @@ static unsigned attrib_total_size(const VertexBuffer *buff, unsigned attrib_num) return (buff-vertex_ct - 1) * attrib-stride + attrib-sz; } -void specify_attrib(VertexBuffer *buff, unsigned attrib_num, const char* name, GLenum comp_type, unsigned comp_ct, VertexFetchMode fetch_mode) +void specify_attrib(VertexBuffer *buff, unsigned attrib_num, const char *name, GLenum comp_type, unsigned comp_ct, VertexFetchMode fetch_mode) { #if TRUST_NO_ONE assert(attrib_num buff-attrib_ct); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [5b10412] GPU_data_request: cleanup: code style
Commit: 5b10412103c247b16dde8b0cb6ac38394bc74f4b Author: Mike Erwin Date: Sat Mar 21 02:06:54 2015 -0400 Branches: GPU_data_request https://developer.blender.org/rB5b10412103c247b16dde8b0cb6ac38394bc74f4b cleanup: code style C-style comments, braces pointer placement. === M source/blender/gpu/GPUx_draw.h M source/blender/gpu/GPUx_element.h M source/blender/gpu/GPUx_state.h M source/blender/gpu/GPUx_vbo.h M source/blender/gpu/intern/GPUx_element_private.h M source/blender/gpu/intern/gpux_draw.c M source/blender/gpu/intern/gpux_element.c M source/blender/gpu/intern/gpux_state.c M source/blender/gpu/intern/gpux_vbo.c === diff --git a/source/blender/gpu/GPUx_draw.h b/source/blender/gpu/GPUx_draw.h index 219159c..ffbbdc2 100644 --- a/source/blender/gpu/GPUx_draw.h +++ b/source/blender/gpu/GPUx_draw.h @@ -1,19 +1,19 @@ #ifndef BLENDER_GL_DRAW_PRIMITIVES #define BLENDER_GL_DRAW_PRIMITIVES -// Stateless draw functions for lists of primitives. -// Mike Erwin, Dec 2014 +/* Stateless draw functions for lists of primitives. + * Mike Erwin, Dec 2014 */ #include GPUx_state.h #include GPUx_vbo.h #include GPUx_element.h -// pass ElementList = NULL to draw all vertices from VertexBuffer in order +/* pass ElementList = NULL to draw all vertices from VertexBuffer in order */ void draw_points(const CommonDrawState*, const PointDrawState*, const VertexBuffer*, const ElementList*); void draw_lines(const CommonDrawState*, const LineDrawState*, const VertexBuffer*, const ElementList*); void draw_triangles(const CommonDrawState*, const PolygonDrawState*, const VertexBuffer*, const ElementList*); -// generic version uses ElementList's primitive type -void draw_primitives(const CommonDrawState*, const void* primitive_state, const VertexBuffer*, const ElementList*); +/* generic version uses ElementList's primitive type */ +void draw_primitives(const CommonDrawState*, const void *primitive_state, const VertexBuffer*, const ElementList*); -#endif // BLENDER_GL_DRAW_PRIMITIVES +#endif /* BLENDER_GL_DRAW_PRIMITIVES */ diff --git a/source/blender/gpu/GPUx_element.h b/source/blender/gpu/GPUx_element.h index e5bc407..2bf61b8 100644 --- a/source/blender/gpu/GPUx_element.h +++ b/source/blender/gpu/GPUx_element.h @@ -1,24 +1,24 @@ #ifndef BLENDER_GL_ELEMENT_LIST #define BLENDER_GL_ELEMENT_LIST -// Element lists specify which vertices to use when drawing point, -// line, or triangle primiitives. They don't care how the per-vertex -// data (attributes) are laid out, only *which* vertices are used. -// Mike Erwin, Dec 2014 +/* Element lists specify which vertices to use when drawing point, + * line, or triangle primiitives. They don't care how the per-vertex + * data (attributes) are laid out, only *which* vertices are used. + * Mike Erwin, Dec 2014 */ #include GPU_glew.h -// ^-- for GLenum (and if you're including this file, you're probably calling OpenGL anyway) +/* ^-- for GLenum (and if you're including this file, you're probably calling OpenGL anyway) */ -struct ElementList; // forward declaration +struct ElementList; /* forward declaration */ typedef struct ElementList ElementList; -ElementList* create_element_list(GLenum prim_type, unsigned prim_ct, unsigned max_index); +ElementList *create_element_list(GLenum prim_type, unsigned prim_ct, unsigned max_index); void discard_element_list(ElementList*); void set_point_vertex(ElementList*, unsigned prim_idx, unsigned v1); void set_line_vertices(ElementList*, unsigned prim_idx, unsigned v1, unsigned v2); void set_triangle_vertices(ElementList*, unsigned prim_idx, unsigned v1, unsigned v2, unsigned v3); -void optimize(ElementList*); // optionally call this after setting all vertex indices +void optimize(ElementList*); /* optionally call this after setting all vertex indices */ -#endif // BLENDER_GL_ELEMENT_LIST +#endif /* BLENDER_GL_ELEMENT_LIST */ diff --git a/source/blender/gpu/GPUx_state.h b/source/blender/gpu/GPUx_state.h index 7090310..a05aa93 100644 --- a/source/blender/gpu/GPUx_state.h +++ b/source/blender/gpu/GPUx_state.h @@ -1,41 +1,37 @@ #ifndef BLENDER_GL_STATE #define BLENDER_GL_STATE -// Two goals: -// -- batch draws by state so we don't have to switch gears as often -// -- track current draw state internally so we don't have to bother the GL as often -// Mike Erwin, Dec 2014 +/* Two goals: + * -- batch draws by state so we don't have to switch gears as often + * -- track current draw state internally so we don't have to bother the GL as often + * Mike Erwin, Dec 2014 */ #include stdbool.h -typedef struct - { - bool blend; // + src dst of glBlendFunc +typedef struct { + bool blend; /* plus src dst of glBlendFunc? */ bool depth_test; bool depth_write; bool lighting; - }
[Bf-blender-cvs] [3f860e0] asset-engine: AssetEngine: add IDProps, and RNA access to actual asset engine from filespace.
Commit: 3f860e0e733a0f562f24af1b9ab5a3ffa7a67e10 Author: Bastien Montagne Date: Tue Mar 17 21:07:57 2015 +0100 Branches: asset-engine https://developer.blender.org/rB3f860e0e733a0f562f24af1b9ab5a3ffa7a67e10 AssetEngine: add IDProps, and RNA access to actual asset engine from filespace. Also, some quick dummy test/demo code for that in Amber. === M release/scripts/startup/bl_operators/amber.py M release/scripts/startup/bl_ui/space_filebrowser.py M source/blender/blenkernel/BKE_asset.h M source/blender/blenkernel/intern/asset.c M source/blender/editors/include/ED_fileselect.h M source/blender/editors/space_file/filelist.c M source/blender/makesrna/intern/rna_asset.c M source/blender/makesrna/intern/rna_space.c M source/blenderplayer/bad_level_call_stubs/stubs.c === diff --git a/release/scripts/startup/bl_operators/amber.py b/release/scripts/startup/bl_operators/amber.py index 7f56eb2..a80307c 100644 --- a/release/scripts/startup/bl_operators/amber.py +++ b/release/scripts/startup/bl_operators/amber.py @@ -22,7 +22,7 @@ # as a startup module! import bpy -from bpy.types import AssetEngine +from bpy.types import AssetEngine, Panel from bpy.props import ( StringProperty, BoolProperty, @@ -253,10 +253,16 @@ class AmberJobList(AmberJob): ### -# Mains Asset Engine class. +# Main Asset Engine class. class AssetEngineAmber(AssetEngine): bl_label = Amber +max_entries = IntProperty( +name=Max Entries, +description=Max number of entries to return as a 'list' request (avoids risks of 'explosion' on big repos), +min=10, max=1, default=1000, +) + def __init__(self): self.executor = futures.ThreadPoolExecutor(8) # Using threads for now, if issues arise we'll switch to process. self.jobs = {} @@ -328,6 +334,34 @@ class AssetEngineAmber(AssetEngine): return True +## +# UI stuff + +class AmberPanel(): +@classmethod +def poll(cls, context): +space = context.space_data +if space and space.type == 'FILE_BROWSER': +ae = space.asset_engine +if ae and space.asset_engine_type == AssetEngineAmber: +return True +return False + +class AMBER_PT_options(Panel, AmberPanel): +bl_space_type = 'FILE_BROWSER' +bl_region_type = 'TOOLS' +bl_category = Asset Engine +bl_label = Amber Options + +def draw(self, context): +layout = self.layout +space = context.space_data +ae = space.asset_engine + +row = layout.row() +row.prop(ae, max_entries) + + if __name__ == __main__: # only for live edit. bpy.utils.register_module(__name__) bpy.utils.register_class(AssetEngineFlame) diff --git a/release/scripts/startup/bl_ui/space_filebrowser.py b/release/scripts/startup/bl_ui/space_filebrowser.py index 2cf2e8e..2167317 100644 --- a/release/scripts/startup/bl_ui/space_filebrowser.py +++ b/release/scripts/startup/bl_ui/space_filebrowser.py @@ -34,7 +34,7 @@ class FILEBROWSER_HT_header(Header): layout.template_header() row = layout.row() -row.prop(st, asset_engine, text=) +row.prop(st, asset_engine_type, text=) row.separator() row = layout.row(align=True) diff --git a/source/blender/blenkernel/BKE_asset.h b/source/blender/blenkernel/BKE_asset.h index 6036064..7ee314a 100644 --- a/source/blender/blenkernel/BKE_asset.h +++ b/source/blender/blenkernel/BKE_asset.h @@ -47,6 +47,7 @@ struct FileDirEntryVariant; struct FileDirEntryRevision; struct ExtensionRNA; struct ID; +struct IDProperty; struct ListBase; struct uiLayout; @@ -123,6 +124,9 @@ typedef struct AssetEngine { AssetEngineType *type; void *py_instance; + /* Custom sub-classes properties. */ + IDProperty *properties; + int flag; int refcount; diff --git a/source/blender/blenkernel/intern/asset.c b/source/blender/blenkernel/intern/asset.c index 8321523..d5df5f4 100644 --- a/source/blender/blenkernel/intern/asset.c +++ b/source/blender/blenkernel/intern/asset.c @@ -46,6 +46,7 @@ #include BLI_utildefines.h #include BKE_global.h +#include BKE_idprop.h #include BKE_report.h #include BKE_asset.h @@ -131,6 +132,11 @@ void BKE_asset_engine_free(AssetEngine *engine) } #endif + if (engine-properties) { + IDP_FreeProperty(engine-properties); + MEM_freeN(engine-properties); + } + MEM_freeN(engine); } } diff --git a/source/blender/editors/include/ED_fileselect.h b/source/blender/editors/include/ED_fileselect.h index b81ea55..8625fa1 100644 --- a/source/blender/editors/include/ED_fileselect.h +++
[Bf-blender-cvs] [6db876b] alembic_pointcache: Merge branch 'master' into alembic_pointcache
Commit: 6db876bef6325b81d598da0324fc48e71c52ba0f Author: Lukas Tönne Date: Sat Mar 21 17:58:52 2015 +0100 Branches: alembic_pointcache https://developer.blender.org/rB6db876bef6325b81d598da0324fc48e71c52ba0f Merge branch 'master' into alembic_pointcache === === diff --cc source/blender/blenkernel/BKE_mesh.h index c88b102,1f3458c..003d3ff --- a/source/blender/blenkernel/BKE_mesh.h +++ b/source/blender/blenkernel/BKE_mesh.h @@@ -131,9 -130,11 +131,12 @@@ bool BKE_mesh_uv_cdlayer_rename(struct float (*BKE_mesh_vertexCos_get(struct Mesh *me, int *r_numVerts))[3]; + void BKE_mesh_calc_normals_split(struct Mesh *mesh); + void BKE_mesh_split_faces(struct Mesh *mesh); + struct Mesh *BKE_mesh_new_from_object(struct Main *bmain, struct Scene *sce, struct Object *ob, int apply_modifiers, int settings, int calc_tessface, int calc_undeformed); +struct Mesh *BKE_mesh_new_from_dupli_data(struct Main *bmain, struct DupliObjectData *data, bool calc_tessface, bool calc_undeformed); /* vertex level transformations checks (no derived mesh) */ ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [8e9c9fd] master: OSX/GHOST: need one more release in error case
Commit: 8e9c9fde427c228111cfe2da6dfac9e54abb2a3d Author: Jens Verwiebe Date: Sat Mar 21 17:15:38 2015 +0100 Branches: master https://developer.blender.org/rB8e9c9fde427c228111cfe2da6dfac9e54abb2a3d OSX/GHOST: need one more release in error case === M intern/ghost/intern/GHOST_ContextCGL.mm === diff --git a/intern/ghost/intern/GHOST_ContextCGL.mm b/intern/ghost/intern/GHOST_ContextCGL.mm index cf94dc8..ae7e7a6 100644 --- a/intern/ghost/intern/GHOST_ContextCGL.mm +++ b/intern/ghost/intern/GHOST_ContextCGL.mm @@ -334,6 +334,7 @@ GHOST_TSuccess GHOST_ContextCGL::initializeDrawingContext() error: [m_openGLView setOpenGLContext:prev_openGLContext]; + [pixelFormat release]; [pool drain]; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [01b6fd1] asset-experiments: Merge branch 'master' into asset-experiments
Commit: 01b6fd1f3e94fda5698f41480cb770ea606c1ae4 Author: Bastien Montagne Date: Thu Mar 19 14:01:16 2015 +0100 Branches: asset-experiments https://developer.blender.org/rB01b6fd1f3e94fda5698f41480cb770ea606c1ae4 Merge branch 'master' into asset-experiments === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [8834875] asset-experiments: Merge branch 'master' into asset-experiments
Commit: 88348752814867ea34381b233c72ca54b8bb0ea4 Author: Bastien Montagne Date: Sat Mar 21 16:44:40 2015 +0100 Branches: asset-experiments https://developer.blender.org/rB88348752814867ea34381b233c72ca54b8bb0ea4 Merge branch 'master' into asset-experiments === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [9553016] asset-experiments: WIP
Commit: 9553016ec1df81939a0e0980dfdba14525821b62 Author: Bastien Montagne Date: Thu Mar 19 16:15:42 2015 +0100 Branches: asset-experiments https://developer.blender.org/rB9553016ec1df81939a0e0980dfdba14525821b62 WIP === M source/blender/makesdna/DNA_space_types.h === diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index df6be88..3c85dad 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -847,6 +847,9 @@ typedef struct FileDirEntryArr { int pad; char root[1024]; /* FILE_MAX */ + + /* Internal only, used by filebrowser listing code. */ + void *data; } FileDirEntryArr; #define ASSET_UUID_LENGTH 24 ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [9ff3d8e] master: Cleanup: minor edits to project generators
Commit: 9ff3d8eafae92a7071d86028d3c71308ad28125b Author: Campbell Barton Date: Sun Mar 22 03:24:56 2015 +1100 Branches: master https://developer.blender.org/rB9ff3d8eafae92a7071d86028d3c71308ad28125b Cleanup: minor edits to project generators === M build_files/cmake/cmake_netbeans_project.py M build_files/cmake/cmake_qtcreator_project.py === diff --git a/build_files/cmake/cmake_netbeans_project.py b/build_files/cmake/cmake_netbeans_project.py index 81b1a46..25d0737 100755 --- a/build_files/cmake/cmake_netbeans_project.py +++ b/build_files/cmake/cmake_netbeans_project.py @@ -29,18 +29,19 @@ Example linux usage Windows not supported so far -from project_info import (SIMPLE_PROJECTFILE, - SOURCE_DIR, - CMAKE_DIR, - PROJECT_DIR, - source_list, - is_project_file, - is_c_header, - # is_py, - cmake_advanced_info, - cmake_compiler_defines, - project_name_get, - ) +from project_info import ( +SIMPLE_PROJECTFILE, +SOURCE_DIR, +CMAKE_DIR, +PROJECT_DIR, +source_list, +is_project_file, +is_c_header, +# is_py, +cmake_advanced_info, +cmake_compiler_defines, +project_name_get, +) import os diff --git a/build_files/cmake/cmake_qtcreator_project.py b/build_files/cmake/cmake_qtcreator_project.py index 1676d63..67302c8 100755 --- a/build_files/cmake/cmake_qtcreator_project.py +++ b/build_files/cmake/cmake_qtcreator_project.py @@ -22,26 +22,27 @@ # pep8 compliant - +r +Example Linux usage: + python ~/blender-git/blender/build_files/cmake/cmake_qtcreator_project.py ~/blender-git/cmake + Example Win32 usage: c:\Python32\python.exe c:\blender_dev\blender\build_files\cmake\cmake_qtcreator_project.py c:\blender_dev\cmake_build - -example linux usage - python ~/blender-git/blender/build_files/cmake/cmake_qtcreator_project.py ~/blender-git/cmake -from project_info import (SIMPLE_PROJECTFILE, - SOURCE_DIR, - # CMAKE_DIR, - PROJECT_DIR, - source_list, - is_project_file, - is_c_header, - is_py, - cmake_advanced_info, - cmake_compiler_defines, - project_name_get, - ) +from project_info import ( +SIMPLE_PROJECTFILE, +SOURCE_DIR, +# CMAKE_DIR, +PROJECT_DIR, +source_list, +is_project_file, +is_c_header, +is_py, +cmake_advanced_info, +cmake_compiler_defines, +project_name_get, +) import os import sys @@ -63,18 +64,19 @@ def create_qtc_project_main(): if SIMPLE_PROJECTFILE: # --- qtcreator specific, simple format PROJECT_NAME = Blender -with open(os.path.join(PROJECT_DIR, %s.files % PROJECT_NAME), 'w') as f: +FILE_NAME = PROJECT_NAME.lower() +with open(os.path.join(PROJECT_DIR, %s.files % FILE_NAME), 'w') as f: f.write(\n.join(files_rel)) -with open(os.path.join(PROJECT_DIR, %s.includes % PROJECT_NAME), 'w') as f: +with open(os.path.join(PROJECT_DIR, %s.includes % FILE_NAME), 'w') as f: f.write(\n.join(sorted(list(set(os.path.dirname(f) for f in files_rel if is_c_header(f)) -qtc_prj = os.path.join(PROJECT_DIR, %s.creator % PROJECT_NAME) +qtc_prj = os.path.join(PROJECT_DIR, %s.creator % FILE_NAME) with open(qtc_prj, 'w') as f: f.write([General]\n) -qtc_cfg = os.path.join(PROJECT_DIR, %s.config % PROJECT_NAME) +qtc_cfg = os.path.join(PROJECT_DIR, %s.config % FILE_NAME) if not os.path.exists(qtc_cfg): with open(qtc_cfg, 'w') as f: f.write(// ADD PREDEFINED MACROS HERE!\n) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [e183199] master: Cleanup: instantiate arg once in context macro
Commit: e1831990227ad43c9c41fca8f3e3639aaa222c2d Author: Campbell Barton Date: Sun Mar 22 03:29:59 2015 +1100 Branches: master https://developer.blender.org/rBe1831990227ad43c9c41fca8f3e3639aaa222c2d Cleanup: instantiate arg once in context macro === M source/creator/creator.c === diff --git a/source/creator/creator.c b/source/creator/creator.c index 0ca5fbe..9815b3c 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -1185,19 +1185,24 @@ static int set_skip_frame(int argc, const char **argv, void *data) #define BPY_CTX_SETUP(_cmd) \ { \ wmWindowManager *wm = CTX_wm_manager(C); \ - wmWindow *prevwin = CTX_wm_window(C); \ - Scene *prevscene = CTX_data_scene(C); \ - if (wm-windows.first) { \ + Scene *scene_prev = CTX_data_scene(C); \ + wmWindow *win_prev; \ + const bool has_win = !BLI_listbase_is_empty(wm-windows); \ + if (has_win) { \ + win_prev = CTX_wm_window(C); \ CTX_wm_window_set(C, wm-windows.first); \ - _cmd; \ - CTX_wm_window_set(C, prevwin); \ } \ else { \ fprintf(stderr, Python script \%s\ \ running with missing context data.\n, argv[1]); \ + } \ + { \ _cmd; \ } \ - CTX_data_scene_set(C, prevscene); \ + if (has_win) { \ + CTX_wm_window_set(C, win_prev); \ + } \ + CTX_data_scene_set(C, scene_prev); \ } (void)0 \ #endif /* WITH_PYTHON */ ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [2744ce7] master: Revert part of D1074 related to acceleration taked into account. It has been reverted because it was affecting obstacle avoidance (T44041).
Commit: 2744ce77dea394026bc524e68c687050bc8e0c28 Author: Jorge Bernal Date: Sat Mar 21 17:53:18 2015 +0100 Branches: master https://developer.blender.org/rB2744ce77dea394026bc524e68c687050bc8e0c28 Revert part of D1074 related to acceleration taked into account. It has been reverted because it was affecting obstacle avoidance (T44041). This fix should be backported to 2.74 === M source/blender/blenloader/intern/versioning_270.c M source/gameengine/Ketsji/KX_SteeringActuator.cpp === diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c index ee015fa..adf5f93 100644 --- a/source/blender/blenloader/intern/versioning_270.c +++ b/source/blender/blenloader/intern/versioning_270.c @@ -616,18 +616,6 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main) } } } - - if (!DNA_struct_elem_find(fd-filesdna, bSteeringActuator, float, acceleration)) { - for (ob = main-object.first; ob; ob = ob-id.next) { - bActuator *act; - for (act = ob-actuators.first; act; act = act-next) { - if (act-type == ACT_STEERING) { - bSteeringActuator *sact = act-data; - sact-acceleration = 1000.f; - } - } - } - } } if (!MAIN_VERSION_ATLEAST(main, 273, 9)) { diff --git a/source/gameengine/Ketsji/KX_SteeringActuator.cpp b/source/gameengine/Ketsji/KX_SteeringActuator.cpp index f859b1c..83597f9 100644 --- a/source/gameengine/Ketsji/KX_SteeringActuator.cpp +++ b/source/gameengine/Ketsji/KX_SteeringActuator.cpp @@ -263,12 +263,12 @@ bool KX_SteeringActuator::Update(double curtime, bool frame) if (apply_steerforce) { - MT_Vector3 newvel; bool isdyna = obj-IsDynamic(); if (isdyna) m_steerVec.z() = 0; if (!m_steerVec.fuzzyZero()) m_steerVec.normalize(); + MT_Vector3 newvel = m_velocity * m_steerVec; //adjust velocity to avoid obstacles if (m_simulation m_obstacle /* !newvel.fuzzyZero()*/) @@ -281,16 +281,13 @@ bool KX_SteeringActuator::Update(double curtime, bool frame) KX_RasterizerDrawDebugLine(mypos, mypos + newvel, MT_Vector3(0.0, 1.0, 0.0)); } - HandleActorFace(m_steerVec); + HandleActorFace(newvel); if (isdyna) { - //TODO: Take into account angular velocity on turns + //temporary solution: set 2D steering velocity directly to obj + //correct way is to apply physical force MT_Vector3 curvel = obj-GetLinearVelocity(); - newvel = (curvel.length() * m_steerVec) + (m_acceleration * delta) * m_steerVec; - if (newvel.length2() = (m_velocity * m_velocity)) - newvel = m_velocity * m_steerVec; - if (m_lockzvel) newvel.z() = 0.0f; else ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [8bc8015] asset-engine: WIP Amber: very quick, dirty, primitive and broken first implementation of tags handling.
Commit: 8bc80156577ebd9e1104a0f4dd3b4c10f3821394 Author: Bastien Montagne Date: Tue Mar 17 21:37:58 2015 +0100 Branches: asset-engine https://developer.blender.org/rB8bc80156577ebd9e1104a0f4dd3b4c10f3821394 WIP Amber: very quick, dirty, primitive and broken first implementation of tags handling. We cannot do that correctly with current listdir system, have to rework again in asset-experiments brnach first, so that listing, filtering and sorting is completely delocalized to asset engine (will also try to solve scalability issues). === M release/scripts/startup/bl_operators/amber.py === diff --git a/release/scripts/startup/bl_operators/amber.py b/release/scripts/startup/bl_operators/amber.py index a80307c..897dc81 100644 --- a/release/scripts/startup/bl_operators/amber.py +++ b/release/scripts/startup/bl_operators/amber.py @@ -143,7 +143,7 @@ class AmberJobList(AmberJob): self.ls_task = self.executor.submit(self.ls, self.root) self.status = {'VALID', 'RUNNING'} -def update(self, entries, uuids): +def update(self, repository, dirs, uuids): self.status = {'VALID', 'RUNNING'} if self.ls_task is not None: if not self.ls_task.done(): @@ -151,8 +151,10 @@ class AmberJobList(AmberJob): paths, repo = self.ls_task.result() self.ls_task = None self.tot = len(paths) +repository.clear() +dirs.clear() if repo is not None: -self.repo = repo +repository.update(repo) for p in paths: self.stat_tasks.add(self.executor.submit(self.stat, self.root, p)) @@ -163,73 +165,10 @@ class AmberJobList(AmberJob): self.nbr += 1 if is_dir: # We only list dirs from real file system. -entry = entries.entries.add() -entry.type = {'DIR'} -entry.relpath = path -entry.uuid = entry.relpath.encode()[:8] + b| + bytes(self.nbr) -uuids[entry.uuid] = self.root + path -variant = entry.variants.add() -entry.variants.active = variant -rev = variant.revisions.add() -rev.size = size -rev.timestamp = timestamp -variant.revisions.active = rev +dirs.append((path, size, timestamp, path.encode()[:8] + b| + bytes(self.nbr))) done.add(tsk) self.stat_tasks -= done -if self.repo is not None: -existing = {} -for e in entries.entries: -vd = {} -existing[e.uuid] = (e, vd) -for v in e.variants: -rd = {} -vd[v.uuid] = (v, rd) -for r in v.revisions: -rd[r.uuid] = r -for euuid, e in self.repo[entries].items(): -entry_uuid = binascii.unhexlify(euuid) -entry, existing_vuuids = existing.get(entry_uuid, (None, {})) -if entry is None: -entry = entries.entries.add() -entry.uuid = entry_uuid -entry.name = e[name] -entry.description = e[description] -entry.type = {e[file_type]} -entry.blender_type = e[blen_type] -existing[entry_uuid] = (entry, existing_vuuids) # Not really needed, but for sake of consistency... -vuuids = {} -uuids[entry.uuid] = (self.root, entry.type, entry.blender_type, vuuids) -act_rev = None -for vuuid, v in e[variants].items(): -variant_uuid = binascii.unhexlify(vuuid) -variant, existing_ruuids = existing_vuuids.get(variant_uuid, (None, {})) -if variant is None: -variant = entry.variants.add() -variant.uuid = variant_uuid -variant.name = v[name] -variant.description = v[description] -existing_vuuids[variant_uuid] = (variant, existing_ruuids) # Not really needed, but for sake of consistency... -ruuids = vuuids[variant_uuid] = {} -if vuuid == e[variant_default]: -entry.variants.active = variant -for ruuid, r in v[revisions].items(): -revision_uuid = binascii.unhexlify(ruuid) -revision = existing_ruuids.get(revision_uuid, None) -if revision is None: -revision = variant.revisions.add() -
[Bf-blender-cvs] [a9f02fd] asset-engine: Merge branch 'asset-experiments' into asset-engine
Commit: a9f02fda07e86517b9e8d450e22248ca8c87eee1 Author: Bastien Montagne Date: Sat Mar 21 16:48:34 2015 +0100 Branches: asset-engine https://developer.blender.org/rBa9f02fda07e86517b9e8d450e22248ca8c87eee1 Merge branch 'asset-experiments' into asset-engine Conflicts: source/blender/makesdna/DNA_space_types.h === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [d28bfb5] master: Cleanup: constify view3d/camera
Commit: d28bfb5022b56a82424c6242e77a7658803ed7ca Author: Campbell Barton Date: Sat Mar 21 22:34:20 2015 +1100 Branches: master https://developer.blender.org/rBd28bfb5022b56a82424c6242e77a7658803ed7ca Cleanup: constify view3d/camera === M source/blender/blenkernel/BKE_camera.h M source/blender/blenkernel/intern/camera.c M source/blender/blenkernel/intern/lattice.c M source/blender/editors/include/ED_view3d.h M source/blender/editors/space_view3d/view3d_draw.c M source/blender/editors/space_view3d/view3d_edit.c M source/blender/editors/space_view3d/view3d_intern.h M source/blender/editors/space_view3d/view3d_view.c M source/blender/makesrna/intern/rna_object_api.c === diff --git a/source/blender/blenkernel/BKE_camera.h b/source/blender/blenkernel/BKE_camera.h index ead58c2..4849c66 100644 --- a/source/blender/blenkernel/BKE_camera.h +++ b/source/blender/blenkernel/BKE_camera.h @@ -109,23 +109,30 @@ typedef struct CameraParams { #define CAMERA_PARAM_ZOOM_INIT_PERSP 2.0f void BKE_camera_params_init(CameraParams *params); -void BKE_camera_params_from_object(CameraParams *params, struct Object *camera); -void BKE_camera_params_from_view3d(CameraParams *params, struct View3D *v3d, struct RegionView3D *rv3d); +void BKE_camera_params_from_object(CameraParams *params, const struct Object *camera); +void BKE_camera_params_from_view3d(CameraParams *params, const struct View3D *v3d, const struct RegionView3D *rv3d); void BKE_camera_params_compute_viewplane(CameraParams *params, int winx, int winy, float aspx, float aspy); void BKE_camera_params_compute_matrix(CameraParams *params); /* Camera View Frame */ -void BKE_camera_view_frame_ex(struct Scene *scene, struct Camera *camera, float drawsize, const bool do_clip, const float scale[3], - float r_asp[2], float r_shift[2], float *r_drawsize, float r_vec[4][3]); - -void BKE_camera_view_frame(struct Scene *scene, struct Camera *camera, float r_vec[4][3]); - -bool BKE_camera_view_frame_fit_to_scene(struct Scene *scene, struct View3D *v3d, struct Object *camera_ob, -float r_co[3], float *r_scale); -bool BKE_camera_view_frame_fit_to_coords(struct Scene *scene, float (*cos)[3], int num_cos, - struct Object *camera_ob, float r_co[3], float *r_scale); +void BKE_camera_view_frame_ex( +const struct Scene *scene, const struct Camera *camera, +const float drawsize, const bool do_clip, const float scale[3], +float r_asp[2], float r_shift[2], float *r_drawsize, float r_vec[4][3]); +void BKE_camera_view_frame( +const struct Scene *scene, const struct Camera *camera, +float r_vec[4][3]); + +bool BKE_camera_view_frame_fit_to_scene( +struct Scene *scene, struct View3D *v3d, struct Object *camera_ob, +float r_co[3], float *r_scale); +bool BKE_camera_view_frame_fit_to_coords( +const struct Scene *scene, +const float (*cos)[3], int num_cos, +const struct Object *camera_ob, +float r_co[3], float *r_scale); void BKE_camera_to_gpu_dof(struct Object *camera, struct GPUFXSettings *r_fx_settings); diff --git a/source/blender/blenkernel/intern/camera.c b/source/blender/blenkernel/intern/camera.c index ed400bc..886df16 100644 --- a/source/blender/blenkernel/intern/camera.c +++ b/source/blender/blenkernel/intern/camera.c @@ -213,7 +213,7 @@ void BKE_camera_params_init(CameraParams *params) params-clipend = 100.0f; } -void BKE_camera_params_from_object(CameraParams *params, Object *ob) +void BKE_camera_params_from_object(CameraParams *params, const Object *ob) { if (!ob) return; @@ -255,7 +255,7 @@ void BKE_camera_params_from_object(CameraParams *params, Object *ob) } } -void BKE_camera_params_from_view3d(CameraParams *params, View3D *v3d, RegionView3D *rv3d) +void BKE_camera_params_from_view3d(CameraParams *params, const View3D *v3d, const RegionView3D *rv3d) { /* common */ params-lens = v3d-lens; @@ -384,8 +384,10 @@ void BKE_camera_params_compute_matrix(CameraParams *params) /* Camera View Frame */ -void BKE_camera_view_frame_ex(Scene *scene, Camera *camera, float drawsize, const bool do_clip, const float scale[3], - float r_asp[2], float r_shift[2], float *r_drawsize, float r_vec[4][3]) +void BKE_camera_view_frame_ex( +const Scene *scene, const Camera *camera, +const float drawsize, const bool do_clip, const float scale[3], +float r_asp[2], float r_shift[2], float *r_drawsize, float r_vec[4][3]) { float facx, facy; float depth; @@ -456,7 +458,7 @@ void BKE_camera_view_frame_ex(Scene
[Bf-blender-cvs] [6e50bdd] master: Cleanup: constify scene/modifiers
Commit: 6e50bdd870b7486cea128e0dcc9777045237ea4a Author: Campbell Barton Date: Sat Mar 21 22:10:43 2015 +1100 Branches: master https://developer.blender.org/rB6e50bdd870b7486cea128e0dcc9777045237ea4a Cleanup: constify scene/modifiers === M source/blender/blenkernel/BKE_dynamicpaint.h M source/blender/blenkernel/BKE_editmesh.h M source/blender/blenkernel/BKE_scene.h M source/blender/blenkernel/BKE_texture.h M source/blender/blenkernel/intern/DerivedMesh.c M source/blender/blenkernel/intern/dynamicpaint.c M source/blender/blenkernel/intern/editderivedmesh.c M source/blender/blenkernel/intern/scene.c M source/blender/blenkernel/intern/texture.c M source/blender/modifiers/intern/MOD_util.c M source/blender/modifiers/intern/MOD_util.h === diff --git a/source/blender/blenkernel/BKE_dynamicpaint.h b/source/blender/blenkernel/BKE_dynamicpaint.h index a8e152f..1aba72e 100644 --- a/source/blender/blenkernel/BKE_dynamicpaint.h +++ b/source/blender/blenkernel/BKE_dynamicpaint.h @@ -70,8 +70,8 @@ void dynamicPaint_Modifier_copy(struct DynamicPaintModifierData *pmd, struct Dyn bool dynamicPaint_createType(struct DynamicPaintModifierData *pmd, int type, struct Scene *scene); struct DynamicPaintSurface *dynamicPaint_createNewSurface(struct DynamicPaintCanvasSettings *canvas, struct Scene *scene); -void dynamicPaint_clearSurface(struct Scene *scene, struct DynamicPaintSurface *surface); -bool dynamicPaint_resetSurface(struct Scene *scene, struct DynamicPaintSurface *surface); +void dynamicPaint_clearSurface(const struct Scene *scene, struct DynamicPaintSurface *surface); +bool dynamicPaint_resetSurface(const struct Scene *scene, struct DynamicPaintSurface *surface); void dynamicPaint_freeSurface(struct DynamicPaintSurface *surface); void dynamicPaint_freeCanvas(struct DynamicPaintModifierData *pmd); void dynamicPaint_freeBrush(struct DynamicPaintModifierData *pmd); diff --git a/source/blender/blenkernel/BKE_editmesh.h b/source/blender/blenkernel/BKE_editmesh.h index 38c8cf1..f80e03f 100644 --- a/source/blender/blenkernel/BKE_editmesh.h +++ b/source/blender/blenkernel/BKE_editmesh.h @@ -97,7 +97,7 @@ voidBKE_editmesh_color_ensure(BMEditMesh *em, const char htype); /* editderivedmesh.c */ /* should really be defined in editmesh.c, but they use 'EditDerivedBMesh' */ voidBKE_editmesh_statvis_calc(BMEditMesh *em, struct DerivedMesh *dm, - struct MeshStatVis *statvis); + const struct MeshStatVis *statvis); float (*BKE_editmesh_vertexCos_get(struct BMEditMesh *em, struct Scene *scene, int *r_numVerts))[3]; diff --git a/source/blender/blenkernel/BKE_scene.h b/source/blender/blenkernel/BKE_scene.h index 149472d..c191f38 100644 --- a/source/blender/blenkernel/BKE_scene.h +++ b/source/blender/blenkernel/BKE_scene.h @@ -113,8 +113,8 @@ char *BKE_scene_find_last_marker_name(struct Scene *scene, int frame); /* checks for cycle, returns 1 if it's all OK */ bool BKE_scene_validate_setscene(struct Main *bmain, struct Scene *sce); -float BKE_scene_frame_get(struct Scene *scene); -float BKE_scene_frame_get_from_ctime(struct Scene *scene, const float frame); +float BKE_scene_frame_get(const struct Scene *scene); +float BKE_scene_frame_get_from_ctime(const struct Scene *scene, const float frame); void BKE_scene_frame_set(struct Scene *scene, double cfra); /* ** Scene evaluation ** */ @@ -126,15 +126,15 @@ struct SceneRenderLayer *BKE_scene_add_render_layer(struct Scene *sce, const cha bool BKE_scene_remove_render_layer(struct Main *main, struct Scene *scene, struct SceneRenderLayer *srl); /* render profile */ -int get_render_subsurf_level(struct RenderData *r, int level); -int get_render_child_particle_number(struct RenderData *r, int num); -int get_render_shadow_samples(struct RenderData *r, int samples); -float get_render_aosss_error(struct RenderData *r, float error); +int get_render_subsurf_level(const struct RenderData *r, int level); +int get_render_child_particle_number(const struct RenderData *r, int num); +int get_render_shadow_samples(const struct RenderData *r, int samples); +float get_render_aosss_error(const struct RenderData *r, float error); -bool BKE_scene_use_new_shading_nodes(struct Scene *scene); +bool BKE_scene_use_new_shading_nodes(const struct Scene *scene); -bool BKE_scene_uses_blender_internal(struct Scene *scene); -bool BKE_scene_uses_blender_game(struct Scene *scene); +bool BKE_scene_uses_blender_internal(const struct Scene *scene); +bool BKE_scene_uses_blender_game(const struct Scene *scene); void BKE_scene_disable_color_management(struct Scene *scene); bool BKE_scene_check_color_management_enabled(const struct Scene *scene); diff --git a/source/blender/blenkernel/BKE_texture.h
[Bf-blender-cvs] [7ad48ff] multiview: Merge remote-tracking branch 'origin/master' into multiview
Commit: 7ad48ff467e388bc5a7619c95ef1338613509483 Author: Dalai Felinto Date: Sat Mar 21 14:09:59 2015 +0100 Branches: multiview https://developer.blender.org/rB7ad48ff467e388bc5a7619c95ef1338613509483 Merge remote-tracking branch 'origin/master' into multiview Conflicts: source/blender/render/intern/source/external_engine.c === === diff --cc source/blender/blenkernel/BKE_scene.h index 292e365,c191f38..14c1a5f --- a/source/blender/blenkernel/BKE_scene.h +++ b/source/blender/blenkernel/BKE_scene.h @@@ -126,19 -125,16 +126,19 @@@ void BKE_scene_update_for_newframe_ex(s struct SceneRenderLayer *BKE_scene_add_render_layer(struct Scene *sce, const char *name); bool BKE_scene_remove_render_layer(struct Main *main, struct Scene *scene, struct SceneRenderLayer *srl); +struct SceneRenderView *BKE_scene_add_render_view(struct Scene *sce, const char *name); +bool BKE_scene_remove_render_view(struct Scene *scene, struct SceneRenderView *srv); + /* render profile */ - int get_render_subsurf_level(struct RenderData *r, int level); - int get_render_child_particle_number(struct RenderData *r, int num); - int get_render_shadow_samples(struct RenderData *r, int samples); - float get_render_aosss_error(struct RenderData *r, float error); + int get_render_subsurf_level(const struct RenderData *r, int level); + int get_render_child_particle_number(const struct RenderData *r, int num); + int get_render_shadow_samples(const struct RenderData *r, int samples); + float get_render_aosss_error(const struct RenderData *r, float error); - bool BKE_scene_use_new_shading_nodes(struct Scene *scene); + bool BKE_scene_use_new_shading_nodes(const struct Scene *scene); - bool BKE_scene_uses_blender_internal(struct Scene *scene); - bool BKE_scene_uses_blender_game(struct Scene *scene); + bool BKE_scene_uses_blender_internal(const struct Scene *scene); + bool BKE_scene_uses_blender_game(const struct Scene *scene); void BKE_scene_disable_color_management(struct Scene *scene); bool BKE_scene_check_color_management_enabled(const struct Scene *scene); diff --cc source/blender/blenkernel/intern/scene.c index 4fcb06c,c28d741..eed86e0 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@@ -1917,45 -1889,9 +1917,45 @@@ bool BKE_scene_remove_render_layer(Mai return true; } +/* return default view */ +SceneRenderView *BKE_scene_add_render_view(Scene *sce, const char *name) +{ + SceneRenderView *srv; + + if (!name) + name = DATA_(RenderView); + + srv = MEM_callocN(sizeof(SceneRenderView), new render view); + BLI_strncpy(srv-name, name, sizeof(srv-name)); + BLI_uniquename(sce-r.views, srv, DATA_(RenderView), '.', offsetof(SceneRenderView, name), sizeof(srv-name)); + BLI_addtail(sce-r.views, srv); + + return srv; +} + +bool BKE_scene_remove_render_view(Scene *scene, SceneRenderView *srv) +{ + const int act = BLI_findindex(scene-r.views, srv); + + if (act == -1) { + return false; + } + else if (scene-r.views.first == scene-r.views.last) { + /* ensure 1 view is kept */ + return false; + } + + BLI_remlink(scene-r.views, srv); + MEM_freeN(srv); + + scene-r.actview = 0; + + return true; +} + /* render simplification */ - int get_render_subsurf_level(RenderData *r, int lvl) + int get_render_subsurf_level(const RenderData *r, int lvl) { if (r-mode R_SIMPLIFY) return min_ii(r-simplify_subsurf, lvl); diff --cc source/blender/render/intern/source/external_engine.c index d633478,653f3f0..45b0395 --- a/source/blender/render/intern/source/external_engine.c +++ b/source/blender/render/intern/source/external_engine.c @@@ -369,31 -368,18 +369,37 @@@ void RE_engine_set_error_message(Render } } +void RE_engine_actview_set(RenderEngine *engine, const char *viewname) +{ + Render *re = engine-re; + RE_SetActiveRenderView(re, viewname); +} + +float RE_engine_get_camera_shift_x(RenderEngine *engine, Object *camera) +{ + Render *re = engine-re; + return BKE_camera_multiview_shift_x(re ? re-r : NULL, camera, re-viewname); +} + +void RE_engine_get_camera_model_matrix(RenderEngine *engine, Object *camera, float *r_modelmat) +{ + Render *re = engine-re; + BKE_camera_multiview_model_matrix(re ? re-r : NULL, camera, re-viewname, (float (*)[4])r_modelmat); +} + + - void RE_engine_get_current_tiles(Render *re, int *total_tiles_r, rcti **tiles_r) + rcti* RE_engine_get_current_tiles(Render *re, int *total_tiles_r, bool *r_needs_free) { + static rcti tiles_static[BLENDER_MAX_THREADS]; + const int allocation_step = BLENDER_MAX_THREADS; RenderPart *pa; int total_tiles = 0; -
[Bf-blender-cvs] [d21018b] master: Fix T44065: fixed vehicle constraint
Commit: d21018b3340496865626b279852159347ac9c102 Author: Sybren A. Stüvel Date: Sat Mar 21 14:42:57 2015 +0100 Branches: master https://developer.blender.org/rBd21018b3340496865626b279852159347ac9c102 Fix T44065: fixed vehicle constraint Commit ffee7f1a58a18bc08add94176ddffe29809139a6 broke vehicle constraints; this fixes that. === M source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp === diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp index c0aaefe..a30ee0f 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp @@ -2644,9 +2644,6 @@ int CcdPhysicsEnvironment::CreateConstraint(class PHY_IPhysicsController* ctrl if (!rb0) return 0; - // If either of the controllers is missing, we can't do anything. - if (!c0 || !c1) return 0; - btVector3 pivotInB = rb1 ? rb1-getCenterOfMassTransform().inverse()(rb0-getCenterOfMassTransform()(pivotInA)) : rb0-getCenterOfMassTransform() * pivotInA; btVector3 axisInA(axisX,axisY,axisZ); @@ -2658,6 +2655,8 @@ int CcdPhysicsEnvironment::CreateConstraint(class PHY_IPhysicsController* ctrl { case PHY_POINT2POINT_CONSTRAINT: { + // If either of the controllers is missing, we can't do anything. + if (!c0 || !c1) return 0; btPoint2PointConstraint* p2p = 0; @@ -2686,6 +2685,9 @@ int CcdPhysicsEnvironment::CreateConstraint(class PHY_IPhysicsController* ctrl case PHY_GENERIC_6DOF_CONSTRAINT: { + // If either of the controllers is missing, we can't do anything. + if (!c0 || !c1) return 0; + btGeneric6DofConstraint* genericConstraint = 0; if (rb1) @@ -2739,7 +2741,7 @@ int CcdPhysicsEnvironment::CreateConstraint(class PHY_IPhysicsController* ctrl *rb0,s_fixedObject2, frameInA,frameInB,useReferenceFrameA); } - + if (genericConstraint) { //m_constraints.push_back(genericConstraint); @@ -2756,6 +2758,9 @@ int CcdPhysicsEnvironment::CreateConstraint(class PHY_IPhysicsController* ctrl } case PHY_CONE_TWIST_CONSTRAINT: { + // If either of the controllers is missing, we can't do anything. + if (!c0 || !c1) return 0; + btConeTwistConstraint* coneTwistContraint = 0; @@ -2807,7 +2812,7 @@ int CcdPhysicsEnvironment::CreateConstraint(class PHY_IPhysicsController* ctrl *rb0,s_fixedObject2, frameInA,frameInB); } - + if (coneTwistContraint) { //m_constraints.push_back(genericConstraint); @@ -2830,6 +2835,9 @@ int CcdPhysicsEnvironment::CreateConstraint(class PHY_IPhysicsController* ctrl case PHY_LINEHINGE_CONSTRAINT: { + // If either of the controllers is missing, we can't do anything. + if (!c0 || !c1) return 0; + btHingeConstraint* hinge = 0; if (rb1) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [3b38dc9] decklink: This branch adds support for Decklink capture card in the BGE.
Commit: 3b38dc96af039f5e1802a266d1b0403794484f14 Author: Benoit Bolsee Date: Sat Mar 21 14:50:30 2015 +0100 Branches: decklink https://developer.blender.org/rB3b38dc96af039f5e1802a266d1b0403794484f14 This branch adds support for Decklink capture card in the BGE. Decklink capture cards from BlackMagicDesign are capable of capturing high speed video stream such as FullHD on HDMI, also 3D. It will be available in the VideoTexture module as a new type of texture source. The capture data will be sent to the GPU using GPUDirect for best performance. It will be available for Linux and Windows. This first commit is only a stub for Linux. Windows to be added. === M build_files/cmake/macros.cmake M intern/CMakeLists.txt M intern/SConscript A intern/decklink/CMakeLists.txt A intern/decklink/DeckLinkAPI.h A intern/decklink/DeckLinkAPIConfiguration.h A intern/decklink/DeckLinkAPIConfiguration_v10_2.h A intern/decklink/DeckLinkAPIDeckControl.h A intern/decklink/DeckLinkAPIDiscovery.h A intern/decklink/DeckLinkAPIDispatch.cpp A intern/decklink/DeckLinkAPIDispatch_v7_6.cpp A intern/decklink/DeckLinkAPIDispatch_v8_0.cpp A intern/decklink/DeckLinkAPIModes.h A intern/decklink/DeckLinkAPITypes.h A intern/decklink/DeckLinkAPIVersion.h A intern/decklink/DeckLinkAPI_v10_2.h A intern/decklink/DeckLinkAPI_v7_1.h A intern/decklink/DeckLinkAPI_v7_3.h A intern/decklink/DeckLinkAPI_v7_6.h A intern/decklink/DeckLinkAPI_v7_9.h A intern/decklink/DeckLinkAPI_v8_0.h A intern/decklink/DeckLinkAPI_v8_1.h A intern/decklink/DeckLinkAPI_v9_2.h A intern/decklink/DeckLinkAPI_v9_9.h A intern/decklink/LinuxCOM.h A intern/decklink/SConscript M source/blenderplayer/CMakeLists.txt M source/gameengine/VideoTexture/CMakeLists.txt M source/gameengine/VideoTexture/Common.h M source/gameengine/VideoTexture/Texture.cpp A source/gameengine/VideoTexture/VideoDeckLink.cpp A source/gameengine/VideoTexture/VideoDeckLink.h === diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index b266602..679a42d 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -564,6 +564,7 @@ macro(SETUP_BLENDER_SORTED_LIBS) bf_intern_mikktspace bf_intern_dualcon bf_intern_cycles + bf_intern_decklink cycles_render cycles_bvh cycles_device diff --git a/intern/CMakeLists.txt b/intern/CMakeLists.txt index 74048c2..fbafe56 100644 --- a/intern/CMakeLists.txt +++ b/intern/CMakeLists.txt @@ -32,6 +32,7 @@ add_subdirectory(opencolorio) add_subdirectory(mikktspace) add_subdirectory(raskter) add_subdirectory(glew-mx) +add_subdirectory(decklink) if(WITH_AUDASPACE) add_subdirectory(audaspace) diff --git a/intern/SConscript b/intern/SConscript index c0dafe3..742b31b 100644 --- a/intern/SConscript +++ b/intern/SConscript @@ -60,6 +60,9 @@ if env['WITH_BF_INTERNATIONAL']: if env['WITH_BF_BULLET']: SConscript (['rigidbody/SConscript']) +if env['WITH_BF_DECKLINK'] +SConscript (['decklink/SConscript']) + if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-mingw', 'linuxcross', 'win64-vc'): SConscript(['utfconv/SConscript']) diff --git a/intern/decklink/CMakeLists.txt b/intern/decklink/CMakeLists.txt new file mode 100644 index 000..a440b74 --- /dev/null +++ b/intern/decklink/CMakeLists.txt @@ -0,0 +1,45 @@ +# * BEGIN GPL LICENSE BLOCK * +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# The Original Code is Copyright (C) 2012, Blender Foundation +# All rights reserved. +# +# The Original Code is: all of this file. +# +# Contributor(s): Benoit Bolsee. +# +# * END GPL LICENSE BLOCK * + +set(INC + +) + +set(INC_SYS + +) + +set(SRC + DeckLinkAPIDispatch.cpp + DeckLinkAPI.h + LinuxCOM.h + DeckLinkAPITypes.h + DeckLinkAPIModes.h + DeckLinkAPIDiscovery.h + DeckLinkAPIConfiguration.h + DeckLinkAPIDeckControl.h +) +
[Bf-blender-cvs] [4ce017b] alembic_pointcache: Avoid conflicting unordered_map definition in cycles by using a general include path instead of the boost one.
Commit: 4ce017b4c80ec883115f8fbb7ca400649d98d63f Author: Lukas Tönne Date: Sat Mar 21 19:06:15 2015 +0100 Branches: alembic_pointcache https://developer.blender.org/rB4ce017b4c80ec883115f8fbb7ca400649d98d63f Avoid conflicting unordered_map definition in cycles by using a general include path instead of the boost one. For explanation see http://stackoverflow.com/questions/3973659/c-unordered-map-compiling-issue-with-g === M intern/cycles/util/util_map.h === diff --git a/intern/cycles/util/util_map.h b/intern/cycles/util/util_map.h index 54d6a8d..8084ede 100644 --- a/intern/cycles/util/util_map.h +++ b/intern/cycles/util/util_map.h @@ -18,7 +18,7 @@ #define __UTIL_MAP_H__ #include map -#include boost/tr1/unordered_map.hpp +#include tr1/unordered_map CCL_NAMESPACE_BEGIN ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [1d2aa62] alembic_pointcache: Fix for cycles cmake missing GLEW library variable when building without the GUI.
Commit: 1d2aa6236606af8cccf30eafc7125ddb70e3c8e6 Author: Lukas Tönne Date: Sat Mar 21 20:03:37 2015 +0100 Branches: alembic_pointcache https://developer.blender.org/rB1d2aa6236606af8cccf30eafc7125ddb70e3c8e6 Fix for cycles cmake missing GLEW library variable when building without the GUI. === M intern/cycles/cmake/external_libs.cmake === diff --git a/intern/cycles/cmake/external_libs.cmake b/intern/cycles/cmake/external_libs.cmake index d7c59f4..13196e2 100644 --- a/intern/cycles/cmake/external_libs.cmake +++ b/intern/cycles/cmake/external_libs.cmake @@ -30,7 +30,7 @@ if(NOT CYCLES_STANDALONE_REPOSITORY) set(GLEW_INCLUDE_DIR ${GLEW_INCLUDE_PATH}) endif() -if(WITH_CYCLES_STANDALONE AND WITH_CYCLES_STANDALONE_GUI) +if(WITH_CYCLES_STANDALONE) set(CYCLES_APP_GLEW_LIBRARY ${BLENDER_GLEW_LIBRARIES}) endif() ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [045350c] alembic_pointcache: Basic Alembic integration in the Cycles standalone.
Commit: 045350c3b172d9abe3950d579135d667849cb252 Author: Lukas Tönne Date: Sat Mar 21 20:22:25 2015 +0100 Branches: alembic_pointcache https://developer.blender.org/rB045350c3b172d9abe3950d579135d667849cb252 Basic Alembic integration in the Cycles standalone. This adds Alembic to the standalone application version of cycles. Files can be specified as XML or Alembic, or use automatic detection based on the filename extension. Currently the Alembic reader just dumps the file structure to stdout as a test. === M intern/cycles/app/CMakeLists.txt A intern/cycles/app/cycles_alembic.cpp A intern/cycles/app/cycles_alembic.h M intern/cycles/app/cycles_standalone.cpp === diff --git a/intern/cycles/app/CMakeLists.txt b/intern/cycles/app/CMakeLists.txt index b000266..b9a2abf 100644 --- a/intern/cycles/app/CMakeLists.txt +++ b/intern/cycles/app/CMakeLists.txt @@ -96,6 +96,12 @@ macro(cycles_target_link_libraries target) ${CMAKE_DL_LIBS} ${PLATFORM_LINKLIBS} ) + if(WITH_ALEMBIC) + target_link_libraries( + ${target} + ${ALEMBIC_LIBRARIES} + ) + endif() endmacro() # Application build targets @@ -106,6 +112,23 @@ if(WITH_CYCLES_STANDALONE) cycles_xml.cpp cycles_xml.h ) + + if(WITH_ALEMBIC) + list(APPEND SRC + cycles_alembic.cpp + cycles_alembic.h + ) + add_definitions(-DWITH_ALEMBIC) + include_directories( + SYSTEM + ${ALEMBIC_INCLUDE_DIRS} + ) + endif() + + if(WITH_HDF5) + add_definitions(-DWITH_HDF5) + endif() + add_executable(cycles ${SRC}) cycles_target_link_libraries(cycles) diff --git a/intern/cycles/app/cycles_alembic.cpp b/intern/cycles/app/cycles_alembic.cpp new file mode 100644 index 000..c801dd4 --- /dev/null +++ b/intern/cycles/app/cycles_alembic.cpp @@ -0,0 +1,288 @@ +/* + * Copyright 2015 Blender Foundation + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include stdio.h + +#include sstream +#include algorithm +#include iterator + +#include Alembic/AbcCoreOgawa/ReadWrite.h +#ifdef WITH_HDF5 +#include Alembic/AbcCoreHDF5/ReadWrite.h +#endif +#include Alembic/Abc/IArchive.h +#include Alembic/Abc/IObject.h +#include Alembic/Abc/ISampleSelector.h +#include Alembic/Abc/ICompoundProperty.h +#include Alembic/Abc/IScalarProperty.h +#include Alembic/Abc/IArrayProperty.h +#include Alembic/Abc/ArchiveInfo.h + +#include camera.h +#include film.h +#include graph.h +#include integrator.h +#include light.h +#include mesh.h +#include nodes.h +#include object.h +#include shader.h +#include scene.h + +#include subd_mesh.h +#include subd_patch.h +#include subd_split.h + +#include util_debug.h +#include util_foreach.h +#include util_path.h +#include util_transform.h +#include util_xml.h + +#include cycles_alembic.h + +CCL_NAMESPACE_BEGIN + +using namespace Alembic; +using namespace Abc; + +#define ABC_SAFE_CALL_BEGIN \ + try { + +#define ABC_SAFE_CALL_END \ + } \ + catch (Alembic::Util::Exception e) { \ + printf(%s, e.what()); \ + } + + +/* File */ + +static const std::string g_sep(;); + +static void visitProperties(std::stringstream ss, ICompoundProperty, std::string ); + +template class PROP +static void visitSimpleArrayProperty(std::stringstream ss, PROP iProp, const std::string iIndent) +{ + std::string ptype = ArrayProperty ; + size_t asize = 0; + + AbcA::ArraySamplePtr samp; + index_t maxSamples = iProp.getNumSamples(); + for (index_t i = 0 ; i maxSamples; ++i) { + iProp.get(samp, ISampleSelector( i )); + asize = samp-size(); + }; + + std::string mdstring = interpretation=; + mdstring += iProp.getMetaData().get(interpretation); + + std::stringstream dtype; + dtype datatype=; + dtype iProp.getDataType(); + + std::stringstream asizestr; + asizestr ;arraysize=; + asizestr asize; + + mdstring += g_sep; + + mdstring += dtype.str(); + + mdstring +=
[Bf-blender-cvs] [430b754] decklink: Add Windows DeckLink API, put Linux aside for now.
Commit: 430b754f9ab1c768ea4c2f979fe4217f5df969da Author: Benoit Bolsee Date: Sat Mar 21 23:15:59 2015 +0100 Branches: decklink https://developer.blender.org/rB430b754f9ab1c768ea4c2f979fe4217f5df969da Add Windows DeckLink API, put Linux aside for now. The VideoDeckLink object is still a stub but now it compiles and links with DeckLink COM API and nVidia DVP library. Only Windows CMake working at the moment. The nVidia DVP library is added in SVN win64_vc12 repo. === M CMakeLists.txt M build_files/cmake/macros.cmake M intern/CMakeLists.txt M intern/SConscript M intern/decklink/CMakeLists.txt A intern/decklink/DeckLinkAPI.cpp M intern/decklink/DeckLinkAPI.h D intern/decklink/DeckLinkAPIConfiguration.h D intern/decklink/DeckLinkAPIConfiguration_v10_2.h D intern/decklink/DeckLinkAPIDeckControl.h D intern/decklink/DeckLinkAPIDiscovery.h D intern/decklink/DeckLinkAPIDispatch.cpp D intern/decklink/DeckLinkAPIDispatch_v7_6.cpp D intern/decklink/DeckLinkAPIDispatch_v8_0.cpp D intern/decklink/DeckLinkAPIModes.h D intern/decklink/DeckLinkAPITypes.h D intern/decklink/DeckLinkAPIVersion.h D intern/decklink/DeckLinkAPI_v10_2.h D intern/decklink/DeckLinkAPI_v7_1.h D intern/decklink/DeckLinkAPI_v7_3.h D intern/decklink/DeckLinkAPI_v7_6.h D intern/decklink/DeckLinkAPI_v7_9.h D intern/decklink/DeckLinkAPI_v8_0.h D intern/decklink/DeckLinkAPI_v8_1.h D intern/decklink/DeckLinkAPI_v9_2.h D intern/decklink/DeckLinkAPI_v9_9.h D intern/decklink/LinuxCOM.h D intern/decklink/SConscript A intern/decklink/linux/DeckLinkAPI.h A intern/decklink/linux/DeckLinkAPIConfiguration.h A intern/decklink/linux/DeckLinkAPIConfiguration_v10_2.h A intern/decklink/linux/DeckLinkAPIDeckControl.h A intern/decklink/linux/DeckLinkAPIDiscovery.h A intern/decklink/linux/DeckLinkAPIDispatch.cpp A intern/decklink/linux/DeckLinkAPIDispatch_v7_6.cpp A intern/decklink/linux/DeckLinkAPIDispatch_v8_0.cpp A intern/decklink/linux/DeckLinkAPIModes.h A intern/decklink/linux/DeckLinkAPITypes.h A intern/decklink/linux/DeckLinkAPIVersion.h A intern/decklink/linux/DeckLinkAPI_v10_2.h A intern/decklink/linux/DeckLinkAPI_v7_1.h A intern/decklink/linux/DeckLinkAPI_v7_3.h A intern/decklink/linux/DeckLinkAPI_v7_6.h A intern/decklink/linux/DeckLinkAPI_v7_9.h A intern/decklink/linux/DeckLinkAPI_v8_0.h A intern/decklink/linux/DeckLinkAPI_v8_1.h A intern/decklink/linux/DeckLinkAPI_v9_2.h A intern/decklink/linux/DeckLinkAPI_v9_9.h A intern/decklink/linux/LinuxCOM.h A intern/decklink/win/DeckLinkAPI_h.h A intern/decklink/win/DeckLinkAPI_i.c M source/creator/CMakeLists.txt M source/gameengine/VideoTexture/CMakeLists.txt M source/gameengine/VideoTexture/VideoDeckLink.cpp M source/gameengine/VideoTexture/VideoDeckLink.h M source/gameengine/VideoTexture/blendVideoTex.cpp === diff --git a/CMakeLists.txt b/CMakeLists.txt index 21efa66..d89ce9e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -220,6 +220,9 @@ option(WITH_SYSTEM_BULLET Use the systems bullet library (currently unsupported mark_as_advanced(WITH_SYSTEM_BULLET) option(WITH_GAMEENGINEEnable Game Engine ${_init_GAMEENGINE}) option(WITH_PLAYERBuild Player OFF) +if (WIN32) + option(WITH_DECKLINK Support BlackMagicDesign DeckLink cards in the BGE OFF) +endif() option(WITH_OPENCOLORIO Enable OpenColorIO color management ${_init_OPENCOLORIO}) option(WITH_COMPOSITOREnable the tile based nodal compositor ON) @@ -1348,6 +1351,8 @@ elseif(WIN32) ) endif() + set(NVIDIA_GPUDIRECT_INCLUDE_DIRS ${LIBDIR}/NVIDIA_GPUDirect/include) + if(WITH_CODEC_FFMPEG) set(FFMPEG_INCLUDE_DIRS ${LIBDIR}/ffmpeg/include @@ -1368,6 +1373,15 @@ elseif(WIN32) endif() endif() + if(WITH_DECKLINK) + set(NVIDIA_GPUDIRECT_LIBRARIES + ${LIBDIR}/NVIDIA_GPUDirect/lib/dvp.lib + ) + set(NVIDIA_GPUDIRECT_LIBPATH + ${LIBDIR}/NVIDIA_GPUDirect/lib + ) + endif() + if(WITH_IMAGE_OPENEXR) set(OPENEXR_ROOT_DIR ${LIBDIR}/openexr) set(OPENEXR_VERSION 2.1) diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index 679a42d..68953e8 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -284,7 +284,9 @@ macro(SETUP_LIBDIRS)