[Bf-blender-cvs] [00ad259939f] master: Object.raycast: error in previous commit
Commit: 00ad259939fe3537b7e5967598ec09799eec20af Author: Germano Cavalcante Date: Sat Apr 15 02:31:33 2017 -0300 Branches: master https://developer.blender.org/rB00ad259939fe3537b7e5967598ec09799eec20af Object.raycast: error in previous commit This is taking longer than I expected. === M source/blender/makesrna/intern/rna_object_api.c === diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index b3bc2c72d34..55852139065 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -335,9 +335,11 @@ static void rna_Object_ray_cast( if (isect_ray_aabb_v3_simple(origin, direction, bb->vec[0], bb->vec[6], , )) { float dist = distmin >= 0 ? distmin : distmax; if (dist > distance) { + goto finally; } } else { + goto finally; } } @@ -372,6 +374,7 @@ static void rna_Object_ray_cast( } if (*r_success == false) { +finally: zero_v3(r_location); zero_v3(r_normal); *r_index = -1; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [4b043994e87] blender2.8: GPU Matrix API: clean up after 2D-3D unification
Commit: 4b043994e8795f37e9227362fe24fd66d45c6b39 Author: Mike Erwin Date: Sat Apr 15 01:29:25 2017 -0400 Branches: blender2.8 https://developer.blender.org/rB4b043994e8795f37e9227362fe24fd66d45c6b39 GPU Matrix API: clean up after 2D-3D unification See GPU_matrix.h & gpu_matrix.c for the important changes. Other files are mostly just updated to use the latest API. - remove unused functions, defines, enums, comments - remove "3D" from function names - init to Identity transform (otherwise empty stack) - gpuMatrixReset lets outside code return to initial state Part of T49450 Follow up to D2626 and 49fc9cff3b90 === M source/blender/blenfont/intern/blf.c M source/blender/draw/intern/draw_manager.c M source/blender/draw/intern/draw_view.c M source/blender/editors/curve/editcurve_paint.c M source/blender/editors/mask/mask_draw.c M source/blender/editors/mesh/editmesh_knife.c M source/blender/editors/mesh/editmesh_loopcut.c M source/blender/editors/screen/glutil.c M source/blender/editors/sculpt_paint/paint_utils.c M source/blender/editors/space_clip/clip_draw.c M source/blender/editors/space_clip/space_clip.c M source/blender/editors/space_view3d/drawanimviz.c M source/blender/editors/space_view3d/drawarmature.c M source/blender/editors/space_view3d/drawobject.c M source/blender/editors/space_view3d/drawsimdebug.c M source/blender/editors/space_view3d/space_view3d.c M source/blender/editors/space_view3d/view3d_draw.c M source/blender/editors/space_view3d/view3d_draw_legacy.c M source/blender/editors/space_view3d/view3d_select.c M source/blender/editors/space_view3d/view3d_view.c M source/blender/editors/transform/transform.c M source/blender/editors/transform/transform_generics.c M source/blender/gpu/GPU_matrix.h M source/blender/gpu/intern/gpu_draw.c M source/blender/gpu/intern/gpu_matrix.c M source/blender/windowmanager/intern/wm_subwindow.c M source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c M source/blender/windowmanager/manipulators/intern/manipulator_library/dial_manipulator.c M source/blender/windowmanager/manipulators/intern/manipulator_library/primitive_manipulator.c === diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c index 663be49c71e..e6dffedc5d9 100644 --- a/source/blender/blenfont/intern/blf.c +++ b/source/blender/blenfont/intern/blf.c @@ -555,15 +555,15 @@ static void blf_draw_gl__start(FontBLF *font) gpuPushMatrix(); if (font->flags & BLF_MATRIX) - gpuMultMatrix3D(font->m); + gpuMultMatrix(font->m); gpuTranslate3fv(font->pos); if (font->flags & BLF_ASPECT) gpuScale3fv(font->aspect); - if (font->flags & BLF_ROTATION) /* radians -> degrees */ - gpuRotateAxis(RAD2DEG(font->angle), 'Z'); /* TODO: use gpuRotate2D here? */ + if (font->flags & BLF_ROTATION) + gpuRotate2D(RAD2DEG(font->angle)); #ifndef BLF_STANDALONE VertexFormat *format = immVertexFormat(); diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index 65daf347443..b0864f5ed9a 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -1157,8 +1157,8 @@ void DRW_draw_callbacks_pre_scene(void) struct ARegion *ar = CTX_wm_region(DST.context); RegionView3D *rv3d = CTX_wm_region_view3d(DST.context); - gpuLoadProjectionMatrix3D(rv3d->winmat); - gpuLoadMatrix3D(rv3d->viewmat); + gpuLoadProjectionMatrix(rv3d->winmat); + gpuLoadMatrix(rv3d->viewmat); ED_region_draw_cb_draw(DST.context, ar, REGION_DRAW_PRE_VIEW); } @@ -1168,8 +1168,8 @@ void DRW_draw_callbacks_post_scene(void) struct ARegion *ar = CTX_wm_region(DST.context); RegionView3D *rv3d = CTX_wm_region_view3d(DST.context); - gpuLoadProjectionMatrix3D(rv3d->winmat); - gpuLoadMatrix3D(rv3d->viewmat); + gpuLoadProjectionMatrix(rv3d->winmat); + gpuLoadMatrix(rv3d->viewmat); ED_region_draw_cb_draw(DST.context, ar, REGION_DRAW_POST_VIEW); } diff --git a/source/blender/draw/intern/draw_view.c b/source/blender/draw/intern/draw_view.c index f5ddd05e915..66542e221b1 100644 --- a/source/blender/draw/intern/draw_view.c +++ b/source/blender/draw/intern/draw_view.c @@ -534,8 +534,8 @@ void DRW_draw_grid(void) *(_unit) = NULL; /* drawgrid need this to detect/affect smallest valid unit... */ drawgrid(>unit, ar, v3d, _unit); - gpuLoadProjectionMatrix3D(rv3d->winmat); - gpuLoadMatrix3D(rv3d->viewmat); +
[Bf-blender-cvs] [34ea8058b99] master: Fix: Object.raycast: error to free treedata
Commit: 34ea8058b99a3c5a392dfb1d7d8ab4bd52209a00 Author: Germano Cavalcante Date: Sat Apr 15 02:24:04 2017 -0300 Branches: master https://developer.blender.org/rB34ea8058b99a3c5a392dfb1d7d8ab4bd52209a00 Fix: Object.raycast: error to free treedata === M source/blender/makesrna/intern/rna_object_api.c === diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index 42d1b78784f..b3bc2c72d34 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -326,6 +326,8 @@ static void rna_Object_ray_cast( return; } + *r_success = false; + /* Test BoundBox first (efficiency) */ BoundBox *bb = BKE_object_boundbox_get(ob); if (bb) { @@ -333,11 +335,9 @@ static void rna_Object_ray_cast( if (isect_ray_aabb_v3_simple(origin, direction, bb->vec[0], bb->vec[6], , )) { float dist = distmin >= 0 ? distmin : distmax; if (dist > distance) { - goto finally; } } else { - goto finally; } } @@ -365,20 +365,17 @@ static void rna_Object_ray_cast( copy_v3_v3(r_location, hit.co); copy_v3_v3(r_normal, hit.no); *r_index = dm_looptri_to_poly_index(ob->derivedFinal, [hit.index]); - - goto finally; } } - } - - *r_success = false; - zero_v3(r_location); - zero_v3(r_normal); - *r_index = -1; + free_bvhtree_from_mesh(); + } -finally: - free_bvhtree_from_mesh(); + if (*r_success == false) { + zero_v3(r_location); + zero_v3(r_normal); + *r_index = -1; + } } static void rna_Object_closest_point_on_mesh( ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [97d2f63bfe6] master: Object.raycast: Also test distance from BoundBox
Commit: 97d2f63bfe6d166eca12f7dec0e6525806990f49 Author: Germano Cavalcante Date: Sat Apr 15 01:31:24 2017 -0300 Branches: master https://developer.blender.org/rB97d2f63bfe6d166eca12f7dec0e6525806990f49 Object.raycast: Also test distance from BoundBox If `isect_ray_aabb_v3_simple` provides this information, why not take advantage of it? === M source/blender/makesrna/intern/rna_object_api.c === diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index 3b2e57a06e5..42d1b78784f 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -326,10 +326,19 @@ static void rna_Object_ray_cast( return; } - /* Test BoundBox */ + /* Test BoundBox first (efficiency) */ BoundBox *bb = BKE_object_boundbox_get(ob); - if (bb && !isect_ray_aabb_v3_simple(origin, direction, bb->vec[0], bb->vec[6], NULL, NULL)) { - goto finally; + if (bb) { + float distmin, distmax; + if (isect_ray_aabb_v3_simple(origin, direction, bb->vec[0], bb->vec[6], , )) { + float dist = distmin >= 0 ? distmin : distmax; + if (dist > distance) { + goto finally; + } + } + else { + goto finally; + } } BVHTreeFromMesh treeData = {NULL}; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [ff3942505a8] blender2.8: Cleanup: Use doxy-groups for draw-cache
Commit: ff3942505a8d861d0024ce4e95bd80da6ee303de Author: Campbell Barton Date: Sat Apr 15 14:24:30 2017 +1000 Branches: blender2.8 https://developer.blender.org/rBff3942505a8d861d0024ce4e95bd80da6ee303de Cleanup: Use doxy-groups for draw-cache === M source/blender/draw/intern/draw_cache.c === diff --git a/source/blender/draw/intern/draw_cache.c b/source/blender/draw/intern/draw_cache.c index f6bef7117e1..8e6c64943bd 100644 --- a/source/blender/draw/intern/draw_cache.c +++ b/source/blender/draw/intern/draw_cache.c @@ -112,11 +112,16 @@ void DRW_shape_cache_free(void) BATCH_DISCARD_ALL_SAFE(SHC.drw_camera_focus); } -/* Helper functions */ -static void add_fancy_edge(VertexBuffer *vbo, unsigned int pos_id, unsigned int n1_id, unsigned int n2_id, - unsigned int *v_idx, const float co1[3], const float co2[3], - const float n1[3], const float n2[3]) +/* */ + +/** \name Helper functions + * \{ */ + +static void add_fancy_edge( +VertexBuffer *vbo, unsigned int pos_id, unsigned int n1_id, unsigned int n2_id, +unsigned int *v_idx, const float co1[3], const float co2[3], +const float n1[3], const float n2[3]) { VertexBuffer_set_attrib(vbo, n1_id, *v_idx, n1); VertexBuffer_set_attrib(vbo, n2_id, *v_idx, n2); @@ -127,8 +132,9 @@ static void add_fancy_edge(VertexBuffer *vbo, unsigned int pos_id, unsigned int VertexBuffer_set_attrib(vbo, pos_id, (*v_idx)++, co2); } -static void add_lat_lon_vert(VertexBuffer *vbo, unsigned int pos_id, unsigned int nor_id, - unsigned int *v_idx, const float rad, const float lat, const float lon) +static void add_lat_lon_vert( +VertexBuffer *vbo, unsigned int pos_id, unsigned int nor_id, +unsigned int *v_idx, const float rad, const float lat, const float lon) { float pos[3], nor[3]; nor[0] = sinf(lat) * cosf(lon); @@ -259,7 +265,12 @@ Batch *DRW_cache_fullscreen_quad_get(void) return SHC.drw_fullscreen_quad; } -/* Common */ +/** \} */ + +/* */ + +/** \name Common + * \{ */ Batch *DRW_cache_cube_get(void) { @@ -436,7 +447,13 @@ Batch *DRW_cache_screenspace_circle_get(void) #undef CIRCLE_RESOL } -/* Empties */ +/** \} */ + +/* */ + +/** \name Empties + * \{ */ + Batch *DRW_cache_plain_axes_get(void) { if (!SHC.drw_plain_axes) { @@ -848,7 +865,13 @@ Batch *DRW_cache_field_cone_limit_get(void) #undef CIRCLE_RESOL } -/* Lamps */ +/** \} */ + +/* */ + +/** \name Lamps + * \{ */ + Batch *DRW_cache_lamp_get(void) { #define NSEGMENTS 8 @@ -1114,7 +1137,13 @@ Batch *DRW_cache_lamp_spot_square_get(void) return SHC.drw_lamp_spot_square; } -/* Speaker */ +/** \} */ + +/* */ + +/** \name Speaker + * \{ */ + Batch *DRW_cache_speaker_get(void) { if (!SHC.drw_speaker) { @@ -1172,7 +1201,13 @@ Batch *DRW_cache_speaker_get(void) return SHC.drw_speaker; } -/* Armature bones */ +/** \} */ + +/* */ + +/** \name Armature Bones + * \{ */ + static const float bone_octahedral_verts[6][3] = { { 0.0f, 0.0f, 0.0f}, { 0.1f, 0.1f, 0.1f}, @@ -1342,7 +1377,13 @@ Batch *DRW_cache_bone_arrows_get(void) return SHC.drw_bone_arrows; } -/* Camera */ +/** \} */ + +/* */ + +/** \name Camera + * \{ */ + Batch *DRW_cache_camera_get(void) { if (!SHC.drw_camera) { @@ -1440,6 +1481,13 @@ Batch *DRW_cache_camera_tria_get(void) return SHC.drw_camera_tria; } +/** \} */ + +/* */ + +/** \name Object Mode Helpers + * \{ */ + /* Object Center */ Batch *DRW_cache_single_vert_get(void) { @@ -1463,7 +1511,13 @@ Batch *DRW_cache_single_vert_get(void) return SHC.drw_single_vertice; } -/* Meshes */ +/** \} */ + +/* */ + +/** \name Meshes + * \{ */ + void DRW_cache_mesh_wire_overlay_get( Object *ob, Batch **r_tris, Batch **r_ledges, Batch **r_lverts) @@ -1534,7 +1588,12 @@ Batch *DRW_cache_mesh_verts_get(Object *ob) return surface; } -/* Lattice */ +/** \} */ + +/* */ + +/** \name Lattice + * \{ */ Batch *DRW_cache_lattice_verts_get(Object *ob) { @@ -1572,6 +1631,9 @@ Batch
[Bf-blender-cvs] [608b711beb3] blender2.8: Cleanup: explicit names for return arguments and position last
Commit: 608b711beb3cd094987e7ba9da3a06a7ba086030 Author: Campbell Barton Date: Sat Apr 15 14:07:57 2017 +1000 Branches: blender2.8 https://developer.blender.org/rB608b711beb3cd094987e7ba9da3a06a7ba086030 Cleanup: explicit names for return arguments and position last === M source/blender/draw/intern/DRW_render.h M source/blender/draw/intern/draw_cache.c M source/blender/draw/intern/draw_cache.h M source/blender/draw/intern/draw_common.c M source/blender/draw/intern/draw_common.h M source/blender/draw/intern/draw_manager.c M source/blender/draw/modes/edit_mesh_mode.c === diff --git a/source/blender/draw/intern/DRW_render.h b/source/blender/draw/intern/DRW_render.h index b5913eb8742..eba5ce2f0f7 100644 --- a/source/blender/draw/intern/DRW_render.h +++ b/source/blender/draw/intern/DRW_render.h @@ -244,7 +244,7 @@ DRWShadingGroup *DRW_shgroup_line_batch_create(struct GPUShader *shader, DRWPass void DRW_shgroup_free(struct DRWShadingGroup *shgroup); void DRW_shgroup_call_add(DRWShadingGroup *shgroup, struct Batch *geom, float (*obmat)[4]); -void DRW_shgroup_dynamic_call_add_array(DRWShadingGroup *shgroup, const void **attr, unsigned int attr_len); +void DRW_shgroup_dynamic_call_add_array(DRWShadingGroup *shgroup, const void *attr[], unsigned int attr_len); #define DRW_shgroup_dynamic_call_add(shgroup, ...) do { \ const void *array[] = {__VA_ARGS__}; \ DRW_shgroup_dynamic_call_add_array(shgroup, array, (sizeof(array) / sizeof(*array))); \ diff --git a/source/blender/draw/intern/draw_cache.c b/source/blender/draw/intern/draw_cache.c index 73de39814d7..f6bef7117e1 100644 --- a/source/blender/draw/intern/draw_cache.c +++ b/source/blender/draw/intern/draw_cache.c @@ -1464,15 +1464,17 @@ Batch *DRW_cache_single_vert_get(void) } /* Meshes */ -void DRW_cache_mesh_wire_overlay_get(Object *ob, Batch **tris, Batch **ledges, Batch **lverts) +void DRW_cache_mesh_wire_overlay_get( +Object *ob, +Batch **r_tris, Batch **r_ledges, Batch **r_lverts) { BLI_assert(ob->type == OB_MESH); Mesh *me = ob->data; - *tris = BKE_mesh_batch_cache_get_overlay_triangles(me); - *ledges = BKE_mesh_batch_cache_get_overlay_loose_edges(me); - *lverts = BKE_mesh_batch_cache_get_overlay_loose_verts(me); + *r_tris = BKE_mesh_batch_cache_get_overlay_triangles(me); + *r_ledges = BKE_mesh_batch_cache_get_overlay_loose_edges(me); + *r_lverts = BKE_mesh_batch_cache_get_overlay_loose_verts(me); } Batch *DRW_cache_face_centers_get(Object *ob) diff --git a/source/blender/draw/intern/draw_cache.h b/source/blender/draw/intern/draw_cache.h index b23992914bd..b4f6590b5dd 100644 --- a/source/blender/draw/intern/draw_cache.h +++ b/source/blender/draw/intern/draw_cache.h @@ -80,7 +80,8 @@ struct Batch *DRW_cache_bone_arrows_get(void); /* Meshes */ void DRW_cache_mesh_wire_overlay_get( -struct Object *ob, struct Batch **tris, struct Batch **ledges, struct Batch **lverts); +struct Object *ob, +struct Batch **r_tris, struct Batch **r_ledges, struct Batch **r_lverts); struct Batch *DRW_cache_face_centers_get(struct Object *ob); struct Batch *DRW_cache_mesh_wire_outline_get(struct Object *ob); struct Batch *DRW_cache_mesh_surface_get(struct Object *ob); diff --git a/source/blender/draw/intern/draw_common.c b/source/blender/draw/intern/draw_common.c index 807a4a2201a..2fa8c1dcf49 100644 --- a/source/blender/draw/intern/draw_common.c +++ b/source/blender/draw/intern/draw_common.c @@ -296,9 +296,11 @@ DRWShadingGroup *shgroup_spot_instance(DRWPass *pass, struct Batch *geom) /* COLOR UTILS *** */ /* TODO FINISH */ -/* Get the wire color theme_id of an object based on it's state - * **color is a way to get a pointer to the static color var associated */ -int DRW_object_wire_theme_get(Object *ob, SceneLayer *sl, float **color) +/** + * Get the wire color theme_id of an object based on it's state + * \a r_color is a way to get a pointer to the static color var associated + */ +int DRW_object_wire_theme_get(Object *ob, SceneLayer *sl, float **r_color) { const bool is_edit = (ob->mode & OB_MODE_EDIT) != 0; const bool active = (sl->basact && sl->basact->object == ob); @@ -338,24 +340,24 @@ int DRW_object_wire_theme_get(Object *ob, SceneLayer *sl, float **color) } } - if (color != NULL) { + if (r_color != NULL) { switch (theme_id) { - case TH_WIRE_EDIT:*color = ts.colorTransform; break; - case TH_ACTIVE: *color = ts.colorActive; break; - case TH_SELECT: *color = ts.colorSelect; break; - case
[Bf-blender-cvs] [480473f1f10] master: Object.raycast: Test the hit on the BoundBox first
Commit: 480473f1f1008168e7784221b852a6d370a0f4f5 Author: Germano Cavalcante Date: Sat Apr 15 00:44:05 2017 -0300 Branches: master https://developer.blender.org/rB480473f1f1008168e7784221b852a6d370a0f4f5 Object.raycast: Test the hit on the BoundBox first This avoids the unnecessary creation of bvhtree, which can be highly inefficient in some cases (for example: in the `operator_modal_view3d_raycast.py` template) === M source/blender/makesrna/intern/rna_object_api.c === diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index c680abe71a4..3b2e57a06e5 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -321,13 +321,19 @@ static void rna_Object_ray_cast( float origin[3], float direction[3], float distance, int *r_success, float r_location[3], float r_normal[3], int *r_index) { - BVHTreeFromMesh treeData = {NULL}; - if (ob->derivedFinal == NULL) { BKE_reportf(reports, RPT_ERROR, "Object '%s' has no mesh data to be used for ray casting", ob->id.name + 2); return; } + /* Test BoundBox */ + BoundBox *bb = BKE_object_boundbox_get(ob); + if (bb && !isect_ray_aabb_v3_simple(origin, direction, bb->vec[0], bb->vec[6], NULL, NULL)) { + goto finally; + } + + BVHTreeFromMesh treeData = {NULL}; + /* no need to managing allocation or freeing of the BVH data. this is generated and freed as needed */ bvhtree_from_mesh_looptri(, ob->derivedFinal, 0.0f, 4, 6); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [718fb3167d0] master: Fix Player stubs (tm)
Commit: 718fb3167d0ed293d6476807897dddf05b562523 Author: Jens Verwiebe Date: Sat Apr 15 01:09:44 2017 +0200 Branches: master https://developer.blender.org/rB718fb3167d0ed293d6476807897dddf05b562523 Fix Player stubs (tm) === M source/blenderplayer/bad_level_call_stubs/stubs.c === diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c index 5400abc4791..300185b3b16 100644 --- a/source/blenderplayer/bad_level_call_stubs/stubs.c +++ b/source/blenderplayer/bad_level_call_stubs/stubs.c @@ -274,7 +274,8 @@ struct Object *RE_GetCamera(struct Render *re) RET_NULL float RE_lamp_get_data(struct ShadeInput *shi, struct Object *lamp_obj, float col[4], float lv[3], float *dist, float shadow[4]) RET_ZERO const float (*RE_object_instance_get_matrix(struct ObjectInstanceRen *obi, int matrix_id))[4] RET_NULL const float (*RE_render_current_get_matrix(int matrix_id))[4] RET_NULL -const float RE_object_instance_get_object_pass_index(struct ObjectInstanceRen *obi) RET_ZERO +float RE_object_instance_get_object_pass_index(struct ObjectInstanceRen *obi) RET_ZERO +float RE_object_instance_get_random_id(struct ObjectInstanceRen *obi) RET_ZERO /* blenkernel */ bool BKE_paint_proj_mesh_data_check(struct Scene *scene, struct Object *ob, bool *uvs, bool *mat, bool *tex, bool *stencil) RET_ZERO ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [e280c70aa94] master: Fix T51216: SSAO attenuation not being scale invariant.
Commit: e280c70aa942829e7bfbd403fbb971a3c4502821 Author: Brecht Van Lommel Date: Sat Apr 15 00:02:55 2017 +0200 Branches: master https://developer.blender.org/rBe280c70aa942829e7bfbd403fbb971a3c4502821 Fix T51216: SSAO attenuation not being scale invariant. Unfortunately this does break compatibility in that the viewport will look a bit different depending on the settings, but the old behavior was simply not usable for higher distances. === M source/blender/gpu/intern/gpu_compositing.c M source/blender/gpu/shaders/gpu_shader_fx_ssao_frag.glsl === diff --git a/source/blender/gpu/intern/gpu_compositing.c b/source/blender/gpu/intern/gpu_compositing.c index 964c2b5051e..2f2a16f9e1d 100644 --- a/source/blender/gpu/intern/gpu_compositing.c +++ b/source/blender/gpu/intern/gpu_compositing.c @@ -798,7 +798,9 @@ bool GPU_fx_do_composite_pass( ssao_shader = GPU_shader_get_builtin_fx_shader(GPU_SHADER_FX_SSAO, is_persp); if (ssao_shader) { const GPUSSAOSettings *fx_ssao = fx->settings.ssao; - float ssao_params[4] = {fx_ssao->distance_max, fx_ssao->factor, fx_ssao->attenuation, 0.0f}; + /* adjust attenuation to be scale invariant */ + float attenuation = fx_ssao->attenuation / (fx_ssao->distance_max * fx_ssao->distance_max); + float ssao_params[4] = {fx_ssao->distance_max, fx_ssao->factor, attenuation, 0.0f}; float sample_params[3]; sample_params[0] = fx->ssao_sample_count_cache; diff --git a/source/blender/gpu/shaders/gpu_shader_fx_ssao_frag.glsl b/source/blender/gpu/shaders/gpu_shader_fx_ssao_frag.glsl index 50c8e255162..f19ff4ec65a 100644 --- a/source/blender/gpu/shaders/gpu_shader_fx_ssao_frag.glsl +++ b/source/blender/gpu/shaders/gpu_shader_fx_ssao_frag.glsl @@ -75,7 +75,7 @@ float calculate_ssao_factor(float depth) float f = dot(dir, normal); /* use minor bias here to avoid self shadowing */ - if (f > 0.05 * len + 0.0001) + if (f > 0.05 * len) factor += f * 1.0 / (len * (1.0 + len * len * ssao_params.z)); } } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [834730e1237] greasepencil-object: Separate in different passes
Commit: 834730e1237d62c25829b56fc342ad7e6004d885 Author: Antonio Vazquez Date: Fri Apr 14 19:47:27 2017 +0200 Branches: greasepencil-object https://developer.blender.org/rB834730e1237d62c25829b56fc342ad7e6004d885 Separate in different passes === M source/blender/draw/engines/gpencil/gpencil_mode.c === diff --git a/source/blender/draw/engines/gpencil/gpencil_mode.c b/source/blender/draw/engines/gpencil/gpencil_mode.c index 028ed3072c3..6b0840a4255 100644 --- a/source/blender/draw/engines/gpencil/gpencil_mode.c +++ b/source/blender/draw/engines/gpencil/gpencil_mode.c @@ -66,7 +66,9 @@ typedef struct GPENCIL_StorageList { /* keep it under MAX_PASSES */ typedef struct GPENCIL_PassList { - struct DRWPass *pass; + struct DRWPass *stroke_pass; + struct DRWPass *fill_pass; + struct DRWPass *edit_pass; } GPENCIL_PassList; /* keep it under MAX_BUFFERS */ @@ -89,7 +91,7 @@ typedef struct GPENCIL_Data { /* *** STATIC *** */ typedef struct g_data{ - DRWShadingGroup *shgrps_volumetric; + DRWShadingGroup *shgrps_edit_volumetric; } g_data; /* Transient data */ static struct { @@ -180,7 +182,7 @@ static DRWShadingGroup *GPENCIL_shgroup_stroke_create(GPENCIL_Data *vedata, DRWP } /* create shading group for volumetric */ -static DRWShadingGroup *GPENCIL_shgroup_volumetric_create(GPENCIL_Data *vedata, DRWPass *pass) +static DRWShadingGroup *GPENCIL_shgroup_edit_volumetric_create(GPENCIL_Data *vedata, DRWPass *pass) { GPENCIL_TextureList *txl = ((GPENCIL_Data *)vedata)->txl; GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl; @@ -207,16 +209,18 @@ static void GPENCIL_cache_init(void *vedata) } { - /* Create a pass */ + /* Stroke pass */ DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_BLEND ; - psl->pass = DRW_pass_create("Gpencil Pass", state); + psl->stroke_pass = DRW_pass_create("Gpencil Stroke Pass", state); + psl->fill_pass = DRW_pass_create("Gpencil Fill Pass", state); stl->storage->pal_id = 0; memset(stl->storage->shgrps_fill, 0, sizeof(DRWShadingGroup *) * MAX_GPENCIL_MAT); memset(stl->storage->shgrps_stroke, 0, sizeof(DRWShadingGroup *) * MAX_GPENCIL_MAT); memset(stl->storage->materials, 0, sizeof(PaletteColor *) * MAX_GPENCIL_MAT); - /* create static shading groups */ - stl->g_data->shgrps_volumetric = GPENCIL_shgroup_volumetric_create(vedata, psl->pass); + /* edit pass */ + psl->edit_pass = DRW_pass_create("Gpencil Edit Pass", state); + stl->g_data->shgrps_edit_volumetric = GPENCIL_shgroup_edit_volumetric_create(vedata, psl->edit_pass); } } @@ -273,8 +277,8 @@ static void gpencil_draw_strokes(void *vedata, ToolSettings *ts, Object *ob, if (id == -1) { id = stl->storage->pal_id; stl->storage->materials[id] = gps->palcolor; - stl->storage->shgrps_fill[id] = GPENCIL_shgroup_fill_create(vedata, psl->pass, gps->palcolor, id); - stl->storage->shgrps_stroke[id] = GPENCIL_shgroup_stroke_create(vedata, psl->pass, gps->palcolor); + stl->storage->shgrps_fill[id] = GPENCIL_shgroup_fill_create(vedata, psl->fill_pass, gps->palcolor, id); + stl->storage->shgrps_stroke[id] = GPENCIL_shgroup_stroke_create(vedata, psl->stroke_pass, gps->palcolor); ++stl->storage->pal_id; } @@ -334,7 +338,7 @@ static void gpencil_draw_strokes(void *vedata, ToolSettings *ts, Object *ob, if (gps->flag & GP_STROKE_SELECT) { if ((gpl->flag & GP_LAYER_UNLOCK_COLOR) || ((gps->palcolor->flag & PC_COLOR_LOCKED) == 0)) { struct Batch *edit_geom = gpencil_get_edit_geom(gps, ts->gp_sculpt.alpha, ob->gpd->flag); - DRW_shgroup_call_add(stl->g_data->shgrps_volumetric, edit_geom, gpf->matrix); + DRW_shgroup_call_add(stl->g_data->shgrps_edit_volumetric, edit_geom, gpf->matrix); } } @@ -392,7 +396,9 @@ static void GPENCIL_draw_scene(void *vedata) UNUSED_VARS(fbl, dfbl, dtxl); if (stl->storage->pal_id > 0) { - DRW_draw_pass(psl->pass); + DRW_draw_pass(psl->fill_pass); + DRW_draw_pass(psl->stroke_pass); + DRW_draw_pass(psl->edit_pass); } } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org
[Bf-blender-cvs] [5049726be28] greasepencil-object: Prepare shaders for animation onion skin data
Commit: 5049726be2879b48dd65e0c59d045297805e8f19 Author: Antonio Vazquez Date: Fri Apr 14 19:07:32 2017 +0200 Branches: greasepencil-object https://developer.blender.org/rB5049726be2879b48dd65e0c59d045297805e8f19 Prepare shaders for animation onion skin data === M source/blender/draw/engines/gpencil/gpencil_draw.c M source/blender/draw/engines/gpencil/gpencil_mode.c M source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl M source/blender/draw/engines/gpencil/shaders/gpencil_fill_vert.glsl === diff --git a/source/blender/draw/engines/gpencil/gpencil_draw.c b/source/blender/draw/engines/gpencil/gpencil_draw.c index 156abab497c..7b2bced4f2b 100644 --- a/source/blender/draw/engines/gpencil/gpencil_draw.c +++ b/source/blender/draw/engines/gpencil/gpencil_draw.c @@ -297,8 +297,8 @@ static void gp_triangulate_stroke_fill(bGPDstroke *gps) } /* add a new fill point and texture coordinates to vertex buffer */ -static void gpencil_set_fill_point(VertexBuffer *vbo, int idx, bGPDspoint *pt, float uv[2], - unsigned int pos_id, unsigned int text_id, +static void gpencil_set_fill_point(VertexBuffer *vbo, int idx, bGPDspoint *pt, float fcolor[4], float uv[2], + unsigned int pos_id, unsigned int color_id, unsigned int text_id, short UNUSED(flag), int UNUSED(offsx), int UNUSED(offsy), int UNUSED(winx), int UNUSED(winy)) { #if 0 @@ -312,6 +312,7 @@ static void gpencil_set_fill_point(VertexBuffer *vbo, int idx, bGPDspoint *pt, f #endif VertexBuffer_set_attrib(vbo, pos_id, idx, >x); + VertexBuffer_set_attrib(vbo, color_id, idx, fcolor); VertexBuffer_set_attrib(vbo, text_id, idx, uv); } @@ -332,9 +333,10 @@ Batch *gpencil_get_fill_geom(bGPDstroke *gps, const float color[4]) BLI_assert(gps->tot_triangles >= 1); static VertexFormat format = { 0 }; - static unsigned int pos_id, text_id; + static unsigned int pos_id, color_id, text_id; if (format.attrib_ct == 0) { pos_id = VertexFormat_add_attrib(, "pos", COMP_F32, 3, KEEP_FLOAT); + color_id = VertexFormat_add_attrib(, "color", COMP_F32, 4, KEEP_FLOAT); text_id = VertexFormat_add_attrib(, "texCoord", COMP_F32, 2, KEEP_FLOAT); } @@ -345,16 +347,16 @@ Batch *gpencil_get_fill_geom(bGPDstroke *gps, const float color[4]) bGPDtriangle *stroke_triangle = gps->triangles; int idx = 0; for (int i = 0; i < gps->tot_triangles; i++, stroke_triangle++) { - gpencil_set_fill_point(vbo, idx, >points[stroke_triangle->v1], stroke_triangle->uv1, - pos_id, text_id, gps->flag, + gpencil_set_fill_point(vbo, idx, >points[stroke_triangle->v1], gps->palcolor->fill, stroke_triangle->uv1, + pos_id, color_id, text_id, gps->flag, offsx, offsy, winx, winy); ++idx; - gpencil_set_fill_point(vbo, idx, >points[stroke_triangle->v2], stroke_triangle->uv2, - pos_id, text_id, gps->flag, + gpencil_set_fill_point(vbo, idx, >points[stroke_triangle->v2], gps->palcolor->fill, stroke_triangle->uv2, + pos_id, color_id, text_id, gps->flag, offsx, offsy, winx, winy); ++idx; - gpencil_set_fill_point(vbo, idx, >points[stroke_triangle->v3], stroke_triangle->uv3, - pos_id, text_id, gps->flag, + gpencil_set_fill_point(vbo, idx, >points[stroke_triangle->v3], gps->palcolor->fill, stroke_triangle->uv3, + pos_id, color_id, text_id, gps->flag, offsx, offsy, winx, winy); ++idx; } diff --git a/source/blender/draw/engines/gpencil/gpencil_mode.c b/source/blender/draw/engines/gpencil/gpencil_mode.c index c8d1821b68f..028ed3072c3 100644 --- a/source/blender/draw/engines/gpencil/gpencil_mode.c +++ b/source/blender/draw/engines/gpencil/gpencil_mode.c @@ -50,6 +50,9 @@ extern char datatoc_gpencil_stroke_frag_glsl[]; typedef struct GPENCIL_Storage { int pal_id; + int t_mix[MAX_GPENCIL_MAT]; + int t_flip[MAX_GPENCIL_MAT]; + int fill_style[MAX_GPENCIL_MAT]; PaletteColor *materials[MAX_GPENCIL_MAT]; DRWShadingGroup *shgrps_fill[MAX_GPENCIL_MAT]; DRWShadingGroup *shgrps_stroke[MAX_GPENCIL_MAT]; @@ -86,9 +89,6 @@ typedef struct GPENCIL_Data { /* *** STATIC *** */ typedef struct g_data{ - int t_flip; - int t_mix; - int fill_style; DRWShadingGroup *shgrps_volumetric; } g_data; /* Transient data */ @@ -131,16 +131,15 @@ static void GPENCIL_engine_free(void) } /* create shading group for filling */ -static DRWShadingGroup
[Bf-blender-cvs] [f9d0b639607] greasepencil-object: Reorganize strokes drawing code
Commit: f9d0b63960710412044289d0e089403be42266e5 Author: Antonio Vazquez Date: Fri Apr 14 16:16:49 2017 +0200 Branches: greasepencil-object https://developer.blender.org/rBf9d0b63960710412044289d0e089403be42266e5 Reorganize strokes drawing code === M source/blender/draw/engines/gpencil/gpencil_draw.c M source/blender/draw/engines/gpencil/gpencil_mode.c M source/blender/makesdna/DNA_gpencil_types.h === diff --git a/source/blender/draw/engines/gpencil/gpencil_draw.c b/source/blender/draw/engines/gpencil/gpencil_draw.c index 96100644326..156abab497c 100644 --- a/source/blender/draw/engines/gpencil/gpencil_draw.c +++ b/source/blender/draw/engines/gpencil/gpencil_draw.c @@ -319,7 +319,6 @@ static void gpencil_set_fill_point(VertexBuffer *vbo, int idx, bGPDspoint *pt, f Batch *gpencil_get_fill_geom(bGPDstroke *gps, const float color[4]) { BLI_assert(gps->totpoints >= 3); - PaletteColor *palcolor = gps->palcolor; int offsx = 0; int offsy = 0; const float *viewport = DRW_viewport_size_get(); diff --git a/source/blender/draw/engines/gpencil/gpencil_mode.c b/source/blender/draw/engines/gpencil/gpencil_mode.c index 7cbe09a5b16..c8d1821b68f 100644 --- a/source/blender/draw/engines/gpencil/gpencil_mode.c +++ b/source/blender/draw/engines/gpencil/gpencil_mode.c @@ -234,108 +234,144 @@ static int GPENCIL_shgroup_find(GPENCIL_Storage *storage, PaletteColor *palcolor return -1; } -static void GPENCIL_cache_populate(void *vedata, Object *ob) +static void gpencil_draw_strokes(void *vedata, ToolSettings *ts, Object *ob, bGPDlayer *gpl, bGPDframe *gpf, + const float opacity, const float tintcolor[4], const bool onion, const bool custonion) { GPENCIL_PassList *psl = ((GPENCIL_Data *)vedata)->psl; GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl; DRWShadingGroup *fillgrp; DRWShadingGroup *strokegrp; - const bContext *C = DRW_get_context(); - Scene *scene = CTX_data_scene(C); - ToolSettings *ts = CTX_data_tool_settings(C); - float ink[4]; float tcolor[4]; float matrix[4][4]; + float ink[4]; - UNUSED_VARS(psl, stl); - - if (ob->type == OB_GPENCIL && ob->gpd) { - for (bGPDlayer *gpl = ob->gpd->layers.first; gpl; gpl = gpl->next) { - /* don't draw layer if hidden */ - if (gpl->flag & GP_LAYER_HIDE) - continue; - - bGPDframe *gpf = BKE_gpencil_layer_getframe(gpl, CFRA, 0); - if (gpf == NULL) - continue; #if 0 // TODO convert xray function - const int no_xray = (dflag & GP_DRAWDATA_NO_XRAY); - int mask_orig = 0; - - if (no_xray) { - glGetIntegerv(GL_DEPTH_WRITEMASK, _orig); - glDepthMask(0); - glEnable(GL_DEPTH_TEST); - /* first arg is normally rv3d->dist, but this isn't - * available here and seems to work quite well without */ - bglPolygonOffset(1.0f, 1.0f); - } + const int no_xray = (dflag & GP_DRAWDATA_NO_XRAY); + int mask_orig = 0; + + if (no_xray) { + glGetIntegerv(GL_DEPTH_WRITEMASK, _orig); + glDepthMask(0); + glEnable(GL_DEPTH_TEST); + /* first arg is normally rv3d->dist, but this isn't + * available here and seems to work quite well without */ + bglPolygonOffset(1.0f, 1.0f); + } #endif - /* get parent matrix and save as static data */ - ED_gpencil_parent_location(ob, ob->gpd, gpl, matrix); - copy_m4_m4(gpl->matrix, matrix); + /* get parent matrix and save as static data */ + ED_gpencil_parent_location(ob, ob->gpd, gpl, matrix); + copy_m4_m4(gpf->matrix, matrix); - for (bGPDstroke *gps = gpf->strokes.first; gps; gps = gps->next) { - /* check if stroke can be drawn */ - if (gpencil_can_draw_stroke(gps) == false) { - continue; - } - /* try to find shader group or create a new one */ - int id = GPENCIL_shgroup_find(stl->storage, gps->palcolor); - if (id == -1) { - id = stl->storage->pal_id; - stl->storage->materials[id] = gps->palcolor; -
[Bf-blender-cvs] [4d117f2fd24] master: Alembic export: fixed flattened dupligroup import
Commit: 4d117f2fd2438989d90b40f38d2ca1625be9e6e0 Author: Sybren A. Stüvel Date: Fri Apr 14 16:38:26 2017 +0200 Branches: master https://developer.blender.org/rB4d117f2fd2438989d90b40f38d2ca1625be9e6e0 Alembic export: fixed flattened dupligroup import === M source/blender/alembic/intern/abc_exporter.cc M source/blender/alembic/intern/abc_exporter.h === diff --git a/source/blender/alembic/intern/abc_exporter.cc b/source/blender/alembic/intern/abc_exporter.cc index a8d1587abdb..d949df1b20a 100644 --- a/source/blender/alembic/intern/abc_exporter.cc +++ b/source/blender/alembic/intern/abc_exporter.cc @@ -290,13 +290,7 @@ void AbcExporter::operator()(Main *bmain, float , bool _canceled) OBox3dProperty archive_bounds_prop = Alembic::AbcGeom::CreateOArchiveBounds(m_writer->archive(), m_trans_sampling_index); - if (m_settings.flatten_hierarchy) { - createTransformWritersFlat(); - } - else { - createTransformWritersHierarchy(bmain->eval_ctx); - } - + createTransformWritersHierarchy(bmain->eval_ctx); createShapeWriters(bmain->eval_ctx); /* Make a list of frames to export. */ @@ -383,24 +377,6 @@ void AbcExporter::createTransformWritersHierarchy(EvaluationContext *eval_ctx) } } -void AbcExporter::createTransformWritersFlat() -{ - Base *base = static_cast(m_scene->base.first); - - while (base) { - Object *ob = base->object; - - if (export_object(_settings, ob, false) && object_is_shape(ob)) { - std::string name = get_id_name(ob); - m_xforms[name] = new AbcTransformWriter( -ob, m_writer->archive().getTop(), NULL, -m_trans_sampling_index, m_settings); - } - - base = base->next; - } -} - void AbcExporter::exploreTransform(EvaluationContext *eval_ctx, Object *ob, Object *parent, Object *dupliObParent) { /* If an object isn't exported itself, its duplilist shouldn't be @@ -440,12 +416,18 @@ void AbcExporter::exploreTransform(EvaluationContext *eval_ctx, Object *ob, Obje AbcTransformWriter * AbcExporter::createTransformWriter(Object *ob, Object *parent, Object *dupliObParent) { - const std::string name = get_object_dag_path_name(ob, dupliObParent); - /* An object should not be its own parent, or we'll get infinite loops. */ BLI_assert(ob != parent); BLI_assert(ob != dupliObParent); + std::string name; + if (m_settings.flatten_hierarchy) { + name = get_id_name(ob); + } + else { + name = get_object_dag_path_name(ob, dupliObParent); + } + /* check if we have already created a transform writer for this object */ AbcTransformWriter *my_writer = getXForm(name); if (my_writer != NULL){ @@ -455,7 +437,12 @@ AbcTransformWriter * AbcExporter::createTransformWriter(Object *ob, Object *pare AbcTransformWriter *parent_writer = NULL; Alembic::Abc::OObject alembic_parent; - if (parent) { + if (m_settings.flatten_hierarchy || parent == NULL) { + /* Parentless objects still have the "top object" as parent +* in Alembic. */ + alembic_parent = m_writer->archive().getTop(); + } + else { /* Since there are so many different ways to find parents (as evident * in the number of conditions below), we can't really look up the * parent by name. We'll just call createTransformWriter(), which will @@ -478,11 +465,6 @@ AbcTransformWriter * AbcExporter::createTransformWriter(Object *ob, Object *pare BLI_assert(parent_writer); alembic_parent = parent_writer->alembicXform(); } - else { - /* Parentless objects still have the "top object" as parent -* in Alembic. */ - alembic_parent = m_writer->archive().getTop(); - } my_writer = new AbcTransformWriter(ob, alembic_parent, parent_writer, m_trans_sampling_index, m_settings); diff --git a/source/blender/alembic/intern/abc_exporter.h b/source/blender/alembic/intern/abc_exporter.h index 0f08037fd17..73b7af280d9 100644 --- a/source/blender/alembic/intern/abc_exporter.h +++ b/source/blender/alembic/intern/abc_exporter.h @@ -109,7 +109,6 @@ private: void getFrameSet(double step, std::set ); void createTransformWritersHierarchy(EvaluationContext *eval_ctx); - void createTransformWritersFlat(); AbcTransformWriter * createTransformWriter(Object *ob, Object *parent, Object *dupliObParent); void
[Bf-blender-cvs] [5fa4f397c20] master: Alembic import: fixed dupligroup export when the dupli-empty has a parent
Commit: 5fa4f397c2050fa15e28855acae1520377a4a517 Author: Sybren A. Stüvel Date: Fri Apr 14 18:20:24 2017 +0200 Branches: master https://developer.blender.org/rB5fa4f397c2050fa15e28855acae1520377a4a517 Alembic import: fixed dupligroup export when the dupli-empty has a parent === M source/blender/alembic/intern/abc_exporter.cc M source/blender/alembic/intern/abc_transform.cc M source/blender/alembic/intern/abc_transform.h M source/blender/alembic/intern/abc_util.cc M source/blender/alembic/intern/abc_util.h M tests/python/alembic_tests.py === diff --git a/source/blender/alembic/intern/abc_exporter.cc b/source/blender/alembic/intern/abc_exporter.cc index d949df1b20a..ef3196cb15d 100644 --- a/source/blender/alembic/intern/abc_exporter.cc +++ b/source/blender/alembic/intern/abc_exporter.cc @@ -448,7 +448,12 @@ AbcTransformWriter * AbcExporter::createTransformWriter(Object *ob, Object *pare * parent by name. We'll just call createTransformWriter(), which will * return the parent's AbcTransformWriter pointer. */ if (parent->parent) { - parent_writer = createTransformWriter(parent, parent->parent, dupliObParent); + if (parent == dupliObParent) { + parent_writer = createTransformWriter(parent, parent->parent, NULL); + } + else { + parent_writer = createTransformWriter(parent, parent->parent, dupliObParent); + } } else if (parent == dupliObParent) { if (dupliObParent->parent == NULL) { @@ -468,6 +473,12 @@ AbcTransformWriter * AbcExporter::createTransformWriter(Object *ob, Object *pare my_writer = new AbcTransformWriter(ob, alembic_parent, parent_writer, m_trans_sampling_index, m_settings); + + /* When flattening, the matrix of the dupliobject has to be added. */ + if (m_settings.flatten_hierarchy && dupliObParent) { + my_writer->m_proxy_from = dupliObParent; + } + m_xforms[name] = my_writer; return my_writer; } diff --git a/source/blender/alembic/intern/abc_transform.cc b/source/blender/alembic/intern/abc_transform.cc index 2e626edeb8b..6e218cac429 100644 --- a/source/blender/alembic/intern/abc_transform.cc +++ b/source/blender/alembic/intern/abc_transform.cc @@ -62,6 +62,7 @@ AbcTransformWriter::AbcTransformWriter(Object *ob, unsigned int time_sampling, ExportSettings ) : AbcObjectWriter(NULL, ob, time_sampling, settings, parent) +, m_proxy_from(NULL) { m_is_animated = hasAnimation(m_object); @@ -90,7 +91,8 @@ void AbcTransformWriter::do_write() float yup_mat[4][4]; create_transform_matrix(m_object, yup_mat, - m_inherits_xform ? ABC_MATRIX_LOCAL : ABC_MATRIX_WORLD); + m_inherits_xform ? ABC_MATRIX_LOCAL : ABC_MATRIX_WORLD, + m_proxy_from); /* Only apply rotation to root camera, parenting will propagate it. */ if (m_object->type == OB_CAMERA && (!m_inherits_xform || !has_parent_camera(m_object))) { diff --git a/source/blender/alembic/intern/abc_transform.h b/source/blender/alembic/intern/abc_transform.h index 714adc299c1..59388e155dc 100644 --- a/source/blender/alembic/intern/abc_transform.h +++ b/source/blender/alembic/intern/abc_transform.h @@ -41,6 +41,9 @@ class AbcTransformWriter : public AbcObjectWriter { bool m_inherits_xform; public: + Object *m_proxy_from; + +public: AbcTransformWriter(Object *ob, const Alembic::AbcGeom::OObject _parent, AbcTransformWriter *parent, diff --git a/source/blender/alembic/intern/abc_util.cc b/source/blender/alembic/intern/abc_util.cc index 248ca4e64ae..67d2d3b1eb2 100644 --- a/source/blender/alembic/intern/abc_util.cc +++ b/source/blender/alembic/intern/abc_util.cc @@ -257,7 +257,8 @@ void convert_matrix(const Imath::M44d , Object *ob, float r_mat[4][4]) /* Recompute transform matrix of object in new coordinate system * (from Z-Up to Y-Up). */ -void create_transform_matrix(Object *obj, float r_yup_mat[4][4], AbcMatrixMode mode) +void create_transform_matrix(Object *obj, float r_yup_mat[4][4], AbcMatrixMode mode, + Object *proxy_from) { float zup_mat[4][4]; @@ -267,11 +268,16 @@ void create_transform_matrix(Object *obj, float r_yup_mat[4][4], AbcMatrixMode m * constraints and modifiers as well as the obj->parentinv matrix. */
[Bf-blender-cvs] [49fc9cff3b9] blender2.8: GPU Matrix API: Remove ModelView/Projection 3D suffix
Commit: 49fc9cff3b90f993122e778bec24763679ffb1d8 Author: Dalai Felinto Date: Fri Apr 14 18:06:56 2017 +0200 Branches: blender2.8 https://developer.blender.org/rB49fc9cff3b90f993122e778bec24763679ffb1d8 GPU Matrix API: Remove ModelView/Projection 3D suffix === M source/blender/gpu/intern/gpu_matrix.c === diff --git a/source/blender/gpu/intern/gpu_matrix.c b/source/blender/gpu/intern/gpu_matrix.c index 8b58a981a65..5a327630572 100644 --- a/source/blender/gpu/intern/gpu_matrix.c +++ b/source/blender/gpu/intern/gpu_matrix.c @@ -45,8 +45,8 @@ typedef float Mat4[4][4]; typedef float Mat3[3][3]; typedef struct { - Mat4 ModelViewStack3D[MATRIX_STACK_DEPTH]; - Mat4 ProjectionMatrix3D; + Mat4 ModelViewStack[MATRIX_STACK_DEPTH]; + Mat4 ProjectionMatrix; unsigned top; /* of current stack (would have to replicate if gpuResume2D/3D are implemented) */ @@ -67,14 +67,14 @@ typedef struct { /* TODO(merwin): make part of GPUContext, alongside immediate mode & state tracker */ static MatrixState state = { - .ModelViewStack3D = {MATRIX_4X4_IDENTITY}, - .ProjectionMatrix3D = MATRIX_4X4_IDENTITY, + .ModelViewStack = {MATRIX_4X4_IDENTITY}, + .ProjectionMatrix = MATRIX_4X4_IDENTITY, }; #undef MATRIX_4X4_IDENTITY -#define ModelView3D state.ModelViewStack3D[state.top] -#define Projection3D state.ProjectionMatrix3D +#define ModelView state.ModelViewStack[state.top] +#define Projection state.ProjectionMatrix void gpuMatrixInit(void) { @@ -117,7 +117,7 @@ void gpuPushMatrix(void) BLI_assert(state.top < MATRIX_STACK_DEPTH); state.top++; - copy_m4_m4(ModelView3D, state.ModelViewStack3D[state.top - 1]); + copy_m4_m4(ModelView, state.ModelViewStack[state.top - 1]); } void gpuPopMatrix(void) @@ -145,7 +145,7 @@ void gpuLoadMatrix3D(const float m[4][4]) } #endif - copy_m4_m4(ModelView3D, m); + copy_m4_m4(ModelView, m); CHECKMAT(ModelView3D); state.dirty = true; } @@ -171,7 +171,7 @@ void gpuLoadProjectionMatrix3D(const float m[4][4]) } #endif - copy_m4_m4(Projection3D, m); + copy_m4_m4(Projection, m); CHECKMAT(Projection3D); state.dirty = true; } @@ -187,7 +187,7 @@ void gpuLoadMatrix2D(const float m[3][3]) void gpuLoadIdentity(void) { - unit_m4(ModelView3D); + unit_m4(ModelView); #if SUPPORT_LEGACY_MATRIX glLoadIdentity(); #endif @@ -227,7 +227,7 @@ void gpuTranslate3f(float x, float y, float z) #endif #if 1 - translate_m4(ModelView3D, x, y, z); + translate_m4(ModelView, x, y, z); CHECKMAT(ModelView3D); #else /* above works well in early testing, below is generic version */ Mat4 m; @@ -313,7 +313,7 @@ void gpuMultMatrix3D(const float m[4][4]) } #endif - mul_m4_m4_post(ModelView3D, m); + mul_m4_m4_post(ModelView, m); CHECKMAT(ModelView3D); state.dirty = true; } @@ -321,7 +321,7 @@ void gpuMultMatrix3D(const float m[4][4]) #if MATRIX_2D_4x4 void gpuMultMatrix2D(const float m[4][4]) { - mul_m4_m4_post(ModelView3D, m); + mul_m4_m4_post(ModelView, m); CHECKMAT(ModelView2D); state.dirty = true; } @@ -347,7 +347,7 @@ void gpuRotate2D(float deg) /* essentially RotateAxis('Z') * TODO: simpler math for 2D case */ - rotate_m4(ModelView3D, 'Z', DEG2RADF(deg)); + rotate_m4(ModelView, 'Z', DEG2RADF(deg)); } void gpuRotate3f(float deg, float x, float y, float z) @@ -389,7 +389,7 @@ void gpuRotateAxis(float deg, char axis) #endif /* rotate_m4 works in place */ - rotate_m4(ModelView3D, axis, DEG2RADF(deg)); + rotate_m4(ModelView, axis, DEG2RADF(deg)); CHECKMAT(ModelView3D); state.dirty = true; } @@ -532,7 +532,7 @@ void gpuOrtho(float left, float right, float bottom, float top, float near, floa } #endif - mat4_ortho_set(Projection3D, left, right, bottom, top, near, far); + mat4_ortho_set(Projection, left, right, bottom, top, near, far); CHECKMAT(Projection3D); state.dirty = true; } @@ -587,7 +587,7 @@ void gpuFrustum(float left, float right, float bottom, float top, float near, fl } #endif - mat4_frustum_set(Projection3D, left, right, bottom, top, near, far); + mat4_frustum_set(Projection, left, right, bottom, top, near, far); CHECKMAT(Projection3D); state.dirty = true; } @@ -684,11 +684,11 @@ const float *gpuGetModelViewMatrix3D(float m[4][4]) #endif if (m) { - copy_m4_m4(m, ModelView3D); + copy_m4_m4(m, ModelView); return (const float*)m; } else { - return (const float*)ModelView3D; + return (const float*)ModelView; } } @@
[Bf-blender-cvs] [cb2c4bfb74c] blender2.8: GPU Matrix API refactor: Stick to a single 4x4 stack for 2D and 3D
Commit: cb2c4bfb74ca7f385bbd8d7c3445a49a2d1b7b8d Author: Dalai Felinto Date: Fri Apr 14 14:13:38 2017 +0200 Branches: blender2.8 https://developer.blender.org/rBcb2c4bfb74ca7f385bbd8d7c3445a49a2d1b7b8d GPU Matrix API refactor: Stick to a single 4x4 stack for 2D and 3D * Brings us closer to core profile, all matrices are working, and apart from a problem with text drawing, Blender is working fine. * Reduce the coding overhead of having to setup/teardown when alternating between 2D and 3D drawing sessions. * Gives us fewer modes and states we need to keep track of. Unfortunatelly this also "rejects a fundamental change" the original design was trying to make - that 2D is different from 3D and deserves its own best implementation. That said, it is still aligned with the function API design as originally implemented (i.e., it still uses gpuTranslate2D, ...). Finally, if you build with core profile and this patch you get: https://developer.blender.org/F545352 [The text glitch is an unrelated issue]. Reviewers: merwin, sergey, brecht Differential Revision: https://developer.blender.org/D2626 === M source/blender/draw/intern/draw_manager.c M source/blender/draw/intern/draw_view.c M source/blender/editors/space_view3d/view3d_draw.c M source/blender/gpu/GPU_matrix.h M source/blender/gpu/intern/gpu_framebuffer.c M source/blender/gpu/intern/gpu_matrix.c === diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index bdc57140e05..2f8bc59a781 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -1856,8 +1856,6 @@ void DRW_draw_view(const bContext *C) /* Start Drawing */ DRW_engines_draw_background(); - gpuMatrixBegin3D(); - DRW_draw_callbacks_pre_scene(); // DRW_draw_grid(); DRW_engines_draw_scene(); @@ -1865,8 +1863,6 @@ void DRW_draw_view(const bContext *C) DRW_draw_manipulator(); - gpuMatrixEnd(); - DRW_draw_region_info(); if (G.debug_value > 20) { diff --git a/source/blender/draw/intern/draw_view.c b/source/blender/draw/intern/draw_view.c index 5fc7fe1d8f4..f5ddd05e915 100644 --- a/source/blender/draw/intern/draw_view.c +++ b/source/blender/draw/intern/draw_view.c @@ -554,8 +554,6 @@ void DRW_draw_background(void) if (UI_GetThemeValue(TH_SHOW_BACK_GRAD)) { /* Gradient background Color */ - gpuMatrixBegin3D(); /* TODO: finish 2D API */ - glDisable(GL_DEPTH_TEST); VertexFormat *format = immVertexFormat(); @@ -580,8 +578,6 @@ void DRW_draw_background(void) immUnbindProgram(); - gpuMatrixEnd(); - glClear(GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); } else { diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 0d5e6440355..c9f70945866 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -2294,8 +2294,6 @@ static void view3d_draw_view(const bContext *C, ARegion *ar, DrawData *draw_data glClear(GL_DEPTH_BUFFER_BIT); // glDisable(GL_DEPTH_TEST); /* should be set by default */ - gpuMatrixBegin3D(); - view3d_draw_background(C); /* clears/overwrites entire color buffer */ view3d_draw_setup_view(C, ar); @@ -2318,8 +2316,6 @@ static void view3d_draw_view(const bContext *C, ARegion *ar, DrawData *draw_data view3d_draw_reference_images(C); view3d_draw_manipulators(C, ar); - gpuMatrixEnd(); - glDisable(GL_DEPTH_TEST); view3d_draw_region_info(C, ar); diff --git a/source/blender/gpu/GPU_matrix.h b/source/blender/gpu/GPU_matrix.h index 62b5b7f8ba5..4a47f55a6c6 100644 --- a/source/blender/gpu/GPU_matrix.h +++ b/source/blender/gpu/GPU_matrix.h @@ -69,12 +69,6 @@ typedef enum { MatrixMode gpuMatrixMode(void); -void gpuMatrixBegin2D(void); -void gpuMatrixBegin3D(void); -void gpuMatrixEnd(void); -/* TODO: gpuMatrixResume2D & gpuMatrixResume3D to switch modes but not reset stack */ - - /* ModelView Matrix (2D or 3D) */ void gpuPushMatrix(void); /* TODO: PushCopy vs PushIdentity? */ @@ -105,12 +99,7 @@ void gpuLookAt(float eyeX, float eyeY, float eyeZ, float centerX, float centerY, /* 2D ModelView Matrix */ -#if MATRIX_2D_4x4 void gpuMultMatrix2D(const float m[4][4]); -#else -void gpuLoadMatrix2D(const float m[3][3]); -void gpuMultMatrix2D(const float m[3][3]); -#endif void gpuTranslate2f(float x, float y); void gpuTranslate2fv(const float vec[2]); @@ -187,12 +176,7 @@ bool gpuMatricesDirty(void); /* since last bind */ # define gpuLoadProjectionMatrix3D(x) gpuLoadProjectionMatrix3D((const float
[Bf-blender-cvs] [e7c4eddace2] blender2.8: Add fatal error in CMake when trying to build WITH_GAMEENGINE but without WITH_LEGACY_OPENGL
Commit: e7c4eddace27272ba4d14f7e2fd0a39256e3c656 Author: Bastien Montagne Date: Fri Apr 14 17:16:15 2017 +0200 Branches: blender2.8 https://developer.blender.org/rBe7c4eddace27272ba4d14f7e2fd0a39256e3c656 Add fatal error in CMake when trying to build WITH_GAMEENGINE but without WITH_LEGACY_OPENGL This won't work currently. === M CMakeLists.txt === diff --git a/CMakeLists.txt b/CMakeLists.txt index 19e13612baa..9789e563681 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -681,6 +681,10 @@ if(NOT WITH_GAMEENGINE AND WITH_PLAYER) message(FATAL_ERROR "WITH_PLAYER requires WITH_GAMEENGINE") endif() +if(WITH_GAMEENGINE AND NOT WITH_LEGACY_OPENGL) + message(FATAL_ERROR "WITH_GAME_ENGINE requires WITH_LEGACY_OPENGL") +endif() + if(NOT WITH_AUDASPACE) if(WITH_OPENAL) message(FATAL_ERROR "WITH_OPENAL requires WITH_AUDASPACE") ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [78b5d66af8e] master: Object Info node support for GLSL mode and the internal render
Commit: 78b5d66af8e29ddfd234fb07bd36be785702901e Author: Alexander Romanov Date: Fri Apr 14 18:13:44 2017 +0300 Branches: master https://developer.blender.org/rB78b5d66af8e29ddfd234fb07bd36be785702901e Object Info node support for GLSL mode and the internal render Object Info node can be useful to give some variation to a single material assigned to multiple instances. This patch adds support for Viewport and BI. {F499530} Example: {F499528} Reviewers: merwin, brecht, dfelinto Reviewed By: brecht Subscribers: duarteframos, fclem, homyachetser, Evgeny_Rodygin, AlexKowel, yurikovelenov Differential Revision: https://developer.blender.org/D2425 === M intern/cycles/blender/blender_object.cpp M release/scripts/startup/nodeitems_builtins.py M source/blender/blenkernel/intern/object_dupli.c A source/blender/blenlib/BLI_hash.h M source/blender/gpu/GPU_material.h M source/blender/gpu/intern/gpu_codegen.c M source/blender/gpu/intern/gpu_draw.c M source/blender/gpu/intern/gpu_material.c M source/blender/gpu/intern/gpu_shader.c M source/blender/gpu/shaders/gpu_shader_material.glsl M source/blender/makesdna/DNA_object_types.h M source/blender/makesrna/intern/rna_object.c M source/blender/nodes/shader/nodes/node_shader_object_info.c M source/blender/render/extern/include/RE_pipeline.h M source/blender/render/extern/include/RE_shader_ext.h M source/blender/render/intern/include/render_types.h M source/blender/render/intern/source/renderdatabase.c M source/blender/render/intern/source/shadeoutput.c M source/blenderplayer/bad_level_call_stubs/stubs.c M source/gameengine/Ketsji/BL_BlenderShader.cpp === diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp index d05699236cc..2810ad15b9a 100644 --- a/intern/cycles/blender/blender_object.cpp +++ b/intern/cycles/blender/blender_object.cpp @@ -379,27 +379,16 @@ Object *BlenderSync::sync_object(BL::Object& b_parent, } } - /* random number */ - object->random_id = hash_string(object->name.c_str()); - - if(persistent_id) { - for(int i = 0; i < OBJECT_PERSISTENT_ID_SIZE; i++) - object->random_id = hash_int_2d(object->random_id, persistent_id[i]); - } - else - object->random_id = hash_int_2d(object->random_id, 0); - - if(b_parent.ptr.data != b_ob.ptr.data) - object->random_id ^= hash_int(hash_string(b_parent.name().c_str())); - - /* dupli texture coordinates */ + /* dupli texture coordinates and random_id */ if(b_dupli_ob) { object->dupli_generated = 0.5f*get_float3(b_dupli_ob.orco()) - make_float3(0.5f, 0.5f, 0.5f); object->dupli_uv = get_float2(b_dupli_ob.uv()); + object->random_id = b_dupli_ob.random_id(); } else { object->dupli_generated = make_float3(0.0f, 0.0f, 0.0f); object->dupli_uv = make_float2(0.0f, 0.0f); + object->random_id = hash_int_2d(hash_string(object->name.c_str()), 0); } object->tag_update(scene); diff --git a/release/scripts/startup/nodeitems_builtins.py b/release/scripts/startup/nodeitems_builtins.py index afc6e5455c4..517a0738b44 100644 --- a/release/scripts/startup/nodeitems_builtins.py +++ b/release/scripts/startup/nodeitems_builtins.py @@ -157,6 +157,7 @@ shader_node_categories = [ NodeItem("ShaderNodeGeometry"), NodeItem("ShaderNodeExtendedMaterial"), NodeItem("ShaderNodeParticleInfo"), +NodeItem("ShaderNodeObjectInfo"), NodeItem("NodeGroupInput", poll=group_input_output_item_poll), ]), ShaderOldNodeCategory("SH_OUTPUT", "Output", items=[ diff --git a/source/blender/blenkernel/intern/object_dupli.c b/source/blender/blenkernel/intern/object_dupli.c index e3b801b3193..eb7abc2f004 100644 --- a/source/blender/blenkernel/intern/object_dupli.c +++ b/source/blender/blenkernel/intern/object_dupli.c @@ -64,6 +64,7 @@ #include "BLI_strict_flags.h" +#include "BLI_hash.h" /* Dupli-Geometry */ @@ -180,6 +181,22 @@ static DupliObject *make_dupli(const DupliContext *ctx, if (ob->type == OB_MBALL) dob->no_draw = true; + /* random number */ + /* the logic here is designed to match Cycles */ + dob->random_id = BLI_hash_string(dob->ob->id.name + 2); + + if (dob->persistent_id[0] != INT_MAX) { + for(i = 0; i < MAX_DUPLI_RECUR*2; i++) + dob->random_id =
[Bf-blender-cvs] [89e23c743e6] blender2.8: OpenGL: fix Mac crashing on startup
Commit: 89e23c743e601940fc051189ef01c537233d2043 Author: Mike Erwin Date: Fri Apr 14 10:35:30 2017 -0400 Branches: blender2.8 https://developer.blender.org/rB89e23c743e601940fc051189ef01c537233d2043 OpenGL: fix Mac crashing on startup On Apple we use OpenGL 2.1 + an ARB extension for framebuffers. The glFramebufferTexture function is part of OpenGL 3.0 but not part of the ARB extension. This commit fills that gap. All other platforms are using GL 3.0+ already so it's not an issue there. All platforms (Mac too) will use GL 3.3+ soon so this workaround will be removed. === M source/blender/gpu/intern/gpu_framebuffer.c === diff --git a/source/blender/gpu/intern/gpu_framebuffer.c b/source/blender/gpu/intern/gpu_framebuffer.c index ce3b37b3a66..5e66c691f37 100644 --- a/source/blender/gpu/intern/gpu_framebuffer.c +++ b/source/blender/gpu/intern/gpu_framebuffer.c @@ -143,7 +143,12 @@ bool GPU_framebuffer_texture_attach(GPUFrameBuffer *fb, GPUTexture *tex, int slo else attachment = GL_COLOR_ATTACHMENT0 + slot; +#if defined(__APPLE__) && defined(WITH_GL_PROFILE_COMPAT) + /* Mac workaround, remove after we switch to core profile */ + glFramebufferTextureEXT(GL_FRAMEBUFFER, attachment, GPU_texture_opengl_bindcode(tex), 0); +#else glFramebufferTexture(GL_FRAMEBUFFER, attachment, GPU_texture_opengl_bindcode(tex), 0); +#endif if (GPU_texture_depth(tex)) fb->depthtex = tex; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [6fc7521adee] master: Fix T49429: incorrect Blender internal viewport border render with DrawPixels method.
Commit: 6fc7521adeec11fa9e68f77a30924d5ff05819a4 Author: Brecht Van Lommel Date: Fri Apr 14 16:26:10 2017 +0200 Branches: master https://developer.blender.org/rB6fc7521adeec11fa9e68f77a30924d5ff05819a4 Fix T49429: incorrect Blender internal viewport border render with DrawPixels method. === M source/blender/editors/screen/glutil.c === diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c index 93bac3f6660..216cbe9d7f4 100644 --- a/source/blender/editors/screen/glutil.c +++ b/source/blender/editors/screen/glutil.c @@ -566,7 +566,7 @@ void glaDrawPixelsSafe(float x, float y, int img_w, int img_h, int row_w, int fo float rast_x = x + off_x * xzoom; float rast_y = y + off_y * yzoom; - GLfloat scissor[4]; + GLfloat viewport[4]; int draw_w, draw_h; /* Determine the smallest number of pixels we need to draw @@ -581,9 +581,9 @@ void glaDrawPixelsSafe(float x, float y, int img_w, int img_h, int row_w, int fo * fails if we zoom in on one really huge pixel so that it * covers the entire screen). */ - glGetFloatv(GL_SCISSOR_BOX, scissor); - draw_w = min_ii(img_w - off_x, ceil((scissor[2] - rast_x) / xzoom)); - draw_h = min_ii(img_h - off_y, ceil((scissor[3] - rast_y) / yzoom)); + glGetFloatv(GL_VIEWPORT, viewport); + draw_w = min_ii(img_w - off_x, ceil((viewport[2] - rast_x) / xzoom)); + draw_h = min_ii(img_h - off_y, ceil((viewport[3] - rast_y) / yzoom)); if (draw_w > 0 && draw_h > 0) { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [e12c3110024] master: Alembic import: greatly improved curve/hair import performance
Commit: e12c3110024dc4b62ffefa739288218b04e39f71 Author: Sybren A. Stüvel Date: Fri Apr 14 15:26:45 2017 +0200 Branches: master https://developer.blender.org/rBe12c3110024dc4b62ffefa739288218b04e39f71 Alembic import: greatly improved curve/hair import performance The U-resolution of the imported curves was kept at the default value of 12, which is way too high for imported hair. We export hair at a fairly high resolution already, so it's not needed to subdivide even further when importing. Of course this may have an impact on other curves that do require this U-resolution to be higher. In that case the resolution can be increased after importing. I removed the default nu->orderu = num_verts, as that allowed every point to influence the entire spline, which was more expensive for the CPU, and unlikely to be needed. The orderu computations had off-by-one errors in the curve importer, which are now also fixed. The correct values are: - Linear: orderu = 2 - Quadratic: orderu = 3 - Cubic: orderu = 4 These values are also what is stored in the Alembic file for curves of type kVariableOrder, according to the reference Maya exporter maya/AbcExport/MayaNurbsCurveWriter.cpp, function MayaNurbsCurveWriter::write(), in the Alembic source code. The result is a frame rate increase of roughly 100x (tested with one 100-hair test on one machine, so take with grain of salt). === M source/blender/alembic/intern/abc_curves.cc === diff --git a/source/blender/alembic/intern/abc_curves.cc b/source/blender/alembic/intern/abc_curves.cc index 0542255d84b..28e75db2862 100644 --- a/source/blender/alembic/intern/abc_curves.cc +++ b/source/blender/alembic/intern/abc_curves.cc @@ -205,6 +205,7 @@ void AbcCurveReader::readObjectData(Main *bmain, float time) cu->flag |= CU_DEFORM_FILL | CU_3D; cu->actvert = CU_ACT_NONE; + cu->resolu = 1; m_object = BKE_object_add_only_object(bmain, OB_CURVE, m_object_name.c_str()); m_object->data = cu; @@ -250,13 +251,18 @@ void read_curve_sample(Curve *cu, const ICurvesSchema , const float time) nu->pntsv = 1; nu->flag |= CU_SMOOTH; - nu->orderu = num_verts; - - if (smp.getType() == Alembic::AbcGeom::kCubic) { - nu->orderu = 3; - } - else if (orders && orders->size() > i) { - nu->orderu = static_cast((*orders)[i] - 1); + switch (smp.getType()) { + case Alembic::AbcGeom::kCubic: + nu->orderu = 4; + break; + case Alembic::AbcGeom::kVariableOrder: + if (orders && orders->size() > i) { + nu->orderu = static_cast((*orders)[i]); + } + break; + case Alembic::AbcGeom::kLinear: + default: + nu->orderu = 2; } if (periodicity == Alembic::AbcGeom::kNonPeriodic) { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [bef2aab862b] blender2.8: Gawain: fix crash when drawing batches (e.g., scale manipulator)
Commit: bef2aab862b83eec63ddfae460373aae280934b0 Author: Dalai Felinto Date: Fri Apr 14 14:19:40 2017 +0200 Branches: blender2.8 https://developer.blender.org/rBbef2aab862b83eec63ddfae460373aae280934b0 Gawain: fix crash when drawing batches (e.g., scale manipulator) Introduced in b02786ae6b === M intern/gawain/src/batch.c === diff --git a/intern/gawain/src/batch.c b/intern/gawain/src/batch.c index 5de6335e0bb..d4465c7809a 100644 --- a/intern/gawain/src/batch.c +++ b/intern/gawain/src/batch.c @@ -14,7 +14,7 @@ #include // necessary functions from matrix API -extern void gpuBindMatrices(GLuint program); +extern void gpuBindMatrices(const ShaderInterface* shaderface); extern bool gpuMatricesDirty(void); // how best to use this here? Batch* Batch_create(PrimitiveType prim_type, VertexBuffer* verts, ElementList* elem) @@ -262,7 +262,7 @@ void Batch_draw(Batch* batch) Batch_use_program(batch); - gpuBindMatrices(batch->program); + gpuBindMatrices(batch->interface); if (batch->elem) { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [780d62e774f] greasepencil-object: Save parent matrix in bGPDlayer
Commit: 780d62e774ffe78b94e3021090b52bdc1659689c Author: Antonio Vazquez Date: Fri Apr 14 12:54:34 2017 +0200 Branches: greasepencil-object https://developer.blender.org/rB780d62e774ffe78b94e3021090b52bdc1659689c Save parent matrix in bGPDlayer It's faster a more efficient to save this drawing matrix by layer instead to allocate memory on the fly. === M source/blender/draw/engines/gpencil/gpencil_mode.c M source/blender/makesdna/DNA_gpencil_types.h === diff --git a/source/blender/draw/engines/gpencil/gpencil_mode.c b/source/blender/draw/engines/gpencil/gpencil_mode.c index 6990b46d27e..7cbe09a5b16 100644 --- a/source/blender/draw/engines/gpencil/gpencil_mode.c +++ b/source/blender/draw/engines/gpencil/gpencil_mode.c @@ -85,16 +85,11 @@ typedef struct GPENCIL_Data { } GPENCIL_Data; /* *** STATIC *** */ -typedef struct GPENCIL_parent { - float matrix[4][4]; -} GPENCIL_parent; - typedef struct g_data{ int t_flip; int t_mix; int fill_style; DRWShadingGroup *shgrps_volumetric; - GPENCIL_parent *parents; } g_data; /* Transient data */ static struct { @@ -210,7 +205,6 @@ static void GPENCIL_cache_init(void *vedata) if (!stl->g_data) { /* Alloc transient pointers */ stl->g_data = MEM_mallocN(sizeof(g_data), "g_data"); - stl->g_data->parents = MEM_mallocN(sizeof(GPENCIL_parent), "GPENCIL_parents"); } { @@ -256,12 +250,7 @@ static void GPENCIL_cache_populate(void *vedata, Object *ob) UNUSED_VARS(psl, stl); if (ob->type == OB_GPENCIL && ob->gpd) { - /* prepare to save parent matrix */ - int totlayers = BLI_listbase_count(>gpd->layers); - stl->g_data->parents = MEM_recallocN(stl->g_data->parents, sizeof(GPENCIL_parent) * totlayers); - - int i = 0; - for (bGPDlayer *gpl = ob->gpd->layers.first; gpl; gpl = gpl->next, i++) { + for (bGPDlayer *gpl = ob->gpd->layers.first; gpl; gpl = gpl->next) { /* don't draw layer if hidden */ if (gpl->flag & GP_LAYER_HIDE) continue; @@ -283,9 +272,9 @@ static void GPENCIL_cache_populate(void *vedata, Object *ob) } #endif - /* get parent matrix and set as static data */ + /* get parent matrix and save as static data */ ED_gpencil_parent_location(ob, ob->gpd, gpl, matrix); - copy_m4_m4(stl->g_data->parents[i].matrix, matrix); + copy_m4_m4(gpl->matrix, matrix); for (bGPDstroke *gps = gpf->strokes.first; gps; gps = gps->next) { /* check if stroke can be drawn */ @@ -312,7 +301,7 @@ static void GPENCIL_cache_populate(void *vedata, Object *ob) tfill[3] = gps->palcolor->fill[3] * gpl->opacity; if ((tfill[3] > GPENCIL_ALPHA_OPACITY_THRESH) || (gps->palcolor->fill_style > 0)) { struct Batch *fill_geom = gpencil_get_fill_geom(gps, tfill); - DRW_shgroup_call_add(fillgrp, fill_geom, stl->g_data->parents[i].matrix); + DRW_shgroup_call_add(fillgrp, fill_geom, gpl->matrix); } } @@ -324,7 +313,7 @@ static void GPENCIL_cache_populate(void *vedata, Object *ob) short sthickness = gps->thickness + gpl->thickness; if (sthickness > 0) { struct Batch *stroke_geom = gpencil_get_stroke_geom(gps, sthickness, ink); - DRW_shgroup_call_add(strokegrp, stroke_geom, stl->g_data->parents[i].matrix); + DRW_shgroup_call_add(strokegrp, stroke_geom, gpl->matrix); } /* edit points (only in edit mode) */ @@ -333,7 +322,7 @@ static void GPENCIL_cache_populate(void *vedata, Object *ob) if (gps->flag & GP_STROKE_SELECT) { if ((gpl->flag & GP_LAYER_UNLOCK_COLOR) || ((gps->palcolor->flag & PC_COLOR_LOCKED) == 0)) { struct Batch *edit_geom = gpencil_get_edit_geom(gps, ts->gp_sculpt.alpha, ob->gpd->flag); - DRW_shgroup_call_add(stl->g_data->shgrps_volumetric, edit_geom, stl->g_data->parents[i].matrix); +
[Bf-blender-cvs] [6af131fa5cd] master: Added simple unittests for Alembic exporter
Commit: 6af131fa5cd90a6290cb44a683d2f6da01ad8392 Author: Sybren A. Stüvel Date: Fri Apr 14 12:54:20 2017 +0200 Branches: master https://developer.blender.org/rB6af131fa5cd90a6290cb44a683d2f6da01ad8392 Added simple unittests for Alembic exporter This test checks that a set of cubes are exported with the correct transform, both with flatten=True and flatten=False. This commit also adds an easy to use superclass for upcoming Alembic unit tests. === M tests/python/CMakeLists.txt A tests/python/alembic_tests.py === diff --git a/tests/python/CMakeLists.txt b/tests/python/CMakeLists.txt index 393aa512f0c..8ff2f77c38e 100644 --- a/tests/python/CMakeLists.txt +++ b/tests/python/CMakeLists.txt @@ -442,3 +442,23 @@ if(WITH_CYCLES) MESSAGE(STATUS "Disabling Cycles tests because tests folder does not exist") endif() endif() + +if(WITH_ALEMBIC) + if(MSVC) + add_test(NAME cycles_${subject}_test + COMMAND + "$/${BLENDER_VERSION_MAJOR}.${BLENDER_VERSION_MINOR}/python/bin/python$<$:_d>" + ${CMAKE_CURRENT_LIST_DIR}/alembic_tests.py + --blender "${TEST_BLENDER_EXE_BARE}" + --testdir "${TEST_SRC_DIR}/alembic" + --alembic-root "${ALEMBIC_ROOT_DIR}" + ) + else() + add_test(alembic_tests + ${CMAKE_CURRENT_LIST_DIR}/alembic_tests.py + --blender "${TEST_BLENDER_EXE_BARE}" + --testdir "${TEST_SRC_DIR}/alembic" + --alembic-root "${ALEMBIC_ROOT_DIR}" + ) + endif() +endif() diff --git a/tests/python/alembic_tests.py b/tests/python/alembic_tests.py new file mode 100755 index 000..1af2a157b64 --- /dev/null +++ b/tests/python/alembic_tests.py @@ -0,0 +1,225 @@ +#!/usr/bin/env python3 +# # 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. +# +# # END GPL LICENSE BLOCK # + +# + +import argparse +import functools +import shutil +import pathlib +import subprocess +import sys +import tempfile +import unittest + + +def with_tempdir(wrapped): +"""Creates a temporary directory for the function, cleaning up after it returns normally. + +When the wrapped function raises an exception, the contents of the temporary directory +remain available for manual inspection. + +The wrapped function is called with an extra positional argument containing +the pathlib.Path() of the temporary directory. +""" + +@functools.wraps(wrapped) +def decorator(*args, **kwargs): +dirname = tempfile.mkdtemp(prefix='blender-alembic-test') +try: +retval = wrapped(*args, pathlib.Path(dirname), **kwargs) +except: +print('Exception in %s, not cleaning up temporary directory %s' % (wrapped, dirname)) +raise +else: +shutil.rmtree(dirname) +return retval + +return decorator + + +class AbstractAlembicTest(unittest.TestCase): +@classmethod +def setUpClass(cls): +import re + +parser = argparse.ArgumentParser() +parser.add_argument('--blender', required=True) +parser.add_argument('--testdir', required=True) +parser.add_argument('--alembic-root', required=True) +args, _ = parser.parse_known_args() + +cls.blender = args.blender +cls.testdir = pathlib.Path(args.testdir) +cls.alembic_root = pathlib.Path(args.alembic_root) + +# 'abcls' outputs ANSI colour codes, even when stdout is not a terminal. +# See https://github.com/alembic/alembic/issues/120 +cls.ansi_remove_re = re.compile(rb'\x1b[^m]*m') + +# 'abcls' array notation, like "name[16]" +cls.abcls_array = re.compile(r'^(?P[^\[]+)(\[(?P\d+)\])?$') + +def run_blender(self, filepath: str, python_script: str, timeout: int=300) -> str: +"""Runs Blender by opening a blendfile and executing a script. + +Returns Blender's stdout + stderr combined into one string. + +:param
[Bf-blender-cvs] [95b36321126] blender2.8: Merge branch 'master' into blender2.8
Commit: 95b36321126fd6f9563b309930ac9ae6cf422a81 Author: Bastien Montagne Date: Fri Apr 14 12:36:56 2017 +0200 Branches: blender2.8 https://developer.blender.org/rB95b36321126fd6f9563b309930ac9ae6cf422a81 Merge branch 'master' into blender2.8 Conflicts: source/blender/alembic/intern/abc_exporter.cc === === diff --cc source/blender/alembic/intern/abc_exporter.cc index 1b218b98f21,a8d1587abdb..ddbbf27392d --- a/source/blender/alembic/intern/abc_exporter.cc +++ b/source/blender/alembic/intern/abc_exporter.cc @@@ -124,19 -124,37 +124,37 @@@ static bool object_is_shape(Object *ob } } - static bool export_object(const ExportSettings * const settings, const Base * const ob_base) + + /** + * Returns whether this object should be exported into the Alembic file. + * + * @param settings export settings, used for options like 'selected only'. - * @param ob the object in question. ++ * @param ob the object's base in question. + * @param is_duplicated normally false; true when the object is instanced + * into the scene by a dupli-object (e.g. part of a + * dupligroup). This ignores selection and layer + * visibility, and assumes that the dupli-object itself + * (e.g. the group-instantiating empty) is exported. + */ -static bool export_object(const ExportSettings * const settings, Object *ob, ++static bool export_object(const ExportSettings * const settings, const Base * const ob_base, + bool is_duplicated) { - if (settings->selected_only && !object_selected(ob_base)) { - return false; - } - // FIXME Sybren: handle these cleanly (maybe just remove code), now using active scene layer instead. - if (settings->visible_layers_only && (ob_base->flag & BASE_VISIBLED) == 0) { - return false; + if (!is_duplicated) { + /* These two tests only make sense when the object isn't being instanced +* into the scene. When it is, its exportability is determined by +* its dupli-object and the DupliObject::no_draw property. */ - if (settings->selected_only && !parent_selected(ob)) { ++ if (settings->selected_only && !object_selected(ob_base)) { + return false; + } - - if (settings->visible_layers_only && !(settings->scene->lay & ob->lay)) { ++ // FIXME Sybren: handle these cleanly (maybe just remove code), now using active scene layer instead. ++ if (settings->visible_layers_only && (ob_base->flag & BASE_VISIBLED) == 0) { + return false; + } } - if (settings->renderable_only && (ob->restrictflag & OB_RESTRICT_RENDER)) { - return false; - } + // if (settings->renderable_only && (ob->restrictflag & OB_RESTRICT_RENDER)) { + // return false; + // } return true; } @@@ -344,31 -362,35 +362,31 @@@ void AbcExporter::operator()(Main *bmai void AbcExporter::createTransformWritersHierarchy(EvaluationContext *eval_ctx) { - Base *base = static_cast(m_scene->base.first); - - while (base) { + for (Base *base = static_cast(m_settings.sl->object_bases.first); base; base = base->next) { Object *ob = base->object; - if (export_object(_settings, base)) { - switch (ob->type) { - case OB_LAMP: - case OB_LATTICE: - case OB_MBALL: - case OB_SPEAKER: - /* We do not export transforms for objects of these classes. */ - break; - - default: - exploreTransform(eval_ctx, ob, ob->parent); ++ if (export_object(_settings, base, false)) { + switch (ob->type) { + case OB_LAMP: + case OB_LATTICE: + case OB_MBALL: + case OB_SPEAKER: + /* We do not export transforms for objects of these classes. */ + break; + + default: + exploreTransform(eval_ctx, base, ob->parent, NULL); + } } - - base = base->next; } } void AbcExporter::createTransformWritersFlat() { - Base *base = static_cast(m_scene->base.first); - - while (base) { + for (Base *base = static_cast(m_settings.sl->object_bases.first); base; base =
[Bf-blender-cvs] [6cda217a820] blender2.8: Fix Blenderplayer (c)
Commit: 6cda217a82078d7bdf61caec458154a507a58947 Author: Bastien Montagne Date: Thu Apr 13 12:36:19 2017 +0200 Branches: blender2.8 https://developer.blender.org/rB6cda217a82078d7bdf61caec458154a507a58947 Fix Blenderplayer (c) === M source/blenderplayer/bad_level_call_stubs/stubs.c === diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c index 72a8e8e0b06..b57acc14d36 100644 --- a/source/blenderplayer/bad_level_call_stubs/stubs.c +++ b/source/blenderplayer/bad_level_call_stubs/stubs.c @@ -203,6 +203,7 @@ extern bool pyrna_id_FromPyObject(struct PyObject *obj, struct ID **id); extern const char *BPY_app_translations_py_pgettext(const char *msgctxt, const char *msgid); extern const char *BPY_app_translations_py_pgettext(const char *msgctxt, const char *msgid); extern struct PyObject *pyrna_id_CreatePyObject(struct ID *id); +extern bool pyrna_id_CheckPyObject(struct PyObject *obj); /* bpy_interface.c */ bool BPY_string_is_keyword(const char *str) { return false; } @@ -776,6 +777,7 @@ void BPY_pyconstraint_exec(struct bPythonConstraint *con, struct bConstraintOb * void macro_wrapper(struct wmOperatorType *ot, void *userdata) RET_NONE bool pyrna_id_FromPyObject(struct PyObject *obj, struct ID **id) RET_ZERO struct PyObject *pyrna_id_CreatePyObject(struct ID *id) RET_NULL +bool pyrna_id_CheckPyObject(struct PyObject *obj) RET_ZERO void BPY_context_update(struct bContext *C) RET_NONE const char *BPY_app_translations_py_pgettext(const char *msgctxt, const char *msgid) RET_ARG(msgid) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [6008e08187c] greasepencil-object: Merge branch 'blender2.8' into greasepencil-object
Commit: 6008e08187c5e76e56ffa79d21855e74a44caf57 Author: Antonio Vazquez Date: Fri Apr 14 12:15:54 2017 +0200 Branches: greasepencil-object https://developer.blender.org/rB6008e08187c5e76e56ffa79d21855e74a44caf57 Merge branch 'blender2.8' into greasepencil-object === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [3dd7267d5a9] greasepencil-object: Remove duplicate function
Commit: 3dd7267d5a93d0d708294f40b8172f8b26afdf19 Author: Antonio Vazquez Date: Fri Apr 14 12:13:46 2017 +0200 Branches: greasepencil-object https://developer.blender.org/rB3dd7267d5a93d0d708294f40b8172f8b26afdf19 Remove duplicate function Initially, the function to calculate the matrix was different, but now both are equal, so new function can be deleted. === M source/blender/draw/engines/gpencil/gpencil_draw.c M source/blender/draw/engines/gpencil/gpencil_mode.c M source/blender/draw/engines/gpencil/gpencil_mode.h === diff --git a/source/blender/draw/engines/gpencil/gpencil_draw.c b/source/blender/draw/engines/gpencil/gpencil_draw.c index a9165f5782c..96100644326 100644 --- a/source/blender/draw/engines/gpencil/gpencil_draw.c +++ b/source/blender/draw/engines/gpencil/gpencil_draw.c @@ -437,43 +437,3 @@ Batch *gpencil_get_edit_geom(bGPDstroke *gps, float alpha, short dflag) return Batch_create(PRIM_POINTS, vbo, NULL); } - -void gpencil_get_parent_matrix(Object *obact, bGPdata *gpd, bGPDlayer *gpl, float diff_mat[4][4]) -{ - Object *obparent = gpl->parent; - - /* if not layer parented, try with object parented */ - if (obparent == NULL) { - if (obact != NULL) { - /* the gpd can be scene, but a gpobject can be active, so need check gpd */ - if ((obact->type == OB_GPENCIL) && (obact->gpd == gpd)) { - copy_m4_m4(diff_mat, obact->obmat); - return; - } - } - /* not gpencil object */ - unit_m4(diff_mat); - return; - } - else { - if ((gpl->partype == PAROBJECT) || (gpl->partype == PARSKEL)) { - mul_m4_m4m4(diff_mat, obparent->obmat, gpl->inverse); - return; - } - else if (gpl->partype == PARBONE) { - bPoseChannel *pchan = BKE_pose_channel_find_name(obparent->pose, gpl->parsubstr); - if (pchan) { - float tmp_mat[4][4]; - mul_m4_m4m4(tmp_mat, obparent->obmat, pchan->pose_mat); - mul_m4_m4m4(diff_mat, tmp_mat, gpl->inverse); - } - else { - mul_m4_m4m4(diff_mat, obparent->obmat, gpl->inverse); /* if bone not found use object (armature) */ - } - return; - } - else { - unit_m4(diff_mat); /* not defined type */ - } - } -} diff --git a/source/blender/draw/engines/gpencil/gpencil_mode.c b/source/blender/draw/engines/gpencil/gpencil_mode.c index 3a922a10d27..6990b46d27e 100644 --- a/source/blender/draw/engines/gpencil/gpencil_mode.c +++ b/source/blender/draw/engines/gpencil/gpencil_mode.c @@ -284,7 +284,7 @@ static void GPENCIL_cache_populate(void *vedata, Object *ob) #endif /* get parent matrix and set as static data */ - gpencil_get_parent_matrix(ob, ob->gpd, gpl, matrix); + ED_gpencil_parent_location(ob, ob->gpd, gpl, matrix); copy_m4_m4(stl->g_data->parents[i].matrix, matrix); for (bGPDstroke *gps = gpf->strokes.first; gps; gps = gps->next) { diff --git a/source/blender/draw/engines/gpencil/gpencil_mode.h b/source/blender/draw/engines/gpencil/gpencil_mode.h index 096b7ae241a..b7690656c3f 100644 --- a/source/blender/draw/engines/gpencil/gpencil_mode.h +++ b/source/blender/draw/engines/gpencil/gpencil_mode.h @@ -33,6 +33,5 @@ struct Batch *gpencil_get_fill_geom(struct bGPDstroke *gps, const float color[4] struct Batch *gpencil_get_edit_geom(struct bGPDstroke *gps, float alpha, short dflag); bool gpencil_can_draw_stroke(const struct bGPDstroke *gps); -void gpencil_get_parent_matrix(struct Object *obact, struct bGPdata *gpd, struct bGPDlayer *gpl, float diff_mat[4][4]); #endif /* __GPENCIL_MODE_H__ */ \ No newline at end of file ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [0b55b8cc6a3] master: Cleanup: triple quotes for docstrings
Commit: 0b55b8cc6a37fa4e74c55c9ccb54950c5f546bd6 Author: Campbell Barton Date: Fri Apr 14 20:01:43 2017 +1000 Branches: master https://developer.blender.org/rB0b55b8cc6a37fa4e74c55c9ccb54950c5f546bd6 Cleanup: triple quotes for docstrings === M release/scripts/freestyle/modules/freestyle/utils.py M release/scripts/startup/bl_operators/anim.py M release/scripts/startup/bl_operators/view3d.py M release/scripts/startup/bl_operators/wm.py === diff --git a/release/scripts/freestyle/modules/freestyle/utils.py b/release/scripts/freestyle/modules/freestyle/utils.py index d3eba187f70..2d47995d474 100644 --- a/release/scripts/freestyle/modules/freestyle/utils.py +++ b/release/scripts/freestyle/modules/freestyle/utils.py @@ -318,7 +318,7 @@ class BoundingBox: class StrokeCollector(StrokeShader): -"Collects and Stores stroke objects" +"""Collects and Stores stroke objects""" def __init__(self): StrokeShader.__init__(self) self.strokes = [] diff --git a/release/scripts/startup/bl_operators/anim.py b/release/scripts/startup/bl_operators/anim.py index 78fcf0dd124..02fb05e29eb 100644 --- a/release/scripts/startup/bl_operators/anim.py +++ b/release/scripts/startup/bl_operators/anim.py @@ -36,7 +36,7 @@ from bpy.props import ( class ANIM_OT_keying_set_export(Operator): -"Export Keying Set to a python script" +"""Export Keying Set to a python script""" bl_idname = "anim.keying_set_export" bl_label = "Export Keying Set..." @@ -102,15 +102,13 @@ class ANIM_OT_keying_set_export(Operator): if ksp.id in id_to_paths_cache: continue -""" -- idtype_list is used to get the list of id-datablocks from - bpy.data.* since this info isn't available elsewhere -- id.bl_rna.name gives a name suitable for UI, - with a capitalised first letter, but we need - the plural form that's all lower case -- special handling is needed for "nested" ID-blocks - (e.g. nodetree in Material) -""" +# - idtype_list is used to get the list of id-datablocks from +# bpy.data.* since this info isn't available elsewhere +# - id.bl_rna.name gives a name suitable for UI, +# with a capitalised first letter, but we need +# the plural form that's all lower case +# - special handling is needed for "nested" ID-blocks +# (e.g. nodetree in Material) if ksp.id.bl_rna.identifier.startswith("ShaderNodeTree"): # Find material or lamp using this node tree... id_bpy_path = "bpy.data.nodes[\"%s\"]" diff --git a/release/scripts/startup/bl_operators/view3d.py b/release/scripts/startup/bl_operators/view3d.py index acec2d8fe91..18f91110053 100644 --- a/release/scripts/startup/bl_operators/view3d.py +++ b/release/scripts/startup/bl_operators/view3d.py @@ -24,7 +24,7 @@ from bpy.props import BoolProperty class VIEW3D_OT_edit_mesh_extrude_individual_move(Operator): -"Extrude individual elements and move" +"""Extrude individual elements and move""" bl_label = "Extrude Individual and Move" bl_idname = "view3d.edit_mesh_extrude_individual_move" @@ -62,7 +62,7 @@ class VIEW3D_OT_edit_mesh_extrude_individual_move(Operator): class VIEW3D_OT_edit_mesh_extrude_move(Operator): -"Extrude and move along normals" +"""Extrude and move along normals""" bl_label = "Extrude and Move on Normals" bl_idname = "view3d.edit_mesh_extrude_move_normal" @@ -111,7 +111,7 @@ class VIEW3D_OT_edit_mesh_extrude_move(Operator): class VIEW3D_OT_edit_mesh_extrude_shrink_fatten(Operator): -"Extrude and move along individual normals" +"""Extrude and move along individual normals""" bl_label = "Extrude and Move on Individual Normals" bl_idname = "view3d.edit_mesh_extrude_move_shrink_fatten" @@ -128,7 +128,7 @@ class VIEW3D_OT_edit_mesh_extrude_shrink_fatten(Operator): class VIEW3D_OT_select_or_deselect_all(Operator): -"Select element under the mouse, deselect everything is there's nothing under the mouse" +"""Select element under the mouse, deselect everything is there's nothing under the mouse""" bl_label = "Select or Deselect All" bl_idname = "view3d.select_or_deselect_all" bl_options = {'UNDO'} @@ -220,4 +220,4 @@ classes = ( VIEW3D_OT_edit_mesh_extrude_move, VIEW3D_OT_edit_mesh_extrude_shrink_fatten, VIEW3D_OT_select_or_deselect_all, -) \ No newline at end of file +) diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index 86c58fffd73..20586b727d5 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@
[Bf-blender-cvs] [6a8a6790372] master: BLF: avoid glyph cache use-after free
Commit: 6a8a67903729d0e8bb44e15547f827b2b5638ba5 Author: Campbell Barton Date: Fri Apr 14 19:52:29 2017 +1000 Branches: master https://developer.blender.org/rB6a8a67903729d0e8bb44e15547f827b2b5638ba5 BLF: avoid glyph cache use-after free Causes crash if the font size isn't set after clearing (see T51200) === M source/blender/blenfont/intern/blf_glyph.c === diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c index aa7d539538b..bbbabfb8ba2 100644 --- a/source/blender/blenfont/intern/blf_glyph.c +++ b/source/blender/blenfont/intern/blf_glyph.c @@ -135,6 +135,7 @@ void blf_glyph_cache_clear(FontBLF *font) while ((gc = BLI_pophead(>cache))) { blf_glyph_cache_free(gc); } + font->glyph_cache = NULL; } void blf_glyph_cache_free(GlyphCacheBLF *gc) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [63822449f98] workspaces: Merge branch '28' into workspaces
Commit: 63822449f987c9a7838249338cc375cd4d51a2c4 Author: Campbell Barton Date: Fri Apr 14 18:32:43 2017 +1000 Branches: workspaces https://developer.blender.org/rB63822449f987c9a7838249338cc375cd4d51a2c4 Merge branch '28' into workspaces === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [7cfabcef5c8] master: Buildbot: Fix typos
Commit: 7cfabcef5c8f29246bfbedac663b6ed0baa8a64f Author: Sergey Sharybin Date: Fri Apr 14 10:03:30 2017 +0200 Branches: master https://developer.blender.org/rB7cfabcef5c8f29246bfbedac663b6ed0baa8a64f Buildbot: Fix typos === M build_files/buildbot/slave_compile.py === diff --git a/build_files/buildbot/slave_compile.py b/build_files/buildbot/slave_compile.py index 9b14bba87fe..0e264a752d5 100644 --- a/build_files/buildbot/slave_compile.py +++ b/build_files/buildbot/slave_compile.py @@ -74,7 +74,7 @@ if 'cmake' in builder: cmake_extra_options.append('-DCMAKE_OSX_ARCHITECTURES:STRING=x86_64') cmake_extra_options.append('-DWITH_CODEC_QUICKTIME=OFF') cmake_extra_options.append('-DCMAKE_OSX_DEPLOYMENT_TARGET=10.6') - cmake_extra_options.append('CUDA_HOST_COMPILER=/usr/local/cuda-hack/clang') + cmake_extra_options.append('-DCUDA_HOST_COMPILER=/usr/local/cuda-hack/clang') cmake_extra_options.append('-DCUDA_NVCC_EXECUTABLE=/usr/local/cuda-hack/nvcc') @@ -180,7 +180,7 @@ if 'cmake' in builder: os.remove('CMakeCache.txt') retcode = subprocess.call(target_chroot_prefix + ['cmake', blender_dir] + target_cmake_options) if retcode != 0: -print('Condifuration FAILED!') +print('Configuration FAILED!') sys.exit(retcode) if 'win32' in builder or 'win64' in builder: ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [b354c158051] master: Buildbot: Attempt to fix CUDA compilation on OSX
Commit: b354c15805199a1bf841d3100edd8071583fbeba Author: Sergey Sharybin Date: Fri Apr 14 10:01:28 2017 +0200 Branches: master https://developer.blender.org/rBb354c15805199a1bf841d3100edd8071583fbeba Buildbot: Attempt to fix CUDA compilation on OSX Stupid toolkit is really fragile about CLang version. === M build_files/buildbot/slave_compile.py === diff --git a/build_files/buildbot/slave_compile.py b/build_files/buildbot/slave_compile.py index 4fb05c9f977..9b14bba87fe 100644 --- a/build_files/buildbot/slave_compile.py +++ b/build_files/buildbot/slave_compile.py @@ -74,6 +74,9 @@ if 'cmake' in builder: cmake_extra_options.append('-DCMAKE_OSX_ARCHITECTURES:STRING=x86_64') cmake_extra_options.append('-DWITH_CODEC_QUICKTIME=OFF') cmake_extra_options.append('-DCMAKE_OSX_DEPLOYMENT_TARGET=10.6') + cmake_extra_options.append('CUDA_HOST_COMPILER=/usr/local/cuda-hack/clang') + cmake_extra_options.append('-DCUDA_NVCC_EXECUTABLE=/usr/local/cuda-hack/nvcc') + elif builder.startswith('win'): ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [0393e6b08de] custom-manipulators: Merge branch 'blender2.8' into custom-manipulators
Commit: 0393e6b08dead096ef47a87d2c2fe5bed9cb8d44 Author: Campbell Barton Date: Fri Apr 14 17:21:26 2017 +1000 Branches: custom-manipulators https://developer.blender.org/rB0393e6b08dead096ef47a87d2c2fe5bed9cb8d44 Merge branch 'blender2.8' into custom-manipulators === === diff --cc source/blender/blenkernel/intern/library_query.c index f136ae484a7,c6cb336382e..3732c0d92c8 --- a/source/blender/blenkernel/intern/library_query.c +++ b/source/blender/blenkernel/intern/library_query.c @@@ -535,7 -585,7 +585,8 @@@ void BKE_library_foreach_ID_link(Main * data.cb_flag |= proxy_cb_flag; for (pchan = object->pose->chanbase.first; pchan; pchan = pchan->next) { + library_foreach_idproperty_ID_link(, pchan->prop, IDWALK_CB_USER); + CALLBACK_INVOKE(pchan->fmap_object, IDWALK_CB_USER); CALLBACK_INVOKE(pchan->custom, IDWALK_CB_USER); BKE_constraints_id_loop(>constraints, library_foreach_constraintObjectLooper, ); } diff --cc source/blender/blenloader/intern/readfile.c index 05ae43225c4,a1718b5d84d..df9b40fbad8 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@@ -3296,14 -3314,8 +3315,16 @@@ static void lib_link_pose(FileData *fd pchan->bone = BLI_ghash_lookup(bone_hash, pchan->name); + IDP_LibLinkProperty(pchan->prop, fd); + + pchan->fmap_object = newlibadr_us(fd, arm->id.lib, pchan->fmap_object); + if (pchan->fmap_object) { + bFaceMap *fmap = fmap_find_name(pchan->fmap_object, pchan->fmap->name); + /* fix fmap pointer now that we've got updated fmap_object */ + MEM_freeN(pchan->fmap); + pchan->fmap = fmap; + } + pchan->custom = newlibadr_us(fd, arm->id.lib, pchan->custom); if (UNLIKELY(pchan->bone == NULL)) { rebuild = true; @@@ -9446,7 -9499,7 +9510,8 @@@ static void expand_pose(FileData *fd, M for (chan = pose->chanbase.first; chan; chan = chan->next) { expand_constraints(fd, mainvar, >constraints); + expand_idprops(fd, mainvar, chan->prop); + expand_doit(fd, mainvar, chan->fmap_object); expand_doit(fd, mainvar, chan->custom); } } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs