[Bf-blender-cvs] [f017fdecefc] master: ViewLayer: Reduce object duplication syncing
Commit: f017fdecefc41ffe796ccfe9a1cb05772a7ad315 Author: Monique Dewanchand Date: Thu Oct 20 16:14:03 2022 +0200 Branches: master https://developer.blender.org/rBf017fdecefc41ffe796ccfe9a1cb05772a7ad315 ViewLayer: Reduce object duplication syncing During object duplication the syncing is temporarily disabled. With {D15885} this isn't useful as when disabled the view_layer is still accessed to locate bases. This can be improved by first locating the source bases, then duplicate and sync and locate the new bases. This patch removes the resync forbid and improve the times that resyncing actually must happen. Reviewed By: mont29 Maniphest Tasks: T73411 Differential Revision: https://developer.blender.org/D15886 === M source/blender/editors/object/object_add.cc === diff --git a/source/blender/editors/object/object_add.cc b/source/blender/editors/object/object_add.cc index 3ce39b695e0..f6eee7c0c9e 100644 --- a/source/blender/editors/object/object_add.cc +++ b/source/blender/editors/object/object_add.cc @@ -3556,11 +3556,62 @@ void OBJECT_OT_convert(wmOperatorType *ot) /** \name Duplicate Object Operator * \{ */ +static void object_add_sync_base_collection( +Main *bmain, Scene *scene, ViewLayer *view_layer, Base *base_src, Object *object_new) +{ + if ((base_src != nullptr) && (base_src->flag & BASE_ENABLED_AND_MAYBE_VISIBLE_IN_VIEWPORT)) { +BKE_collection_object_add_from(bmain, scene, base_src->object, object_new); + } + else { +LayerCollection *layer_collection = BKE_layer_collection_get_active(view_layer); +BKE_collection_object_add(bmain, layer_collection->collection, object_new); + } +} + +static void object_add_sync_local_view(Base *base_src, Base *base_new) +{ + base_new->local_view_bits = base_src->local_view_bits; +} + +static void object_add_sync_rigid_body(Main *bmain, Object *object_src, Object *object_new) +{ + /* 1) duplis should end up in same collection as the original + * 2) Rigid Body sim participants MUST always be part of a collection... + */ + /* XXX: is 2) really a good measure here? */ + if (object_src->rigidbody_object || object_src->rigidbody_constraint) { +LISTBASE_FOREACH (Collection *, collection, >collections) { + if (BKE_collection_has_object(collection, object_src)) { +BKE_collection_object_add(bmain, collection, object_new); + } +} + } +} + /** * - Assumes `id.new` is correct. * - Leaves selection of base/object unaltered. * - Sets #ID.newid pointers. */ +static void object_add_duplicate_internal(Main *bmain, + Object *ob, + const eDupli_ID_Flags dupflag, + const eLibIDDuplicateFlags duplicate_options, + Object **r_ob_new) +{ + if (ob->mode & OB_MODE_POSE) { +return; + } + + Object *obn = static_cast( + ID_NEW_SET(ob, BKE_object_duplicate(bmain, ob, dupflag, duplicate_options))); + if (r_ob_new) { +*r_ob_new = obn; + } + DEG_id_tag_update(>id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY); + return; +} + static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, ViewLayer *view_layer, @@ -3569,49 +3620,25 @@ static Base *object_add_duplicate_internal(Main *bmain, const eLibIDDuplicateFlags duplicate_options, Object **r_ob_new) { - Base *base, *basen = nullptr; - Object *obn; - - if (ob->mode & OB_MODE_POSE) { -/* nothing? */ + Object *object_new = nullptr; + object_add_duplicate_internal(bmain, ob, dupflag, duplicate_options, _new); + if (r_ob_new) { +*r_ob_new = object_new; + } + if (object_new == nullptr) { +return nullptr; } - else { -obn = static_cast( -ID_NEW_SET(ob, BKE_object_duplicate(bmain, ob, dupflag, duplicate_options))); -if (r_ob_new) { - *r_ob_new = obn; -} -DEG_id_tag_update(>id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY); - -BKE_view_layer_synced_ensure(scene, view_layer); -base = BKE_view_layer_base_find(view_layer, ob); -if ((base != nullptr) && (base->flag & BASE_ENABLED_AND_MAYBE_VISIBLE_IN_VIEWPORT)) { - BKE_collection_object_add_from(bmain, scene, ob, obn); -} -else { - LayerCollection *layer_collection = BKE_layer_collection_get_active(view_layer); - BKE_collection_object_add(bmain, layer_collection->collection, obn); -} - -BKE_view_layer_synced_ensure(scene, view_layer); -basen = BKE_view_layer_base_find(view_layer, obn); -if (base != nullptr && basen != nullptr) { - basen->loca
[Bf-blender-cvs] [4c320e2639e] master: Fix T101394: Ensure all viewlayers on scene copy.
Commit: 4c320e2639ef41f093a71f6843b40ab64bdd021b Author: Monique Dewanchand Date: Sun Oct 16 11:16:07 2022 +0200 Branches: master https://developer.blender.org/rB4c320e2639ef41f093a71f6843b40ab64bdd021b Fix T101394: Ensure all viewlayers on scene copy. When a scene copy is called, all viewlayers are ensured before they are copied. In case of multiple viewlayers, a viewlayer can be out of sync. This triggers an assert in the BKE_view_layer_copy_data. Reviewed By: mont29 Maniphest Tasks: T101394 Differential Revision: https://developer.blender.org/D16214 === M source/blender/blenkernel/intern/scene.cc === diff --git a/source/blender/blenkernel/intern/scene.cc b/source/blender/blenkernel/intern/scene.cc index fc47fb71bf3..bd26075f81f 100644 --- a/source/blender/blenkernel/intern/scene.cc +++ b/source/blender/blenkernel/intern/scene.cc @@ -280,6 +280,9 @@ static void scene_copy_data(Main *bmain, ID *id_dst, const ID *id_src, const int } /* View Layers */ + LISTBASE_FOREACH (ViewLayer *, view_layer, _src->view_layers) { +BKE_view_layer_synced_ensure(scene_src, view_layer); + } BLI_duplicatelist(_dst->view_layers, _src->view_layers); for (ViewLayer *view_layer_src = static_cast(scene_src->view_layers.first), *view_layer_dst = static_cast(scene_dst->view_layers.first); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [68589a31ebf] master: ViewLayer: Lazy sync of scene data.
Commit: 68589a31ebfb79165f99a979357d237e5413e904 Author: Monique Dewanchand Date: Wed Sep 14 21:33:51 2022 +0200 Branches: master https://developer.blender.org/rB68589a31ebfb79165f99a979357d237e5413e904 ViewLayer: Lazy sync of scene data. When a change happens which invalidates view layers the syncing will be postponed until the first usage. This will improve importing or adding many objects in a single operation/script. `BKE_view_layer_need_resync_tag` is used to tag the view layer to be out of sync. Before accessing `BKE_view_layer_active_base_get`, `BKE_view_layer_active_object_get`, `BKE_view_layer_active_collection` or `BKE_view_layer_object_bases` the caller should call `BKE_view_layer_synced_ensure`. Having two functions ensures that partial syncing could be added as smaller patches in the future. Tagging a view layer out of sync could be replaced with a partial sync. Eventually the number of full resyncs could be reduced. After all tagging has been replaced with partial syncs the ensure_sync could be phased out. This patch has been added to discuss the details and consequences of the current approach. For clarity the call to BKE_view_layer_ensure_sync is placed close to the getters. In the future this could be placed in more strategical places to reduce the number of calls or improve performance. Finding those strategical places isn't that clear. When multiple operations are grouped in a single script you might want to always check for resync. Some areas found that can be improved. This list isn't complete. These areas aren't addressed by this patch as these changes would be hard to detect to the reviewer. The idea is to add changes to these areas as a separate patch. It might be that the initial commit would reduce performance compared to master, but will be fixed by the additional patches. **Object duplication** During object duplication the syncing is temporarily disabled. With this patch this isn't useful as when disabled the view_layer is accessed to locate bases. This can be improved by first locating the source bases, then duplicate and sync and locate the new bases. Will be solved in a separate patch for clarity reasons ({D15886}). **Object add** `BKE_object_add` not only adds a new object, but also selects and activates the new base. This requires the view_layer to be resynced. Some callers reverse the selection and activation (See `get_new_constraint_target`). We should make the selection and activation optional. This would make it possible to add multiple objects without having to resync per object. **Postpone Activate Base** Setting the basact is done in many locations. They follow a rule as after an action find the base and set the basact. Finding the base could require a resync. The idea is to store in the view_layer the object which base will be set in the basact during the next sync, reducing the times resyncing needs to happen. Reviewed By: mont29 Maniphest Tasks: T73411 Differential Revision: https://developer.blender.org/D15885 === M source/blender/blenkernel/BKE_collision.h M source/blender/blenkernel/BKE_layer.h M source/blender/blenkernel/BKE_object.h M source/blender/blenkernel/intern/DerivedMesh.cc M source/blender/blenkernel/intern/blendfile_link_append.c M source/blender/blenkernel/intern/collection.c M source/blender/blenkernel/intern/context.c M source/blender/blenkernel/intern/fluid.c M source/blender/blenkernel/intern/layer.c M source/blender/blenkernel/intern/layer_utils.c M source/blender/blenkernel/intern/lib_override.cc M source/blender/blenkernel/intern/mball.cc M source/blender/blenkernel/intern/object.cc M source/blender/blenkernel/intern/paint.cc M source/blender/blenkernel/intern/particle.c M source/blender/blenkernel/intern/rigidbody.c M source/blender/blenkernel/intern/scene.cc M source/blender/blenloader/intern/versioning_280.c M source/blender/blenloader/tests/blendfile_loading_base_test.cc M source/blender/depsgraph/intern/builder/deg_builder_nodes.cc M source/blender/depsgraph/intern/builder/deg_builder_nodes_view_layer.cc M source/blender/depsgraph/intern/builder/deg_builder_relations.cc M source/blender/depsgraph/intern/builder/deg_builder_relations_view_layer.cc M source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc M source/blender/draw/engines/overlay/overlay_extra.c M source/blender/draw/intern/draw_common.c M source/blender/draw/intern/draw_manager.c M source/blender/editors/animation/anim_channels_edit.c M source/blender/editors/animation/anim_filter.c M source/blender/editors/animation/anim_markers.c M source/blender/editors/armature/armature_select.c M source/blender/editors/armature/editarmature_undo.c M source/blender/editors/armature
[Bf-blender-cvs] [23276bcc37a] master: Adding `const Scene*` parameter in many areas.
Commit: 23276bcc37acc54f1e1814abdf482a432523c3a6 Author: Monique Dewanchand Date: Wed Sep 14 21:30:20 2022 +0200 Branches: master https://developer.blender.org/rB23276bcc37acc54f1e1814abdf482a432523c3a6 Adding `const Scene*` parameter in many areas. Related to {D15885} that requires scene parameter to be added in many places. To speed up the review process the adding of the scene parameter was added in a separate patch. Reviewed By: mont29 Maniphest Tasks: T73411 Differential Revision: https://developer.blender.org/D15930 === M source/blender/blenkernel/BKE_collection.h M source/blender/blenkernel/BKE_effect.h M source/blender/blenkernel/BKE_layer.h M source/blender/blenkernel/BKE_object.h M source/blender/blenkernel/BKE_scene.h M source/blender/blenkernel/intern/blender_copybuffer.c M source/blender/blenkernel/intern/collection.c M source/blender/blenkernel/intern/collision.c M source/blender/blenkernel/intern/effect.c M source/blender/blenkernel/intern/layer.c M source/blender/blenkernel/intern/layer_utils.c M source/blender/blenkernel/intern/object.cc M source/blender/blenkernel/intern/scene.cc M source/blender/depsgraph/intern/depsgraph_physics.cc M source/blender/draw/engines/overlay/overlay_edit_uv.c M source/blender/draw/intern/draw_manager.c M source/blender/editors/animation/anim_markers.c M source/blender/editors/armature/armature_add.c M source/blender/editors/armature/armature_edit.c M source/blender/editors/armature/armature_naming.c M source/blender/editors/armature/armature_relations.c M source/blender/editors/armature/armature_select.c M source/blender/editors/armature/editarmature_undo.c M source/blender/editors/armature/pose_edit.c M source/blender/editors/armature/pose_select.c M source/blender/editors/armature/pose_slide.c M source/blender/editors/armature/pose_transform.c M source/blender/editors/armature/pose_utils.c M source/blender/editors/curve/editcurve.c M source/blender/editors/curve/editcurve_query.c M source/blender/editors/curve/editcurve_select.c M source/blender/editors/curve/editcurve_undo.c M source/blender/editors/curve/editfont.c M source/blender/editors/curves/intern/curves_ops.cc M source/blender/editors/gpencil/gpencil_mesh.cc M source/blender/editors/gpencil/gpencil_ops_versioning.c M source/blender/editors/gpencil/gpencil_trace_ops.c M source/blender/editors/include/ED_armature.h M source/blender/editors/include/ED_object.h M source/blender/editors/include/ED_transform.h M source/blender/editors/include/ED_undo.h M source/blender/editors/interface/interface_ops.cc M source/blender/editors/lattice/editlattice_select.c M source/blender/editors/lattice/editlattice_tools.c M source/blender/editors/lattice/editlattice_undo.c M source/blender/editors/mesh/editmesh_bevel.c M source/blender/editors/mesh/editmesh_bisect.c M source/blender/editors/mesh/editmesh_extrude.c M source/blender/editors/mesh/editmesh_extrude_screw.c M source/blender/editors/mesh/editmesh_extrude_spin.c M source/blender/editors/mesh/editmesh_inset.c M source/blender/editors/mesh/editmesh_intersect.c M source/blender/editors/mesh/editmesh_knife.c M source/blender/editors/mesh/editmesh_knife_project.c M source/blender/editors/mesh/editmesh_loopcut.c M source/blender/editors/mesh/editmesh_path.c M source/blender/editors/mesh/editmesh_polybuild.c M source/blender/editors/mesh/editmesh_rip.c M source/blender/editors/mesh/editmesh_rip_edge.c M source/blender/editors/mesh/editmesh_select.c M source/blender/editors/mesh/editmesh_select_similar.c M source/blender/editors/mesh/editmesh_tools.c M source/blender/editors/mesh/editmesh_undo.c M source/blender/editors/mesh/editmesh_utils.c M source/blender/editors/mesh/mesh_intern.h M source/blender/editors/metaball/editmball_undo.c M source/blender/editors/metaball/mball_edit.c M source/blender/editors/object/object_add.cc M source/blender/editors/object/object_constraint.c M source/blender/editors/object/object_edit.c M source/blender/editors/object/object_hook.c M source/blender/editors/object/object_modes.c M source/blender/editors/object/object_modifier.cc M source/blender/editors/object/object_random.c M source/blender/editors/object/object_relations.c M source/blender/editors/object/object_select.c M source/blender/editors/object/object_transform.cc M source/blender/editors/object/object_utils.c M source/blender/editors/render/render_preview.cc M source/blender/editors/screen/area.c M source/blender/editors
[Bf-blender-cvs] [17501c146ed] master: Cleanup: Remove/replace View Layer macros.
Commit: 17501c146edc4af8a5e04565dc4d0b30ed5c5323 Author: Monique Dewanchand Date: Thu Sep 1 10:00:53 2022 +0200 Branches: master https://developer.blender.org/rB17501c146edc4af8a5e04565dc4d0b30ed5c5323 Cleanup: Remove/replace View Layer macros. This patch is a cleanup required before refactoring the view layer syncing process {T73411}. * Remove FIRSTBASE. * Remove LASTBASE. * Remove BASACT. * Remove OBEDIT_FROM_WORKSPACE. * Replace OBACT with BKE_view_layer_active_object. * Replace OBEDIT_FROM_VIEW_LAYER with BKE_view_layer_edit_object. Reviewed By: mont29 Maniphest Tasks: T73411 Differential Revision: https://developer.blender.org/D15799 === M source/blender/blenkernel/BKE_layer.h M source/blender/blenkernel/intern/collection.c M source/blender/blenkernel/intern/fluid.c M source/blender/blenkernel/intern/layer_utils.c M source/blender/blenkernel/intern/lib_override.cc M source/blender/blenkernel/intern/object.cc M source/blender/blenkernel/intern/scene.cc M source/blender/draw/engines/overlay/overlay_extra.c M source/blender/draw/intern/DRW_render.h M source/blender/draw/intern/draw_manager.c M source/blender/editors/animation/anim_filter.c M source/blender/editors/armature/editarmature_undo.c M source/blender/editors/armature/pose_select.c M source/blender/editors/curve/editcurve_add.c M source/blender/editors/curve/editcurve_undo.c M source/blender/editors/curve/editfont_undo.c M source/blender/editors/interface/interface_ops.cc M source/blender/editors/lattice/editlattice_undo.c M source/blender/editors/mesh/editmesh_path.c M source/blender/editors/mesh/editmesh_undo.c M source/blender/editors/metaball/editmball_undo.c M source/blender/editors/object/object_add.cc M source/blender/editors/object/object_collection.c M source/blender/editors/object/object_constraint.c M source/blender/editors/object/object_edit.c M source/blender/editors/object/object_modes.c M source/blender/editors/object/object_modifier.cc M source/blender/editors/object/object_relations.c M source/blender/editors/object/object_select.c M source/blender/editors/physics/particle_edit.c M source/blender/editors/physics/particle_edit_undo.c M source/blender/editors/physics/rigidbody_constraint.c M source/blender/editors/screen/screen_context.c M source/blender/editors/screen/screen_edit.c M source/blender/editors/sculpt_paint/paint_image_ops_paint.cc M source/blender/editors/sculpt_paint/paint_image_proj.c M source/blender/editors/sculpt_paint/paint_utils.c M source/blender/editors/sculpt_paint/sculpt_ops.c M source/blender/editors/sculpt_paint/sculpt_undo.c M source/blender/editors/space_buttons/buttons_context.c M source/blender/editors/space_buttons/buttons_texture.c M source/blender/editors/space_clip/tracking_ops_orient.c M source/blender/editors/space_image/image_edit.c M source/blender/editors/space_image/space_image.c M source/blender/editors/space_info/info_stats.cc M source/blender/editors/space_outliner/outliner_collections.cc M source/blender/editors/space_outliner/outliner_edit.cc M source/blender/editors/space_outliner/outliner_intern.hh M source/blender/editors/space_outliner/outliner_select.cc M source/blender/editors/space_outliner/outliner_sync.cc M source/blender/editors/space_outliner/outliner_tools.cc M source/blender/editors/space_outliner/outliner_tree.cc M source/blender/editors/space_outliner/outliner_utils.cc M source/blender/editors/space_view3d/space_view3d.c M source/blender/editors/space_view3d/view3d_buttons.c M source/blender/editors/space_view3d/view3d_cursor_snap.c M source/blender/editors/space_view3d/view3d_draw.c M source/blender/editors/space_view3d/view3d_gizmo_armature.c M source/blender/editors/space_view3d/view3d_gizmo_camera.c M source/blender/editors/space_view3d/view3d_gizmo_empty.c M source/blender/editors/space_view3d/view3d_gizmo_forcefield.c M source/blender/editors/space_view3d/view3d_gizmo_light.c M source/blender/editors/space_view3d/view3d_gizmo_ruler.c M source/blender/editors/space_view3d/view3d_header.c M source/blender/editors/space_view3d/view3d_navigate.c M source/blender/editors/space_view3d/view3d_select.cc M source/blender/editors/space_view3d/view3d_view.c M source/blender/editors/transform/transform.c M source/blender/editors/transform/transform_convert.c M source/blender/editors/transform/transform_convert_action.c M source/blender/editors/transform/transform_convert_gpencil.c M source/blender/editors/transform/transform_convert_graph.c M source/blender/editors/transform
[Bf-blender-cvs] [e62a33e5725] master: Nodes: Show node description in Node add menu
Commit: e62a33e57256cb772e6dfce9ba7a3a58c3c08b0a Author: Monique Dewanchand Date: Tue Jun 7 15:40:20 2022 +0200 Branches: master https://developer.blender.org/rBe62a33e57256cb772e6dfce9ba7a3a58c3c08b0a Nodes: Show node description in Node add menu Though no nodes have descriptions currently, this patch makes it possible to add descriptions that display in the add menu, for custom node systems and existing builtin nodes. Differential Revision: https://developer.blender.org/D14963 === M release/scripts/startup/bl_operators/node.py === diff --git a/release/scripts/startup/bl_operators/node.py b/release/scripts/startup/bl_operators/node.py index c64898fdfb9..a99a81e0c63 100644 --- a/release/scripts/startup/bl_operators/node.py +++ b/release/scripts/startup/bl_operators/node.py @@ -129,6 +129,15 @@ class NodeAddOperator: return result +@classmethod +def description(cls, context, properties): +nodetype = properties["type"] +bl_rna = bpy.types.Node.bl_rna_get_subclass(nodetype) +if bl_rna is not None: +return bl_rna.description +else: +return "" + # Simple basic operator for adding a node class NODE_OT_add_node(NodeAddOperator, Operator): ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [c751d40e070] master: Cleanup hardcoded render percentage to factor conversion
Commit: c751d40e070c6df907a526d7e3e17fc10611191e Author: Monique Dewanchand Date: Mon Nov 30 07:55:30 2020 +0100 Branches: master https://developer.blender.org/rBc751d40e070c6df907a526d7e3e17fc10611191e Cleanup hardcoded render percentage to factor conversion During revision of {D8952} one of the comments was to make a function that converts the render percentage to a factor. This to avoid code duplication. However the duplicated code was already all over the compositor code. So in order to avoid this code duplication for {D8952} I propose to first cleanup the duplicated code and build patch {D8952} based on this clean up. The method that converts the render percentage to a factor is put in the CompositorContext. Why? The CompositorContext keeps DNA information like the renderdata. DNA, and thus the CompositorContext, keeps the size of the render resolution in percentage (user oriented). The compositor needs the size of the render resolution as a factor. So the CompositorContext seems like the obvious place to have this conversion method. Why not in de NodeBase? The method could've been added to the nodebase, but I wanted to keep the nodebase as clean as possible and not put simple "conversion" methods into this base class. Also I didn't really like the call flow: you'd always have to get the renderdata size from the context and then convert. Putting it in the CompositorContext avoids this extra invoke of a call. Why not in the Converter? See nodebase. And the Converter seems more like a class for "structural" and complex node tree conversions. Not the simple conversions. Reviewed By: Sergey Sharybin Differential Revision: https://developer.blender.org/D9566 === M release/datafiles/locale M release/scripts/addons M source/blender/compositor/intern/COM_CompositorContext.h M source/blender/compositor/nodes/COM_BoxMaskNode.cpp M source/blender/compositor/nodes/COM_EllipseMaskNode.cpp M source/blender/compositor/nodes/COM_MaskNode.cpp M source/blender/compositor/nodes/COM_ScaleNode.cpp M source/blender/compositor/nodes/COM_TranslateNode.cpp M source/tools === diff --git a/release/datafiles/locale b/release/datafiles/locale index 848613f1edf..ae7e6c215c9 16 --- a/release/datafiles/locale +++ b/release/datafiles/locale @@ -1 +1 @@ -Subproject commit 848613f1edf09495bb764144461730662ac0b061 +Subproject commit ae7e6c215c9fc715cdedbc1c1e33e946fc90b496 diff --git a/release/scripts/addons b/release/scripts/addons index 35c23b4db49..866dcad5aa6 16 --- a/release/scripts/addons +++ b/release/scripts/addons @@ -1 +1 @@ -Subproject commit 35c23b4db494e58538a677c4fb0ec9ec1e8ffaa8 +Subproject commit 866dcad5aa6e45737f0634b835adcbc0871201e5 diff --git a/source/blender/compositor/intern/COM_CompositorContext.h b/source/blender/compositor/intern/COM_CompositorContext.h index e29a8f67187..46cf65bbb79 100644 --- a/source/blender/compositor/intern/COM_CompositorContext.h +++ b/source/blender/compositor/intern/COM_CompositorContext.h @@ -267,4 +267,13 @@ class CompositorContext { { return (this->getbNodeTree()->flag & NTREE_COM_GROUPNODE_BUFFER) != 0; } + + /** + * \brief Get the render percentage as a factor. + * The compositor uses a factor i.o. a percentage. + */ + float getRenderPercentageAsFactor() const + { +return m_rd->size * 0.01f; + } }; diff --git a/source/blender/compositor/nodes/COM_BoxMaskNode.cpp b/source/blender/compositor/nodes/COM_BoxMaskNode.cpp index ef62536595c..fe59bd32939 100644 --- a/source/blender/compositor/nodes/COM_BoxMaskNode.cpp +++ b/source/blender/compositor/nodes/COM_BoxMaskNode.cpp @@ -52,13 +52,14 @@ void BoxMaskNode::convertToOperations(NodeConverter , /* Scale that image up to render resolution */ const RenderData *rd = context.getRenderData(); +const float render_size_factor = context.getRenderPercentageAsFactor(); ScaleFixedSizeOperation *scaleOperation = new ScaleFixedSizeOperation(); scaleOperation->setIsAspect(false); scaleOperation->setIsCrop(false); scaleOperation->setOffset(0.0f, 0.0f); -scaleOperation->setNewWidth(rd->xsch * rd->size / 100.0f); -scaleOperation->setNewHeight(rd->ysch * rd->size / 100.0f); +scaleOperation->setNewWidth(rd->xsch * render_size_factor); +scaleOperation->setNewHeight(rd->ysch * render_size_factor); scaleOperation->getInputSocket(0)->setResizeMode(COM_SC_NO_RESIZE); converter.addOperation(scaleOperation); diff --git a/source/blender/compositor/nodes/COM_EllipseMaskNode.cpp b/source/blender/compositor/nodes/COM_EllipseMaskNode.cpp index 30d00252b76..1ae855c0f1d 100644 --- a/source/blender/compositor/nodes/COM_EllipseMaskNode.cpp +++ b/source/blender/compositor/nodes/COM_Ell
[Bf-blender-cvs] [d9b9a46aa3b] master: Python: Enable MASS unit in FloatProperty
Commit: d9b9a46aa3b5d5fcbc14f0aa3fa052f8e4c00c3f Author: Monique Dewanchand Date: Fri Aug 31 15:00:38 2018 +0200 Branches: master https://developer.blender.org/rBd9b9a46aa3b5d5fcbc14f0aa3fa052f8e4c00c3f Python: Enable MASS unit in FloatProperty MASS unit was already implemented for the C api. Only making sure it is accessible in the python api. Also added 'CAMERA' to the documentation as a valid option. === M source/blender/makesrna/intern/rna_rna.c M source/blender/python/intern/bpy_props.c === diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index 7eb48272c56..b8a9e9f92cd 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -121,6 +121,7 @@ const EnumPropertyItem rna_enum_property_unit_items[] = { {PROP_UNIT_TIME, "TIME", 0, "Time", ""}, {PROP_UNIT_VELOCITY, "VELOCITY", 0, "Velocity", ""}, {PROP_UNIT_ACCELERATION, "ACCELERATION", 0, "Acceleration", ""}, + {PROP_UNIT_MASS, "MASS", 0, "Mass", ""}, {PROP_UNIT_CAMERA, "CAMERA", 0, "Camera", ""}, {0, NULL, 0, NULL, NULL} }; diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c index 9b74b551b20..0db2fc189c1 100644 --- a/source/blender/python/intern/bpy_props.c +++ b/source/blender/python/intern/bpy_props.c @@ -1904,7 +1904,7 @@ static void bpy_prop_callback_assign_enum(struct PropertyRNA *prop, PyObject *ge " :type description: string\n" \ #define BPY_PROPDEF_UNIT_DOC \ -" :arg unit: Enumerator in ['NONE', 'LENGTH', 'AREA', 'VOLUME', 'ROTATION', 'TIME', 'VELOCITY', 'ACCELERATION'].\n" \ +" :arg unit: Enumerator in ['NONE', 'LENGTH', 'AREA', 'VOLUME', 'ROTATION', 'TIME', 'VELOCITY', 'ACCELERATION', 'MASS', 'CAMERA'].\n" \ " :type unit: string\n" \ #define BPY_PROPDEF_NUM_MIN_DOC \ ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [d318324] compositor-2016: disable glsl, glew import different on mac. Check on viewer node do_output io active. First check bnode output buffer, can be null, prevent compo from crash
Commit: d318324526cae12416e24e1cb7c4bfa9e2941e90 Author: Monique Dewanchand Date: Thu Jun 2 23:09:53 2016 +0200 Branches: compositor-2016 https://developer.blender.org/rBd318324526cae12416e24e1cb7c4bfa9e2941e90 disable glsl, glew import different on mac. Check on viewer node do_output io active. First check bnode output buffer, can be null, prevent compo from crashing. === M source/blender/compositor/cmp/cmp_compositor.cpp M source/blender/compositor/cmp/cmp_unroll.cpp M source/blender/compositor/device/device_glsl_compiler.cpp M source/blender/compositor/device/device_glsl_compiler.hpp === diff --git a/source/blender/compositor/cmp/cmp_compositor.cpp b/source/blender/compositor/cmp/cmp_compositor.cpp index b4f5c7b..9333d52 100644 --- a/source/blender/compositor/cmp/cmp_compositor.cpp +++ b/source/blender/compositor/cmp/cmp_compositor.cpp @@ -64,7 +64,6 @@ void COM_execute(RenderData *rd, Scene *scene, bNodeTree *editingtree, int rende // UNROLL editingtree Compositor::Node* node = Compositor::unroll(editingtree, render_context); if (node != NULL) { - // ALLOCATE output Compositor::Output output(editingtree, node, rd, viewName, viewSettings, displaySettings); if (output.buffer == NULL) { diff --git a/source/blender/compositor/cmp/cmp_unroll.cpp b/source/blender/compositor/cmp/cmp_unroll.cpp index 14ab39e..c2e0e2f 100644 --- a/source/blender/compositor/cmp/cmp_unroll.cpp +++ b/source/blender/compositor/cmp/cmp_unroll.cpp @@ -6,7 +6,7 @@ namespace Compositor { static bNode* find_active_viewer_node(bNodeTree* node_tree) { for (bNode *node = (bNode *)node_tree->nodes.first; node; node = node->next) { - if (node->type == CMP_NODE_VIEWER && node->flag & NODE_ACTIVE) { + if (node->type == CMP_NODE_VIEWER && node->flag & NODE_DO_OUTPUT) { return node; } } diff --git a/source/blender/compositor/device/device_glsl_compiler.cpp b/source/blender/compositor/device/device_glsl_compiler.cpp index 469eca8..8c53f51 100644 --- a/source/blender/compositor/device/device_glsl_compiler.cpp +++ b/source/blender/compositor/device/device_glsl_compiler.cpp @@ -55,18 +55,18 @@ namespace Compositor { return source.str(); } -GLuint compile_vertex_shader(std::string vertex_source) { +//GLuint compile_vertex_shader(std::string vertex_source) { // std::cout << "version" << glGetString(GL_VERSION) << "\n"; - return 0; + //return 0; // GLuint shader = glCreateShader(GL_VERTEX_SHADER); // return shader; -} + // } -GLuint compile_fragment_shader(std::string vertex_source) { +//GLuint compile_fragment_shader(std::string vertex_source) { // std::cout << "version" << glGetString(GL_VERSION) << "\n"; - return 0; + // return 0; // GLuint shader = glCreateShader(GL_FRAGMENT_SHADER); // return shader; -} +//} } } diff --git a/source/blender/compositor/device/device_glsl_compiler.hpp b/source/blender/compositor/device/device_glsl_compiler.hpp index d72fc21..1b1a9cc 100644 --- a/source/blender/compositor/device/device_glsl_compiler.hpp +++ b/source/blender/compositor/device/device_glsl_compiler.hpp @@ -1,7 +1,7 @@ #ifndef CMP_DEVICE_DEVICE_GLSL_COMPILER_HPP #define CMP_DEVICE_DEVICE_GLSL_COMPILER_HPP -#include "GPU_glew.h" +//#include "GPU_glew.h" #include "cmp_node.hpp" #include @@ -10,8 +10,8 @@ namespace Compositor { std::string generate_glsl_vertex_source(Compositor::Node* node); std::string generate_glsl_fragment_source(Compositor::Node* node); -GLuint compile_vertex_shader(std::string vertex_source); -GLuint compile_fragment_shader(std::string vertex_source); +//GLuint compile_vertex_shader(std::string vertex_source); +//GLuint compile_fragment_shader(std::string vertex_source); } } #endif ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [79475ac] compositor-2016: only calculate active viewer nodes.
Commit: 79475ac1c4b678cf4d3e2a505994c2a6b666e471 Author: Monique Dewanchand Date: Thu Jun 2 22:20:31 2016 +0200 Branches: compositor-2016 https://developer.blender.org/rB79475ac1c4b678cf4d3e2a505994c2a6b666e471 only calculate active viewer nodes. === M source/blender/compositor/cmp/cmp_compositor.cpp M source/blender/compositor/cmp/cmp_unroll.cpp === diff --git a/source/blender/compositor/cmp/cmp_compositor.cpp b/source/blender/compositor/cmp/cmp_compositor.cpp index 8b37782..b4f5c7b 100644 --- a/source/blender/compositor/cmp/cmp_compositor.cpp +++ b/source/blender/compositor/cmp/cmp_compositor.cpp @@ -12,6 +12,9 @@ extern "C" { #include "device.hpp" #include +#define FREE_OBJECTS delete render_context;\ +BLI_mutex_unlock(_compositorMutex); + static ThreadMutex s_compositorMutex; static bool is_compositorMutex_init = false; @@ -61,11 +64,16 @@ void COM_execute(RenderData *rd, Scene *scene, bNodeTree *editingtree, int rende // UNROLL editingtree Compositor::Node* node = Compositor::unroll(editingtree, render_context); if (node != NULL) { -// SELECT DEVICE -Compositor::Device::Device *device = Compositor::Device::Device::create_device(node); // ALLOCATE output Compositor::Output output(editingtree, node, rd, viewName, viewSettings, displaySettings); +if (output.buffer == NULL) { +FREE_OBJECTS +return; +} + +// SELECT DEVICE +Compositor::Device::Device *device = Compositor::Device::Device::create_device(node); // Generate Tiles Compositor::TileManager tile_manager(); @@ -89,8 +97,7 @@ void COM_execute(RenderData *rd, Scene *scene, bNodeTree *editingtree, int rende tile_manager.delete_tiles(tiles); } - delete render_context; - BLI_mutex_unlock(_compositorMutex); + FREE_OBJECTS } diff --git a/source/blender/compositor/cmp/cmp_unroll.cpp b/source/blender/compositor/cmp/cmp_unroll.cpp index 50ea143..14ab39e 100644 --- a/source/blender/compositor/cmp/cmp_unroll.cpp +++ b/source/blender/compositor/cmp/cmp_unroll.cpp @@ -6,12 +6,10 @@ namespace Compositor { static bNode* find_active_viewer_node(bNodeTree* node_tree) { for (bNode *node = (bNode *)node_tree->nodes.first; node; node = node->next) { - if (node->type == CMP_NODE_VIEWER) { -// TODO: Active node + if (node->type == CMP_NODE_VIEWER && node->flag & NODE_ACTIVE) { return node; - } +} } - return NULL; } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [84794b3] compositor-2016: Merge branch 'compositor-2016' of git.blender.org:blender into compositor-2016
Commit: 84794b3d5d55b12c71875d49681702f7f37a32d3 Author: Monique Dewanchand Date: Thu Jun 2 22:22:58 2016 +0200 Branches: compositor-2016 https://developer.blender.org/rB84794b3d5d55b12c71875d49681702f7f37a32d3 Merge branch 'compositor-2016' of git.blender.org:blender into compositor-2016 === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [55a56ec] compositor-2016: Implemented the hilbert spiral
Commit: 55a56ec058f0d1dc46b1e688034791a090ce4e44 Author: Monique Dewanchand Date: Wed Jun 1 22:11:58 2016 +0200 Branches: compositor-2016 https://developer.blender.org/rB55a56ec058f0d1dc46b1e688034791a090ce4e44 Implemented the hilbert spiral === M source/blender/compositor/cmp/cmp_tilemanager.cpp M source/blender/compositor/kernel/cvm/cvm_node_blur.h M source/blender/compositor/kernel/kernel_functions.h === diff --git a/source/blender/compositor/cmp/cmp_tilemanager.cpp b/source/blender/compositor/cmp/cmp_tilemanager.cpp index 79d90e2..fa2e837 100644 --- a/source/blender/compositor/cmp/cmp_tilemanager.cpp +++ b/source/blender/compositor/cmp/cmp_tilemanager.cpp @@ -30,7 +30,6 @@ namespace Compositor { DIRECTION_RIGHT, }; - TileManager::TileManager(Output* output) { this->output = output; } @@ -39,19 +38,89 @@ namespace Compositor { Node* node = output->node; const int width = output->width; const int height = output->height; -const int tile_size = output->node_tree->chunksize; -for (int x = 0 ; x <= width; x += tile_size) { - int x_max = x+tile_size; - if (x_max > width) x_max = width; - for (int y = 0;y <= height; y += tile_size) { -int y_max = y+tile_size; -if (y_max > height) y_max = height; +int2 tile_size = make_int2(output->node_tree->chunksize, output->node_tree->chunksize); +const int hilbert_size = (max(tile_size.x, tile_size.y) <= 12)? 8: 4; +int tile_w = (tile_size.x >= width)? 1: (width + tile_size.x - 1)/tile_size.x; +int tile_h = (tile_size.y >= height)? 1: (height + tile_size.y - 1)/tile_size.y; +int2 center = make_int2(width/2, height/2); +const int num = 1; // fixed number of devices. +int tile_per_device = (tile_w * tile_h + num -1) / num; -Compositor::Device::Task* task = new Compositor::Device::Task(node, x, y, x_max, y_max, this->output); -tiles.push_back(task); - } -} +int2 block_size = tile_size * make_int2(hilbert_size, hilbert_size); +/* Number of blocks to fill the image */ + int blocks_x = (block_size.x >= width)? 1: (width + block_size.x - 1)/block_size.x; + int blocks_y = (block_size.y >= height)? 1: (height + block_size.y - 1)/block_size.y; + int n = max(blocks_x, blocks_y) | 0x1; /* Side length of the spiral (must be odd) */ + /* Offset of spiral (to keep it centered) */ +int2 offset = make_int2((width - n*block_size.x)/2, (height - n*block_size.y)/2); + offset = (offset / tile_size) * tile_size; /* Round to tile border. */ + +int2 block = make_int2(0, 0); /* Current block */ +SpiralDirection prev_dir = DIRECTION_UP, dir = DIRECTION_UP; +for(int i = 0;;) { + /* Generate the tiles in the current block. */ + for(int hilbert_index = 0; hilbert_index < hilbert_size*hilbert_size; hilbert_index++) { + int2 tile, hilbert_pos = hilbert_index_to_pos(hilbert_size, hilbert_index); + /* Rotate block according to spiral direction. */ + if(prev_dir == DIRECTION_UP && dir == DIRECTION_UP) { + tile = make_int2(hilbert_pos.y, hilbert_pos.x); + } + else if(dir == DIRECTION_LEFT || prev_dir == DIRECTION_LEFT) { + tile = hilbert_pos; + } + else if(dir == DIRECTION_DOWN) { + tile = make_int2(hilbert_size-1-hilbert_pos.y, hilbert_size-1-hilbert_pos.x); + } + else { + tile = make_int2(hilbert_size-1-hilbert_pos.x, hilbert_size-1-hilbert_pos.y); + } + + int2 pos = block*block_size + tile*tile_size + offset; + /* Only add tiles which are in the image (tiles outside of the image can be generated since the spiral is always square). */ + if(pos.x >= 0 && pos.y >= 0 && pos.x < width && pos.y < height) { + int w = min(tile_size.x, width - pos.x); + int h = min(tile_size.y, height - pos.y); + + Compositor::Device::Task* task = new Compositor::Device::Task(node, pos.x, pos.y, pos.x+w, pos.y+h, this->output); + tiles.push_front(task); + } + } + + /* Stop as soon as th
[Bf-blender-cvs] [f4b3c92] blender-tiles: Merge branch 'master' into blender-tiles
Commit: f4b3c92716a8ad4aaaccd3a363619644ee064754 Author: Monique Dewanchand Date: Tue Jul 29 22:29:23 2014 +0200 Branches: blender-tiles https://developer.blender.org/rBf4b3c92716a8ad4aaaccd3a363619644ee064754 Merge branch 'master' into blender-tiles === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [49d1c8d] master: Fix issue for OPENCL problem on Macosx 10.9.2
Commit: 49d1c8d8c689c917fa3fd7d309861f419ddac373 Author: Monique Dewanchand Date: Sat Apr 5 21:33:44 2014 +0200 https://developer.blender.org/rB49d1c8d8c689c917fa3fd7d309861f419ddac373 Fix issue for OPENCL problem on Macosx 10.9.2 === M source/blender/compositor/intern/COM_OpenCLDevice.cpp === diff --git a/source/blender/compositor/intern/COM_OpenCLDevice.cpp b/source/blender/compositor/intern/COM_OpenCLDevice.cpp index bb60a62..30c1fb4 100644 --- a/source/blender/compositor/intern/COM_OpenCLDevice.cpp +++ b/source/blender/compositor/intern/COM_OpenCLDevice.cpp @@ -85,7 +85,7 @@ cl_mem OpenCLDevice::COM_clAttachMemoryBufferToKernelParameter(cl_kernel kernel, CL_FLOAT }; - cl_mem clBuffer = clCreateImage2D(this-m_context, CL_MEM_READ_ONLY | CL_MEM_USE_HOST_PTR, imageFormat, result-getWidth(), + cl_mem clBuffer = clCreateImage2D(this-m_context, CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR, imageFormat, result-getWidth(), result-getHeight(), 0, result-getBuffer(), error); if (error != CL_SUCCESS) { printf(CLERROR[%d]: %s\n, error, clewErrorString(error)); } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [7142b97] master: Make it possible to hide/unhide a node during node transform operations. During drag the H key can be used to toggle the hide flag of the selected nodes. This makes
Commit: 7142b970853f209f6c43319b7f862bcbdbea3728 Author: Monique Dewanchand Date: Sat Jan 18 18:20:21 2014 +0100 https://developer.blender.org/rB7142b970853f209f6c43319b7f862bcbdbea3728 Make it possible to hide/unhide a node during node transform operations. During drag the H key can be used to toggle the hide flag of the selected nodes. This makes it easier to 'attach' nodes to available links in narrow places. === M source/blender/editors/transform/transform.c M source/blender/editors/transform/transform.h M source/blender/editors/transform/transform_conversions.c === diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 68fe1c4..59cb050 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -1438,6 +1438,13 @@ int transformEvent(TransInfo *t, const wmEvent *event) handled = true; } break; + case HKEY: + if (t-spacetype == SPACE_NODE) { + t-flag ^= T_TOGGLE_HIDDEN; + t-redraw |= TREDRAW_HARD; + handled = true; + } + break; default: break; } diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index 1e70529..5df6952 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -424,6 +424,7 @@ typedef struct TransInfo { /* alternative transformation. used to add offset to tracking markers */ #define T_ALT_TRANSFORM(1 24) +#define T_TOGGLE_HIDDEN(1 25) /* node editor: toggle state of the hidden flags */ /* TransInfo-modifiers */ #defineMOD_CONSTRAINT_SELECT 0x01 @@ -472,6 +473,7 @@ typedef struct TransInfo { #define TD_MOVEHANDLE2 (1 18) #define TD_PBONE_LOCAL_MTX_P (1 19) /* exceptional case with pose bone rotating when a parent bone has 'Local Location' option enabled and rotating also transforms it. */ #define TD_PBONE_LOCAL_MTX_C (1 20) /* same as above but for a child bone */ +#define TD_HIDDEN (1 21) /* for hide toggling node editor */ /* transsnap-status */ #define SNAP_FORCED1 diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 8c3fa77..0eddb68 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -2375,6 +2375,7 @@ cleanup: void flushTransNodes(TransInfo *t) { const float dpi_fac = UI_DPI_FAC; + bool hidden_state; int a; TransData *td; TransData2D *td2d; @@ -2393,6 +2394,17 @@ void flushTransNodes(TransInfo *t) node-locx = td2d-loc[0] / dpi_fac; node-locy = td2d-loc[1] / dpi_fac; #endif + /* update node hidden state with transform data TD_HIDDEN + transformInfo T_TOGGLE_HIDDEN */ + hidden_state = (td-flag TD_HIDDEN) 0; + if (t-state != TRANS_CANCEL) { + hidden_state ^= (t-flag T_TOGGLE_HIDDEN) 0; + } + + if (hidden_state) { + node-flag |= NODE_HIDDEN; + } else { + node-flag = ~NODE_HIDDEN; + } } /* handle intersection with noodles */ @@ -5987,6 +5999,9 @@ static void NodeToTransData(TransData *td, TransData2D *td2d, bNode *node, const td-ext = NULL; td-val = NULL; td-flag |= TD_SELECTED; + if(node-flag NODE_HIDDEN){ + td-flag |= TD_HIDDEN; + } td-dist = 0.0; unit_m3(td-mtx); @@ -6021,6 +6036,8 @@ static void createTransNodeData(bContext *UNUSED(C), TransInfo *t) /* nodes dont support PET and probably never will */ t-flag = ~T_PROP_EDIT_ALL; + /* initial: do not toggle hidden */ + t-flag = ~T_TOGGLE_HIDDEN; /* set transform flags on nodes */ for (node = snode-edittree-nodes.first; node; node = node-next) { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [57297] trunk/blender/source/blender/ compositor/operations: Fix for bug [#35400] Dilate Erode Feather Bug - feathering wraps around image
Revision: 57297 http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=57297 Author: mdewanchand Date: 2013-06-08 19:56:11 + (Sat, 08 Jun 2013) Log Message: --- Fix for bug [#35400] Dilate Erode Feather Bug - feathering wraps around image Modified Paths: -- trunk/blender/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cpp trunk/blender/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.cpp trunk/blender/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp trunk/blender/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp Modified: trunk/blender/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cpp === --- trunk/blender/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cpp 2013-06-08 17:56:45 UTC (rev 57296) +++ trunk/blender/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cpp 2013-06-08 19:56:11 UTC (rev 57297) @@ -99,14 +99,13 @@ int bufferstarty = inputBuffer-getRect()-ymin; int miny = y; - // int maxy = y; // UNUSED int minx = x - this-m_rad; int maxx = x + this-m_rad; // UNUSED miny = max(miny, inputBuffer-getRect()-ymin); minx = max(minx, inputBuffer-getRect()-xmin); - // maxy = min(maxy, inputBuffer-getRect()-ymax); - maxx = min(maxx, inputBuffer-getRect()-xmax); +maxx = min(maxx, inputBuffer-getRect()-xmax -1); + /* *** this is the main part which is different to 'GaussianXBlurOperation' *** */ int step = getStep(); int offsetadd = getOffsetAdd(); Modified: trunk/blender/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.cpp === --- trunk/blender/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.cpp 2013-06-08 17:56:45 UTC (rev 57296) +++ trunk/blender/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.cpp 2013-06-08 19:56:11 UTC (rev 57297) @@ -101,11 +101,9 @@ int miny = y - this-m_rad; int maxy = y + this-m_rad; int minx = x; - // int maxx = x; // UNUSED miny = max(miny, inputBuffer-getRect()-ymin); minx = max(minx, inputBuffer-getRect()-xmin); maxy = min(maxy, inputBuffer-getRect()-ymax - 1); - // maxx = min(maxx, inputBuffer-getRect()-xmax); /* *** this is the main part which is different to 'GaussianYBlurOperation' *** */ int step = getStep(); Modified: trunk/blender/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp === --- trunk/blender/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp 2013-06-08 17:56:45 UTC (rev 57296) +++ trunk/blender/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp 2013-06-08 19:56:11 UTC (rev 57297) @@ -83,12 +83,10 @@ int bufferstarty = inputBuffer-getRect()-ymin; int miny = y; - // int maxy = y; // UNUSED int minx = x - this-m_rad; int maxx = x + this-m_rad; miny = max(miny, inputBuffer-getRect()-ymin); minx = max(minx, inputBuffer-getRect()-xmin); - // maxy = min(maxy, inputBuffer-getRect()-ymax); maxx = min(maxx, inputBuffer-getRect()-xmax - 1); int step = getStep(); Modified: trunk/blender/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp === --- trunk/blender/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp 2013-06-08 17:56:45 UTC (rev 57296) +++ trunk/blender/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp 2013-06-08 19:56:11 UTC (rev 57297) @@ -85,11 +85,9 @@ int miny = y - this-m_rad; int maxy = y + this-m_rad; int minx = x; - // int maxx = x; // UNUSED miny = max(miny, inputBuffer-getRect()-ymin); minx = max(minx, inputBuffer-getRect()-xmin); maxy = min(maxy, inputBuffer-getRect()-ymax - 1); - // maxx = min(maxx, inputBuffer-getRect()-xmax); int index; int step = getStep(); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54599] trunk/blender: Added option for group node buffering in the compositor.
Revision: 54599 http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=54599 Author: mdewanchand Date: 2013-02-16 20:21:41 + (Sat, 16 Feb 2013) Log Message: --- Added option for group node buffering in the compositor. Justa cluster did not have enough memory to handle all Mango 4k scenes. Option is default disabled and can be enabled in the performance panel. - At Mind - Modified Paths: -- trunk/blender/release/scripts/startup/bl_ui/space_node.py trunk/blender/source/blender/compositor/intern/COM_CompositorContext.h trunk/blender/source/blender/compositor/nodes/COM_GroupNode.cpp trunk/blender/source/blender/makesdna/DNA_node_types.h trunk/blender/source/blender/makesrna/intern/rna_nodetree.c Modified: trunk/blender/release/scripts/startup/bl_ui/space_node.py === --- trunk/blender/release/scripts/startup/bl_ui/space_node.py 2013-02-16 19:24:52 UTC (rev 54598) +++ trunk/blender/release/scripts/startup/bl_ui/space_node.py 2013-02-16 20:21:41 UTC (rev 54599) @@ -252,6 +252,7 @@ col = layout.column() col.prop(tree, use_opencl) +col.prop(tree, use_groupnode_buffer) col.prop(tree, two_pass) col.prop(snode, show_highlight) col.prop(snode, use_hidden_preview) Modified: trunk/blender/source/blender/compositor/intern/COM_CompositorContext.h === --- trunk/blender/source/blender/compositor/intern/COM_CompositorContext.h 2013-02-16 19:24:52 UTC (rev 54598) +++ trunk/blender/source/blender/compositor/intern/COM_CompositorContext.h 2013-02-16 20:21:41 UTC (rev 54599) @@ -74,7 +74,7 @@ * @brief does this system have active opencl devices? */ bool m_hasActiveOpenCLDevices; - + /** * @brief Skip slow nodes */ @@ -178,6 +178,7 @@ void setFastCalculation(bool fastCalculation) {this-m_fastCalculation = fastCalculation;} bool isFastCalculation() {return this-m_fastCalculation;} + inline bool isGroupnodeBufferEnabled() {return this-getbNodeTree()-flag NTREE_COM_GROUPNODE_BUFFER;} }; Modified: trunk/blender/source/blender/compositor/nodes/COM_GroupNode.cpp === --- trunk/blender/source/blender/compositor/nodes/COM_GroupNode.cpp 2013-02-16 19:24:52 UTC (rev 54598) +++ trunk/blender/source/blender/compositor/nodes/COM_GroupNode.cpp 2013-02-16 20:21:41 UTC (rev 54599) @@ -64,11 +64,12 @@ } } + const bool groupnodeBuffering = system.getContext().isGroupnodeBufferEnabled(); for (index = 0; index outputsockets.size(); index++) { OutputSocket *outputSocket = outputsockets[index]; bNodeSocket *editorOutput = outputSocket-getbNodeSocket(); if (editorOutput-groupsock) { - SocketProxyNode *proxy = new SocketProxyNode(bnode, editorOutput-groupsock, editorOutput, true); + SocketProxyNode *proxy = new SocketProxyNode(bnode, editorOutput-groupsock, editorOutput, groupnodeBuffering); outputSocket-relinkConnections(proxy-getOutputSocket(0)); ExecutionSystemHelper::addNode(system.getNodes(), proxy); } Modified: trunk/blender/source/blender/makesdna/DNA_node_types.h === --- trunk/blender/source/blender/makesdna/DNA_node_types.h 2013-02-16 19:24:52 UTC (rev 54598) +++ trunk/blender/source/blender/makesdna/DNA_node_types.h 2013-02-16 20:21:41 UTC (rev 54599) @@ -309,9 +309,11 @@ #define NTREE_TYPE_INIT1 /* ntree-flag */ -#define NTREE_DS_EXPAND1 /* for animation editors */ -#define NTREE_COM_OPENCL 2 /* use opencl */ -#define NTREE_TWO_PASS 4 /* two pass */ +#define NTREE_DS_EXPAND1 /* for animation editors */ +#define NTREE_COM_OPENCL 2 /* use opencl */ +#define NTREE_TWO_PASS 4 /* two pass */ +#define NTREE_COM_GROUPNODE_BUFFER 8 /* use groupnode buffers */ + /* XXX not nice, but needed as a temporary flags * for group updates after library linking. */ Modified: trunk/blender/source/blender/makesrna/intern/rna_nodetree.c === --- trunk/blender/source/blender/makesrna/intern/rna_nodetree.c 2013-02-16 19:24:52 UTC (rev 54598) +++ trunk/blender/source/blender/makesrna/intern/rna_nodetree.c 2013-02-16 20:21:41 UTC (rev 54599) @@ -4971,6 +4971,10 @@ RNA_def_property_boolean_sdna(prop, NULL, flag, NTREE_COM_OPENCL); RNA_def_property_ui_text(prop, OpenCL, Enable GPU
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54349] trunk/blender/source/blender: Code clean up translate node
. + * + * 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. + * + * Contributor: + * Jeroen Bakker + * Monique Dewanchand + * Thomas Beck (plasmasolutions.de) + */ + +#include COM_WrapOperation.h + +WrapOperation::WrapOperation() : NodeOperation() +{ + this-addInputSocket(COM_DT_COLOR); + this-addOutputSocket(COM_DT_COLOR); + this-setResolutionInputSocketIndex(0); + this-m_inputOperation = NULL; +} +void WrapOperation::initExecution() +{ + this-m_inputOperation = this-getInputSocketReader(0); +} + +void WrapOperation::deinitExecution() +{ + this-m_inputOperation = NULL; +} + +inline float WrapOperation::getWrappedOriginalXPos(float x) +{ + while (x 0) x += this-m_width; + return fmodf(x, this-getWidth()); +} + +inline float WrapOperation::getWrappedOriginalYPos(float y) +{ + while (y 0) y += this-m_height; + return fmodf(y, this-getHeight()); +} + +void WrapOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) +{ + float nx, ny; + nx = x; + ny = y; + switch (m_wrappingType) { + case CMP_NODE_WRAP_NONE: + //Intentionally empty, originalXPos and originalYPos have been set before + break; + case CMP_NODE_WRAP_X: + // wrap only on the x-axis + nx = this-getWrappedOriginalXPos(x); + break; + case CMP_NODE_WRAP_Y: + // wrap only on the y-axis + ny = this-getWrappedOriginalYPos(y); + break; + case CMP_NODE_WRAP_XY: + // wrap on both + nx = this-getWrappedOriginalXPos(x); + ny = this-getWrappedOriginalYPos(y); + break; + } + + this-m_inputOperation-read(output, nx, ny, sampler); + +} + +bool WrapOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output) +{ + rcti newInput; + + newInput.xmin = input-xmin; + newInput.xmax = input-xmax; + newInput.ymin = input-ymin; + newInput.ymax = input-ymax; + + if (m_wrappingType == 1 || m_wrappingType == 3) { + // wrap only on the x-axis if tile is wrapping + newInput.xmin = getWrappedOriginalXPos(input-xmin); + newInput.xmax = getWrappedOriginalXPos(input-xmax); + if (newInput.xmin newInput.xmax) { + newInput.xmin = 0; + newInput.xmax = this-getWidth(); + } + } @@ Diff output truncated at 10240 characters. @@ ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54281] trunk/blender/source/blender/ compositor/nodes: One fix for bug [#33785] compositor is (unnecessarily?) slow
Revision: 54281 http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=54281 Author: mdewanchand Date: 2013-02-03 17:22:26 + (Sun, 03 Feb 2013) Log Message: --- One fix for bug [#33785] compositor is (unnecessarily?) slow Added additional buffers - new subtree - for groupnodes. One needs to be aware of how groupnodes should be created. Having translate scale nodes, with the translate inside the groupnode and the scale node outside, causes artefacts. Both should be inside or outside the groupnode. Same holds for other distort nodes. Modified Paths: -- trunk/blender/source/blender/compositor/nodes/COM_GroupNode.cpp trunk/blender/source/blender/compositor/nodes/COM_SocketProxyNode.cpp trunk/blender/source/blender/compositor/nodes/COM_SocketProxyNode.h Modified: trunk/blender/source/blender/compositor/nodes/COM_GroupNode.cpp === --- trunk/blender/source/blender/compositor/nodes/COM_GroupNode.cpp 2013-02-03 17:01:21 UTC (rev 54280) +++ trunk/blender/source/blender/compositor/nodes/COM_GroupNode.cpp 2013-02-03 17:22:26 UTC (rev 54281) @@ -58,7 +58,7 @@ InputSocket *inputSocket = inputsockets[index]; bNodeSocket *editorInput = inputSocket-getbNodeSocket(); if (editorInput-groupsock) { - SocketProxyNode *proxy = new SocketProxyNode(bnode, editorInput, editorInput-groupsock); +SocketProxyNode *proxy = new SocketProxyNode(bnode, editorInput, editorInput-groupsock, false); inputSocket-relinkConnections(proxy-getInputSocket(0), index, system); ExecutionSystemHelper::addNode(system.getNodes(), proxy); } @@ -68,7 +68,7 @@ OutputSocket *outputSocket = outputsockets[index]; bNodeSocket *editorOutput = outputSocket-getbNodeSocket(); if (editorOutput-groupsock) { - SocketProxyNode *proxy = new SocketProxyNode(bnode, editorOutput-groupsock, editorOutput); +SocketProxyNode *proxy = new SocketProxyNode(bnode, editorOutput-groupsock, editorOutput, true); outputSocket-relinkConnections(proxy-getOutputSocket(0)); ExecutionSystemHelper::addNode(system.getNodes(), proxy); } Modified: trunk/blender/source/blender/compositor/nodes/COM_SocketProxyNode.cpp === --- trunk/blender/source/blender/compositor/nodes/COM_SocketProxyNode.cpp 2013-02-03 17:01:21 UTC (rev 54280) +++ trunk/blender/source/blender/compositor/nodes/COM_SocketProxyNode.cpp 2013-02-03 17:22:26 UTC (rev 54281) @@ -27,11 +27,14 @@ #include COM_SetValueOperation.h #include COM_SetVectorOperation.h #include COM_SetColorOperation.h +#include COM_WriteBufferOperation.h +#include COM_ReadBufferOperation.h -SocketProxyNode::SocketProxyNode(bNode *editorNode, bNodeSocket *editorInput, bNodeSocket *editorOutput) : Node(editorNode, false) +SocketProxyNode::SocketProxyNode(bNode *editorNode, bNodeSocket *editorInput, bNodeSocket *editorOutput, bool buffer) : Node(editorNode, false) { DataType dt; - +this-m_buffer = buffer; + dt = COM_DT_VALUE; if (editorInput-type == SOCK_RGBA) dt = COM_DT_COLOR; if (editorInput-type == SOCK_VECTOR) dt = COM_DT_VECTOR; @@ -49,11 +52,22 @@ InputSocket *inputsocket = this-getInputSocket(0); if (outputsocket-isConnected()) { if (inputsocket-isConnected()) { - SocketProxyOperation *operation = new SocketProxyOperation(this-getOutputSocket()-getDataType()); +SocketProxyOperation *operation = new SocketProxyOperation(this-getOutputSocket()-getDataType()); inputsocket-relinkConnections(operation-getInputSocket(0)); outputsocket-relinkConnections(operation-getOutputSocket(0)); graph-addOperation(operation); - } +if (m_buffer){ +WriteBufferOperation * writeOperation = new WriteBufferOperation(); +ReadBufferOperation * readOperation = new ReadBufferOperation(); + readOperation-setMemoryProxy(writeOperation-getMemoryProxy()); + + operation-getOutputSocket()-relinkConnections(readOperation-getOutputSocket()); +addLink(graph, operation-getOutputSocket(), writeOperation-getInputSocket(0)); + +graph-addOperation(writeOperation); +graph-addOperation(readOperation); +} +} else { /* If input is not connected, add a constant value operation instead */ switch (outputsocket-getDataType()) { Modified:
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54235] trunk/blender/source/blender: Apply patch [#33999] Wrapping mode for the translate compositing node
Revision: 54235 http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=54235 Author: mdewanchand Date: 2013-01-31 15:08:37 + (Thu, 31 Jan 2013) Log Message: --- Apply patch [#33999] Wrapping mode for the translate compositing node this patch enables the translate node to wrap around the image borders. This is especially needed if the translate node is not used to position elements on a layer but when it is used instead for seamless backgrounds like mountains or clouds that should be repeated over time (by animating the x/y values). No trunk without docs! So here is my documentation: http://wiki.blender.org/index.php/User:Plasmasolutions/TranslateNodeExtension The code is properly documented and should be easy to read and understand. When there are any problems or issues, please comment, I'll tackle them right away! Greetings, Thomas Beck * optimized determination dependant areas * fixed some issues with scale node There are still some issues when scaling very small values (x=0.0001) - At Mind - Modified Paths: -- trunk/blender/source/blender/compositor/nodes/COM_TranslateNode.cpp trunk/blender/source/blender/compositor/operations/COM_TranslateOperation.cpp trunk/blender/source/blender/compositor/operations/COM_TranslateOperation.h trunk/blender/source/blender/editors/space_node/drawnode.c trunk/blender/source/blender/makesdna/DNA_node_types.h trunk/blender/source/blender/makesrna/intern/rna_nodetree.c trunk/blender/source/blender/makesrna/intern/rna_nodetree_types.h trunk/blender/source/blender/nodes/composite/nodes/node_composite_translate.c Modified: trunk/blender/source/blender/compositor/nodes/COM_TranslateNode.cpp === --- trunk/blender/source/blender/compositor/nodes/COM_TranslateNode.cpp 2013-01-31 14:25:07 UTC (rev 54234) +++ trunk/blender/source/blender/compositor/nodes/COM_TranslateNode.cpp 2013-01-31 15:08:37 UTC (rev 54235) @@ -37,10 +37,15 @@ InputSocket *inputYSocket = this-getInputSocket(2); OutputSocket *outputSocket = this-getOutputSocket(0); TranslateOperation *operation = new TranslateOperation(); - + + bNode *editorNode = this-getbNode(); + NodeTranslateData *data = (NodeTranslateData *)editorNode-storage; + operation-setWrapping(data-wrap_axis); + inputSocket-relinkConnections(operation-getInputSocket(0), 0, graph); inputXSocket-relinkConnections(operation-getInputSocket(1), 1, graph); inputYSocket-relinkConnections(operation-getInputSocket(2), 2, graph); outputSocket-relinkConnections(operation-getOutputSocket(0)); graph-addOperation(operation); } + Modified: trunk/blender/source/blender/compositor/operations/COM_TranslateOperation.cpp === --- trunk/blender/source/blender/compositor/operations/COM_TranslateOperation.cpp 2013-01-31 14:25:07 UTC (rev 54234) +++ trunk/blender/source/blender/compositor/operations/COM_TranslateOperation.cpp 2013-01-31 15:08:37 UTC (rev 54235) @@ -15,9 +15,10 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * Contributor: - * Jeroen Bakker + * Contributor: + * Jeroen Bakker * Monique Dewanchand + * Thomas Beck (plasmasolutions.de) */ #include COM_TranslateOperation.h @@ -40,6 +41,12 @@ this-m_inputXOperation = this-getInputSocketReader(1); this-m_inputYOperation = this-getInputSocketReader(2); + ensureDelta(); + + //Calculate the relative offset once per execution, no need to do this per pixel + this-m_relativeOffsetX = fmodf(this-getDeltaX(), this-getWidth()); + this-m_relativeOffsetY = fmodf(this-getDeltaY(), this-getHeight()); + } void TranslateOperation::deinitExecution() @@ -53,18 +60,113 @@ void TranslateOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { ensureDelta(); - this-m_inputOperation-read(output, x - this-getDeltaX(), y - this-getDeltaY(), sampler); + + float originalXPos = x - this-getDeltaX(); + float originalYPos = y - this-getDeltaY(); + + switch(m_wrappingType) { + case 0: + //Intentionally empty, originalXPos and originalYPos have been set before + break; + case 1: + // wrap only on the x-axis + originalXPos = this-getWrappedOriginalXPos(x); + break; + case 2: + // wrap only on the y-axis + originalYPos = this-getWrappedOriginalYPos(y); + break; + case 3: + // wrap
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54208] trunk/blender/source/blender/ compositor/operations: Patch by erwin94 [#34015] dilate/ erode multithreading
Revision: 54208 http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=54208 Author: mdewanchand Date: 2013-01-30 15:43:13 + (Wed, 30 Jan 2013) Log Message: --- Patch by erwin94 [#34015] dilate/erode multithreading another patch for the dilate/erode step method, still without any functional changes. This time it keeps the general algorithm but uses the tile system to make it multithreaded. I could not measure a speedup on my 2-core laptop, but hope that it will be faster for more cores. The immediate speedup that is very visible though is that tiles come in as soon as they are calculated and a dilate/erode node does not block the whole image to be calculated. till then, David. Modified Paths: -- trunk/blender/source/blender/compositor/operations/COM_DilateErodeOperation.cpp trunk/blender/source/blender/compositor/operations/COM_DilateErodeOperation.h Modified: trunk/blender/source/blender/compositor/operations/COM_DilateErodeOperation.cpp === --- trunk/blender/source/blender/compositor/operations/COM_DilateErodeOperation.cpp 2013-01-30 15:34:02 UTC (rev 54207) +++ trunk/blender/source/blender/compositor/operations/COM_DilateErodeOperation.cpp 2013-01-30 15:43:13 UTC (rev 54208) @@ -323,124 +323,147 @@ void DilateStepOperation::initExecution() { this-m_inputProgram = this-getInputSocketReader(0); - this-m_cached_buffer = NULL; - this-initMutex(); } + +// small helper to pass data from initializeTileData to executePixel +typedef struct tile_info { + rcti rect; + int width; + float *buffer; +} tile_info; + +static tile_info *create_cache(int xmin, int xmax, int ymin, int ymax) +{ + tile_info *result = (tile_info *)MEM_mallocN(sizeof(tile_info), dilate erode tile); + result-rect.xmin = xmin; + result-rect.xmax = xmax; + result-rect.ymin = ymin; + result-rect.ymax = ymax; + result-width = xmax - xmin; + result-buffer = (float *)MEM_callocN(sizeof(float) * (ymax - ymin) * result-width, dilate erode cache); + return result; +} + void *DilateStepOperation::initializeTileData(rcti *rect) { - if (this-m_cached_buffer != NULL) { - return this-m_cached_buffer; - } - lockMutex(); - if (this-m_cached_buffer == NULL) { - MemoryBuffer *buffer = (MemoryBuffer *)this-m_inputProgram-initializeTileData(NULL); - float *rectf = buffer-convertToValueBuffer(); - int x, y, i; - int bwidth = buffer-getWidth(); - int bheight = buffer-getHeight(); + MemoryBuffer *tile = (MemoryBuffer *)this-m_inputProgram-initializeTileData(NULL); + int x, y, i; + int width = tile-getWidth(); + int height = tile-getHeight(); + float *buffer = tile-getBuffer(); - /* - The following is based on the van Herk/Gil-Werman algorithm for morphology operations. -*/ - int half_window = this-m_iterations; - int window = half_window * 2 + 1; - float *temp = (float *)MEM_mallocN((2 * window - 1) * sizeof(float), dilate erode temp); - float *buf = (float *)MEM_mallocN((max(bwidth, bheight) + 5 * half_window) * sizeof(float), dilate erode buf); + int half_window = this-m_iterations; + int window = half_window * 2 + 1; - for (y = 0; y bheight; y++) { - for (x = 0; x window - 1; x++) { - buf[x] = -MAXFLOAT; - } - for (x = 0; x bwidth; x++) { - buf[x + window - 1] = rectf[bwidth * y + x]; - } - for (x = bwidth + window - 1; x bwidth + 5 * half_window; x++) { - buf[x] = -MAXFLOAT; - } + int xmin = max(0, rect-xmin - half_window); + int ymin = max(0, rect-ymin - half_window); + int xmax = min(width, rect-xmax + half_window); + int ymax = min(height, rect-ymax + half_window); - for (i = 0; i (bwidth + 3 * half_window) / window; i++) { - int start = (i + 1) * window - 1; + int bwidth = rect-xmax - rect-xmin; + int bheight = rect-ymax - rect-ymin; - temp[window - 1] = buf[start]; - for (x = 1; x window; x++) { - temp[window - 1 - x] = max(temp[window - x], buf[start - x]); - temp[window - 1 + x] = max(temp[window + x - 2], buf[start + x]); - } + // Note: Cache buffer has original tilesize width, but new height. + // We have to calculate the additional rows in the
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54096] trunk/blender/source/blender/ compositor/operations/COM_DilateErodeOperation.cpp: committed patch [#33972 ] dilate/erode optimization
Revision: 54096 http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=54096 Author: mdewanchand Date: 2013-01-25 09:47:28 + (Fri, 25 Jan 2013) Log Message: --- committed patch [#33972] dilate/erode optimization this patch optimizes the dilate/erode step method (hopefully without any functional change), making its speed not depend on the distance anymore. Couldn't detect funtional changes so committing. Haven't tested for speed gain. * credits to erwin94 David M Modified Paths: -- trunk/blender/source/blender/compositor/operations/COM_DilateErodeOperation.cpp Modified: trunk/blender/source/blender/compositor/operations/COM_DilateErodeOperation.cpp === --- trunk/blender/source/blender/compositor/operations/COM_DilateErodeOperation.cpp 2013-01-25 07:31:29 UTC (rev 54095) +++ trunk/blender/source/blender/compositor/operations/COM_DilateErodeOperation.cpp 2013-01-25 09:47:28 UTC (rev 54096) @@ -337,38 +337,73 @@ MemoryBuffer *buffer = (MemoryBuffer *)this-m_inputProgram-initializeTileData(NULL); float *rectf = buffer-convertToValueBuffer(); int x, y, i; - float *p; int bwidth = buffer-getWidth(); int bheight = buffer-getHeight(); - for (i = 0; i this-m_iterations; i++) { - for (y = 0; y bheight; y++) { - for (x = 0; x bwidth - 1; x++) { - p = rectf + (bwidth * y + x); - *p = max(*p, *(p + 1)); + + /* + The following is based on the van Herk/Gil-Werman algorithm for morphology operations. +*/ + int half_window = this-m_iterations; + int window = half_window * 2 + 1; + float *temp = (float *)MEM_mallocN((2*window - 1) * sizeof(float), dilate erode temp); + float *buf = (float *)MEM_mallocN((max(bwidth, bheight) + 5*half_window) * sizeof(float), dilate erode buf); + + for (y = 0; y bheight; y++) { + for (x = 0; x window - 1; x++) { + buf[x] = -MAXFLOAT; + } + for (x = 0; x bwidth; x++) { + buf[x + window - 1] = rectf[bwidth * y + x]; + } + for (x = bwidth + window - 1; x bwidth + 5*half_window; x++) { + buf[x] = -MAXFLOAT; + } + + for(i = 0; i (bwidth + 3*half_window) / window; i++) { + int start = (i + 1) * window - 1; + + temp[window - 1] = buf[start]; + for (x = 1; x window; x++) { + temp[window - 1 - x] = max(temp[window - x], buf[start - x]); + temp[window - 1 + x] = max(temp[window + x - 2], buf[start + x]); } + + start = half_window + (i-1) * window + 1; + for (x = -min(0, start); x window - max(0, start+window - bwidth); x++) { + rectf[bwidth * y + (start + x)] = max(temp[x], temp[x + window - 1]); + } } - + } + + for (x = 0; x bwidth; x++) { + for (y = 0; y window - 1; y++) { + buf[y] = -MAXFLOAT; + } for (y = 0; y bheight; y++) { - for (x = bwidth - 1; x = 1; x--) { - p = rectf + (bwidth * y + x); - *p = max(*p, *(p - 1)); - } + buf[y + window - 1] = rectf[bwidth * y + x]; } - - for (x = 0; x bwidth; x++) { - for (y = 0; y bheight - 1; y++) { - p = rectf + (bwidth * y + x); - *p = max(*p, *(p + bwidth)); - } + for (y = bheight + window - 1; y bheight + 5*half_window; y++) { + buf[y] = -MAXFLOAT; } - - for (x = 0; x bwidth; x++) { - for (y = bheight - 1; y = 1; y--) { - p = rectf + (bwidth * y + x); - *p = max(*p, *(p - bwidth)); + + for(i = 0; i (bheight +
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54097] trunk/blender/source/blender/ makesrna/intern/rna_nodetree.c: Increasing dilate erode number of steps.
Revision: 54097 http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=54097 Author: mdewanchand Date: 2013-01-25 09:57:17 + (Fri, 25 Jan 2013) Log Message: --- Increasing dilate erode number of steps. Modified Paths: -- trunk/blender/source/blender/makesrna/intern/rna_nodetree.c Modified: trunk/blender/source/blender/makesrna/intern/rna_nodetree.c === --- trunk/blender/source/blender/makesrna/intern/rna_nodetree.c 2013-01-25 09:47:28 UTC (rev 54096) +++ trunk/blender/source/blender/makesrna/intern/rna_nodetree.c 2013-01-25 09:57:17 UTC (rev 54097) @@ -2537,7 +2537,8 @@ prop = RNA_def_property(srna, distance, PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, custom2); - RNA_def_property_range(prop, -100, 100); + RNA_def_property_range(prop, -5000, 5000); + RNA_def_property_ui_range(prop, -100, 100, 0, 0); RNA_def_property_ui_text(prop, Distance, Distance to grow/shrink (number of iterations)); RNA_def_property_update(prop, NC_NODE | NA_EDITED, rna_Node_update); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54011] trunk/blender/source/blender/ editors/space_node/drawnode.c: Displaying labelname with reroute nodes.
Revision: 54011 http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=54011 Author: mdewanchand Date: 2013-01-22 21:35:33 + (Tue, 22 Jan 2013) Log Message: --- Displaying labelname with reroute nodes. It uses the default text color. Modified Paths: -- trunk/blender/source/blender/editors/space_node/drawnode.c Modified: trunk/blender/source/blender/editors/space_node/drawnode.c === --- trunk/blender/source/blender/editors/space_node/drawnode.c 2013-01-22 20:47:03 UTC (rev 54010) +++ trunk/blender/source/blender/editors/space_node/drawnode.c 2013-01-22 21:35:33 UTC (rev 54011) @@ -1121,8 +1121,10 @@ static void node_draw_reroute(const bContext *C, ARegion *ar, SpaceNode *UNUSED(snode), bNodeTree *ntree, bNode *node) { bNodeSocket *sock; + char showname[128]; /* 128 used below */ + rctf *rct = node-totr; + #if 0 /* UNUSED */ - rctf *rct = node-totr; float size = NODE_REROUTE_SIZE; #endif float socket_size = NODE_SOCKSIZE; @@ -1163,6 +1165,15 @@ } #endif + if (node-label[0] != '\0') { + /* draw title (node label) */ + BLI_strncpy(showname, node-label, sizeof(showname)); + uiDefBut(node-block, LABEL, 0, showname, +(int)(rct-xmin-NODE_DYS), (int)(rct-ymax), +(short)512, (short)NODE_DY, +NULL, 0, 0, 0, 0, ); + } + /* only draw input socket. as they all are placed on the same position. * highlight also if node itself is selected, since we don't display the node body separately! */ ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48816] trunk/blender/source/blender/ compositor: Fix for tiles bug:
Revision: 48816 http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=48816 Author: mdewanchand Date: 2012-07-10 20:21:13 + (Tue, 10 Jul 2012) Log Message: --- Fix for tiles bug: [#31981] Bokeh Blur Node - Size input socket does not accept input from Value Input node, Values smaller than 0.1 will produce black output Modified Paths: -- trunk/blender/source/blender/compositor/nodes/COM_BokehBlurNode.cpp trunk/blender/source/blender/compositor/operations/COM_BokehBlurOperation.cpp trunk/blender/source/blender/compositor/operations/COM_BokehBlurOperation.h Modified: trunk/blender/source/blender/compositor/nodes/COM_BokehBlurNode.cpp === --- trunk/blender/source/blender/compositor/nodes/COM_BokehBlurNode.cpp 2012-07-10 19:23:57 UTC (rev 48815) +++ trunk/blender/source/blender/compositor/nodes/COM_BokehBlurNode.cpp 2012-07-10 20:21:13 UTC (rev 48816) @@ -37,32 +37,24 @@ void BokehBlurNode::convertToOperations(ExecutionSystem *graph, CompositorContext *context) { -// Object *camob = context-getScene()-camera; + BokehBlurOperation *operation = new BokehBlurOperation(); + InputSocket *inputSizeSocket = this-getInputSocket(2); + bool connectedSizeSocket = inputSizeSocket-isConnected(); -// if (this-getInputSocket(2)-isConnected()) { -// VariableSizeBokehBlurOperation *operation = new VariableSizeBokehBlurOperation(); -// ConvertDepthToRadiusOperation *converter = new ConvertDepthToRadiusOperation(); -// converter-setfStop(this-getbNode()-custom3); -// converter-setCameraObject(camob); -// operation-setMaxBlur((int)this-getbNode()-custom4); -// operation-setQuality(context-getQuality()); -// this-getInputSocket(0)-relinkConnections(operation-getInputSocket(0), 0, graph); -// this-getInputSocket(1)-relinkConnections(operation-getInputSocket(1), 1, graph); -// this-getInputSocket(2)-relinkConnections(converter-getInputSocket(0), 2, graph); -// addLink(graph, converter-getOutputSocket(), operation-getInputSocket(2)); -// graph-addOperation(operation); -// graph-addOperation(converter); -// this-getOutputSocket(0)-relinkConnections(operation-getOutputSocket()); -// } -// else { - BokehBlurOperation *operation = new BokehBlurOperation(); - this-getInputSocket(0)-relinkConnections(operation-getInputSocket(0), 0, graph); - this-getInputSocket(1)-relinkConnections(operation-getInputSocket(1), 1, graph); - this-getInputSocket(3)-relinkConnections(operation-getInputSocket(2), 3, graph); - operation-setSize(((bNodeSocketValueFloat *)this-getInputSocket(2)-getbNodeSocket()-default_value)-value); - operation-setQuality(context-getQuality()); - operation-setbNode(this-getbNode()); - graph-addOperation(operation); - this-getOutputSocket(0)-relinkConnections(operation-getOutputSocket()); -// } + const bNodeSocket *sock = this-getInputSocket(2)-getbNodeSocket(); + const float size = ((const bNodeSocketValueFloat *)sock-default_value)-value; + + this-getInputSocket(0)-relinkConnections(operation-getInputSocket(0), 0, graph); + this-getInputSocket(1)-relinkConnections(operation-getInputSocket(1), 1, graph); + this-getInputSocket(2)-relinkConnections(operation-getInputSocket(3), 2, graph); + this-getInputSocket(3)-relinkConnections(operation-getInputSocket(2), 3, graph); + //operation-setSize(((bNodeSocketValueFloat *)this-getInputSocket(2)-getbNodeSocket()-default_value)-value); + operation-setQuality(context-getQuality()); + operation-setbNode(this-getbNode()); + graph-addOperation(operation); + this-getOutputSocket(0)-relinkConnections(operation-getOutputSocket()); + + if (!connectedSizeSocket) { + operation-setSize(size); + } } Modified: trunk/blender/source/blender/compositor/operations/COM_BokehBlurOperation.cpp === --- trunk/blender/source/blender/compositor/operations/COM_BokehBlurOperation.cpp 2012-07-10 19:23:57 UTC (rev 48815) +++ trunk/blender/source/blender/compositor/operations/COM_BokehBlurOperation.cpp 2012-07-10 20:21:13 UTC (rev 48816) @@ -33,12 +33,13 @@ this-addInputSocket(COM_DT_COLOR); this-addInputSocket(COM_DT_COLOR, COM_SC_NO_RESIZE); this-addInputSocket(COM_DT_VALUE); + this-addInputSocket(COM_DT_VALUE); this-addOutputSocket(COM_DT_COLOR); this-setComplex(true); this-setOpenCL(true); this-m_size = 1.0f; - + this-m_sizeavailable = false; this-m_inputProgram = NULL;
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48819] trunk/blender/source/blender/ compositor/operations/COM_BokehBlurOperation.cpp: Fix for issue [#31981] for tiles opencl:
Revision: 48819 http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=48819 Author: mdewanchand Date: 2012-07-10 20:46:42 + (Tue, 10 Jul 2012) Log Message: --- Fix for issue [#31981] for tiles opencl: initialize radius with correct value Modified Paths: -- trunk/blender/source/blender/compositor/operations/COM_BokehBlurOperation.cpp Modified: trunk/blender/source/blender/compositor/operations/COM_BokehBlurOperation.cpp === --- trunk/blender/source/blender/compositor/operations/COM_BokehBlurOperation.cpp 2012-07-10 20:44:25 UTC (rev 48818) +++ trunk/blender/source/blender/compositor/operations/COM_BokehBlurOperation.cpp 2012-07-10 20:46:42 UTC (rev 48819) @@ -47,10 +47,8 @@ void *BokehBlurOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers) { - //void *buffer = getInputOperation(0)-initializeTileData(NULL, memoryBuffers); lockMutex(); if (!this-m_sizeavailable) { - //updateGauss(memoryBuffers); updateSize(memoryBuffers); } void *buffer = getInputOperation(0)-initializeTileData(NULL, memoryBuffers); @@ -197,7 +195,9 @@ listcl_kernel *clKernelsToCleanUp) { cl_kernel kernel = device-COM_clCreateKernel(bokehBlurKernel, NULL); - + if (!this-m_sizeavailable) { + updateSize(inputMemoryBuffers); + } cl_int radius = this-getWidth() * this-m_size / 100.0f; cl_int step = this-getStep(); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48138] trunk/blender/source/blender/ compositor: Refactoring of tiles opencl implementation:
Revision: 48138 http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=48138 Author: mdewanchand Date: 2012-06-20 20:05:21 + (Wed, 20 Jun 2012) Log Message: --- Refactoring of tiles opencl implementation: - Moved methods from NodeOperation to OpenCLDevice - Added check on Nvidia for local size Modified Paths: -- trunk/blender/source/blender/compositor/intern/COM_Device.h trunk/blender/source/blender/compositor/intern/COM_Node.h trunk/blender/source/blender/compositor/intern/COM_NodeOperation.cpp trunk/blender/source/blender/compositor/intern/COM_NodeOperation.h trunk/blender/source/blender/compositor/intern/COM_OpenCLDevice.cpp trunk/blender/source/blender/compositor/intern/COM_OpenCLDevice.h trunk/blender/source/blender/compositor/intern/COM_WorkPackage.h trunk/blender/source/blender/compositor/intern/COM_WorkScheduler.cpp trunk/blender/source/blender/compositor/operations/COM_BokehBlurOperation.cpp trunk/blender/source/blender/compositor/operations/COM_BokehBlurOperation.h trunk/blender/source/blender/compositor/operations/COM_DilateErodeOperation.cpp trunk/blender/source/blender/compositor/operations/COM_DilateErodeOperation.h trunk/blender/source/blender/compositor/operations/COM_WriteBufferOperation.cpp trunk/blender/source/blender/compositor/operations/COM_WriteBufferOperation.h Modified: trunk/blender/source/blender/compositor/intern/COM_Device.h === --- trunk/blender/source/blender/compositor/intern/COM_Device.h 2012-06-20 19:23:12 UTC (rev 48137) +++ trunk/blender/source/blender/compositor/intern/COM_Device.h 2012-06-20 20:05:21 UTC (rev 48138) @@ -23,11 +23,7 @@ #ifndef _COM_Device_h #define _COM_Device_h -#include COM_ExecutionSystem.h #include COM_WorkPackage.h -#include COM_NodeOperation.h -#include BLI_rect.h -#include COM_MemoryBuffer.h /** * @brief Abstract class for device implementations to be used by the Compositor. Modified: trunk/blender/source/blender/compositor/intern/COM_Node.h === --- trunk/blender/source/blender/compositor/intern/COM_Node.h 2012-06-20 19:23:12 UTC (rev 48137) +++ trunk/blender/source/blender/compositor/intern/COM_Node.h 2012-06-20 20:05:21 UTC (rev 48138) @@ -29,6 +29,7 @@ #include COM_CompositorContext.h #include DNA_node_types.h #include BKE_text.h +#include COM_ExecutionSystem.h #include vector #include string Modified: trunk/blender/source/blender/compositor/intern/COM_NodeOperation.cpp === --- trunk/blender/source/blender/compositor/intern/COM_NodeOperation.cpp 2012-06-20 19:23:12 UTC (rev 48137) +++ trunk/blender/source/blender/compositor/intern/COM_NodeOperation.cpp 2012-06-20 20:05:21 UTC (rev 48138) @@ -140,118 +140,3 @@ return false; } } - -cl_mem NodeOperation::COM_clAttachMemoryBufferToKernelParameter(cl_context context, cl_kernel kernel, int parameterIndex, int offsetIndex, listcl_mem *cleanup, MemoryBuffer **inputMemoryBuffers, SocketReader *reader) -{ - cl_int error; - MemoryBuffer *result = (MemoryBuffer *)reader-initializeTileData(NULL, inputMemoryBuffers); - - const cl_image_format imageFormat = { - CL_RGBA, - CL_FLOAT - }; - - cl_mem clBuffer = clCreateImage2D(context, CL_MEM_READ_ONLY | CL_MEM_USE_HOST_PTR, imageFormat, result-getWidth(), - result-getHeight(), 0, result-getBuffer(), error); - - if (error != CL_SUCCESS) { printf(CLERROR[%d]: %s\n, error, clewErrorString(error)); } - if (error == CL_SUCCESS) cleanup-push_back(clBuffer); - - error = clSetKernelArg(kernel, parameterIndex, sizeof(cl_mem), clBuffer); - if (error != CL_SUCCESS) { printf(CLERROR[%d]: %s\n, error, clewErrorString(error)); } - - COM_clAttachMemoryBufferOffsetToKernelParameter(kernel, offsetIndex, result); - return clBuffer; -} - -void NodeOperation::COM_clAttachMemoryBufferOffsetToKernelParameter(cl_kernel kernel, int offsetIndex, MemoryBuffer *memoryBuffer) -{ - if (offsetIndex != -1) { - cl_int error; - rcti *rect = memoryBuffer-getRect(); - cl_int2 offset = {rect-xmin, rect-ymin}; - - error = clSetKernelArg(kernel, offsetIndex, sizeof(cl_int2), offset); - if (error != CL_SUCCESS) { printf(CLERROR[%d]: %s\n, error, clewErrorString(error)); } - } -} - -void NodeOperation::COM_clAttachSizeToKernelParameter(cl_kernel kernel, int offsetIndex) -{ - if (offsetIndex != -1) { - cl_int error; - cl_int2 offset = {this-getWidth(), this-getHeight()}; - - error = clSetKernelArg(kernel, offsetIndex,
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [47309] trunk/blender/source/blender/ compositor: Replaced tile based memory manager with a single aligned buffer
Revision: 47309 http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=47309 Author: mdewanchand Date: 2012-06-01 10:20:24 + (Fri, 01 Jun 2012) Log Message: --- Replaced tile based memory manager with a single aligned buffer - should increase speed with large node setups - enables caching of buffers in the node editor (in the future) - OpenCL part still needs some work Modified Paths: -- trunk/blender/source/blender/compositor/CMakeLists.txt trunk/blender/source/blender/compositor/intern/COM_CPUDevice.cpp trunk/blender/source/blender/compositor/intern/COM_ExecutionGroup.cpp trunk/blender/source/blender/compositor/intern/COM_ExecutionGroup.h trunk/blender/source/blender/compositor/intern/COM_ExecutionSystem.cpp trunk/blender/source/blender/compositor/intern/COM_ExecutionSystemHelper.cpp trunk/blender/source/blender/compositor/intern/COM_MemoryBuffer.cpp trunk/blender/source/blender/compositor/intern/COM_MemoryProxy.cpp trunk/blender/source/blender/compositor/intern/COM_MemoryProxy.h trunk/blender/source/blender/compositor/intern/COM_NodeOperation.h trunk/blender/source/blender/compositor/intern/COM_OpenCLDevice.cpp trunk/blender/source/blender/compositor/operations/COM_WriteBufferOperation.cpp Removed Paths: - trunk/blender/source/blender/compositor/intern/COM_MemoryManager.cpp trunk/blender/source/blender/compositor/intern/COM_MemoryManager.h trunk/blender/source/blender/compositor/intern/COM_MemoryManagerState.cpp trunk/blender/source/blender/compositor/intern/COM_MemoryManagerState.h Modified: trunk/blender/source/blender/compositor/CMakeLists.txt === --- trunk/blender/source/blender/compositor/CMakeLists.txt 2012-06-01 08:01:04 UTC (rev 47308) +++ trunk/blender/source/blender/compositor/CMakeLists.txt 2012-06-01 10:20:24 UTC (rev 47309) @@ -79,10 +79,6 @@ intern/COM_MemoryProxy.h intern/COM_MemoryBuffer.cpp intern/COM_MemoryBuffer.h - intern/COM_MemoryManager.cpp - intern/COM_MemoryManager.h - intern/COM_MemoryManagerState.cpp - intern/COM_MemoryManagerState.h intern/COM_WorkScheduler.cpp intern/COM_WorkScheduler.h intern/COM_WorkPackage.cpp Modified: trunk/blender/source/blender/compositor/intern/COM_CPUDevice.cpp === --- trunk/blender/source/blender/compositor/intern/COM_CPUDevice.cpp 2012-06-01 08:01:04 UTC (rev 47308) +++ trunk/blender/source/blender/compositor/intern/COM_CPUDevice.cpp 2012-06-01 10:20:24 UTC (rev 47309) @@ -29,14 +29,10 @@ rcti rect; executionGroup-determineChunkRect(rect, chunkNumber); - MemoryBuffer ** inputBuffers = executionGroup-getInputBuffers(chunkNumber); - MemoryBuffer * outputBuffer = executionGroup-allocateOutputBuffer(chunkNumber, rect); + MemoryBuffer ** inputBuffers = executionGroup-getInputBuffersCPU(); executionGroup-getOutputNodeOperation()-executeRegion(rect, chunkNumber, inputBuffers); executionGroup-finalizeChunkExecution(chunkNumber, inputBuffers); - if (outputBuffer != NULL) { - outputBuffer-setCreatedState(); - } } Modified: trunk/blender/source/blender/compositor/intern/COM_ExecutionGroup.cpp === --- trunk/blender/source/blender/compositor/intern/COM_ExecutionGroup.cpp 2012-06-01 08:01:04 UTC (rev 47308) +++ trunk/blender/source/blender/compositor/intern/COM_ExecutionGroup.cpp 2012-06-01 10:20:24 UTC (rev 47309) @@ -34,7 +34,6 @@ #include COM_ViewerOperation.h #include stdlib.h #include BLI_math.h -#include COM_MemoryManager.h #include PIL_time.h #include COM_ChunkOrder.h #include algorithm @@ -362,8 +361,25 @@ delete[] chunkOrder; } -MemoryBuffer** ExecutionGroup::getInputBuffers(int chunkNumber) +MemoryBuffer** ExecutionGroup::getInputBuffersCPU() { + vectorMemoryProxy* memoryproxies; + unsigned int index; + + this-determineDependingMemoryProxies(memoryproxies); + MemoryBuffer **memoryBuffers = new MemoryBuffer*[this-cachedMaxReadBufferOffset]; + for (index = 0 ; index this-cachedMaxReadBufferOffset ; index ++) { + memoryBuffers[index] = NULL; + } + for (index = 0 ; index this-cachedReadOperations.size(); index ++) { + ReadBufferOperation *readOperation = (ReadBufferOperation*)this-cachedReadOperations[index]; + memoryBuffers[readOperation-getOffset()] = readOperation-getMemoryProxy()-getBuffer(); + } + return memoryBuffers; +} + +MemoryBuffer** ExecutionGroup::getInputBuffersOpenCL(int chunkNumber) +{ rcti rect; vectorMemoryProxy* memoryproxies; unsigned int index; @@ -385,6 +401,8 @@
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [47315] trunk/blender/source/blender/ compositor: Optimize Gaussian blurs
Revision: 47315 http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=47315 Author: mdewanchand Date: 2012-06-01 11:50:32 + (Fri, 01 Jun 2012) Log Message: --- Optimize Gaussian blurs Modified Paths: -- trunk/blender/source/blender/compositor/nodes/COM_BlurNode.cpp trunk/blender/source/blender/compositor/operations/COM_BlurBaseOperation.cpp trunk/blender/source/blender/compositor/operations/COM_BlurBaseOperation.h trunk/blender/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp trunk/blender/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.h trunk/blender/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp trunk/blender/source/blender/compositor/operations/COM_GaussianXBlurOperation.h trunk/blender/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp trunk/blender/source/blender/compositor/operations/COM_GaussianYBlurOperation.h Modified: trunk/blender/source/blender/compositor/nodes/COM_BlurNode.cpp === --- trunk/blender/source/blender/compositor/nodes/COM_BlurNode.cpp 2012-06-01 11:46:25 UTC (rev 47314) +++ trunk/blender/source/blender/compositor/nodes/COM_BlurNode.cpp 2012-06-01 11:50:32 UTC (rev 47315) @@ -37,10 +37,11 @@ { bNode *editorNode = this-getbNode(); NodeBlurData * data = (NodeBlurData*)editorNode-storage; -#if 0 + InputSocket * inputSizeSocket = this-getInputSocket(1); + bool connectedSizeSocket = inputSizeSocket-isConnected(); + const bNodeSocket *sock = this-getInputSocket(1)-getbNodeSocket(); const float size = ((const bNodeSocketValueFloat*)sock-default_value)-value; -#endif CompositorQuality quality = context-getQuality(); @@ -71,6 +72,11 @@ addLink(graph, operationx-getOutputSocket(), operationy-getInputSocket(0)); addLink(graph, operationx-getInputSocket(1)-getConnection()-getFromSocket(), operationy-getInputSocket(1)); addPreviewOperation(graph, operationy-getOutputSocket(), 5); + + if (!connectedSizeSocket) { + operationx-setSize(size); + operationy-setSize(size); + } } else { GaussianBokehBlurOperation *operation = new GaussianBokehBlurOperation(); @@ -81,5 +87,9 @@ graph-addOperation(operation); this-getOutputSocket(0)-relinkConnections(operation-getOutputSocket()); addPreviewOperation(graph, operation-getOutputSocket(), 5); + + if (!connectedSizeSocket) { + operation-setSize(size); + } } } Modified: trunk/blender/source/blender/compositor/operations/COM_BlurBaseOperation.cpp === --- trunk/blender/source/blender/compositor/operations/COM_BlurBaseOperation.cpp 2012-06-01 11:46:25 UTC (rev 47314) +++ trunk/blender/source/blender/compositor/operations/COM_BlurBaseOperation.cpp 2012-06-01 11:50:32 UTC (rev 47315) @@ -37,6 +37,7 @@ this-data = NULL; this-size = 1.0f; this-deleteData = false; + this-sizeavailable=false; } void BlurBaseOperation::initExecution() { Modified: trunk/blender/source/blender/compositor/operations/COM_BlurBaseOperation.h === --- trunk/blender/source/blender/compositor/operations/COM_BlurBaseOperation.h 2012-06-01 11:46:25 UTC (rev 47314) +++ trunk/blender/source/blender/compositor/operations/COM_BlurBaseOperation.h 2012-06-01 11:50:32 UTC (rev 47315) @@ -39,6 +39,7 @@ float *make_gausstab(int rad); float size; bool deleteData; + bool sizeavailable; void updateSize(MemoryBuffer **memoryBuffers); public: /** @@ -54,5 +55,7 @@ void setData(NodeBlurData *data) {this-data = data;} void deleteDataWhenFinished() {this-deleteData = true;} + + void setSize(float size) {this-size = size; sizeavailable = true;} }; #endif Modified: trunk/blender/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp === --- trunk/blender/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp 2012-06-01 11:46:25 UTC (rev 47314) +++ trunk/blender/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp 2012-06-01 11:50:32 UTC (rev 47315) @@ -34,11 +34,20 @@ void *GaussianBokehBlurOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers) { - updateGauss(memoryBuffers); + if (!sizeavailable) { + updateGauss(memoryBuffers); + } void *buffer =
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [47297] trunk/blender/source/blender/ compositor/operations: Fix for [#31662] Compositing: No Alpha if image/ color connected to second input of math
Revision: 47297 http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=47297 Author: mdewanchand Date: 2012-05-31 20:26:42 + (Thu, 31 May 2012) Log Message: --- Fix for [#31662] Compositing: No Alpha if image/color connected to second input of math node Modified Paths: -- trunk/blender/source/blender/compositor/operations/COM_MathBaseOperation.cpp trunk/blender/source/blender/compositor/operations/COM_MathBaseOperation.h Modified: trunk/blender/source/blender/compositor/operations/COM_MathBaseOperation.cpp === --- trunk/blender/source/blender/compositor/operations/COM_MathBaseOperation.cpp 2012-05-31 20:26:36 UTC (rev 47296) +++ trunk/blender/source/blender/compositor/operations/COM_MathBaseOperation.cpp 2012-05-31 20:26:42 UTC (rev 47297) @@ -47,6 +47,22 @@ this-inputValue2Operation = NULL; } +void MathBaseOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[]) +{ + InputSocket *socket; + unsigned int tempPreferredResolution[] = {0,0}; + unsigned int tempResolution[2]; + + socket = this-getInputSocket(0); + socket-determineResolution(tempResolution, tempPreferredResolution); + if ((tempResolution[0] != 0) (tempResolution[1] != 0)) { + this-setResolutionInputSocketIndex(0); + } else { + this-setResolutionInputSocketIndex(1); + } + NodeOperation::determineResolution(resolution, preferredResolution); +} + void MathAddOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[]) { float inputValue1[4]; Modified: trunk/blender/source/blender/compositor/operations/COM_MathBaseOperation.h === --- trunk/blender/source/blender/compositor/operations/COM_MathBaseOperation.h 2012-05-31 20:26:36 UTC (rev 47296) +++ trunk/blender/source/blender/compositor/operations/COM_MathBaseOperation.h 2012-05-31 20:26:42 UTC (rev 47297) @@ -58,6 +58,10 @@ */ void deinitExecution(); + /** + * Determine resolution + */ + void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]); }; class MathAddOperation: public MathBaseOperation { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [47245] trunk/blender/source/blender/ compositor/intern/COM_WorkScheduler.cpp: Fix for
Revision: 47245 http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=47245 Author: mdewanchand Date: 2012-05-30 21:09:50 + (Wed, 30 May 2012) Log Message: --- Fix for [#31562] New compositor crashes due to incorrect opencl initialization Modified Paths: -- trunk/blender/source/blender/compositor/intern/COM_WorkScheduler.cpp Modified: trunk/blender/source/blender/compositor/intern/COM_WorkScheduler.cpp === --- trunk/blender/source/blender/compositor/intern/COM_WorkScheduler.cpp 2012-05-30 19:21:22 UTC (rev 47244) +++ trunk/blender/source/blender/compositor/intern/COM_WorkScheduler.cpp 2012-05-30 21:09:50 UTC (rev 47245) @@ -232,11 +232,10 @@ context = NULL; program = NULL; if (clCreateContextFromType) { - cl_uint numberOfPlatforms; + cl_uint numberOfPlatforms = 0; cl_int error; error = clGetPlatformIDs(0, 0, numberOfPlatforms); if (error != CL_SUCCESS) { printf(CLERROR[%d]: %s\n, error, clewErrorString(error)); } - numberOfPlatforms = 0; if (G.f G_DEBUG) printf(%d number of platforms\n, numberOfPlatforms); cl_platform_id *platforms = new cl_platform_id[numberOfPlatforms]; error = clGetPlatformIDs(numberOfPlatforms, platforms, 0); @@ -265,7 +264,7 @@ error = clBuildProgram(program, totalNumberOfDevices, cldevices, 0, 0, 0); if (error != CL_SUCCESS) { cl_int error2; - size_t ret_val_size; + size_t ret_val_size = 0; printf(CLERROR[%d]: %s\n, error, clewErrorString(error)); error2 = clGetProgramBuildInfo(program, cldevices[0], CL_PROGRAM_BUILD_LOG, 0, NULL, ret_val_size); if (error2 != CL_SUCCESS) { printf(CLERROR[%d]: %s\n, error, clewErrorString(error)); } @@ -276,19 +275,20 @@ printf(%s, build_log); delete build_log; - } - unsigned int indexDevices; - for (indexDevices = 0 ; indexDevices totalNumberOfDevices ; indexDevices ++) { - cl_device_id device = cldevices[indexDevices]; - OpenCLDevice *clDevice = new OpenCLDevice(context, device, program); - clDevice-initialize(), - gpudevices.push_back(clDevice); - if (G.f G_DEBUG) { - char resultString[32]; - error = clGetDeviceInfo(device, CL_DEVICE_NAME, 32, resultString, 0); - printf(OPENCL_DEVICE: %s, , resultString); - error = clGetDeviceInfo(device, CL_DEVICE_VENDOR, 32, resultString, 0); - printf(%s\n, resultString); + } else { + unsigned int indexDevices; + for (indexDevices = 0 ; indexDevices totalNumberOfDevices ; indexDevices ++) { + cl_device_id device = cldevices[indexDevices]; + OpenCLDevice *clDevice = new OpenCLDevice(context, device, program); + clDevice-initialize(), + gpudevices.push_back(clDevice); + if (G.f G_DEBUG) { + char resultString[32]; + error = clGetDeviceInfo(device, CL_DEVICE_NAME, 32, resultString, 0); + printf(OPENCL_DEVICE: %s, , resultString); + error = clGetDeviceInfo(device, CL_DEVICE_VENDOR, 32, resultString, 0); + printf(%s\n, resultString); + } } } } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [46857] trunk/blender/source/blender: Fix for
Revision: 46857 http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=46857 Author: mdewanchand Date: 2012-05-21 19:58:23 + (Mon, 21 May 2012) Log Message: --- Fix for [#31408] Code review testing: Button labels are invisible in many nodes Modified Paths: -- trunk/blender/source/blender/editors/space_node/drawnode.c trunk/blender/source/blender/makesrna/intern/rna_nodetree.c trunk/blender/source/blender/nodes/composite/nodes/node_composite_boxmask.c trunk/blender/source/blender/nodes/composite/nodes/node_composite_ellipsemask.c Modified: trunk/blender/source/blender/editors/space_node/drawnode.c === --- trunk/blender/source/blender/editors/space_node/drawnode.c 2012-05-21 19:52:41 UTC (rev 46856) +++ trunk/blender/source/blender/editors/space_node/drawnode.c 2012-05-21 19:58:23 UTC (rev 46857) @@ -2080,8 +2080,8 @@ uiLayout *row; row= uiLayoutRow(layout, 1); - uiItemR(row, ptr, x, 0, X, ICON_NONE); - uiItemR(row, ptr, y, 0, Y, ICON_NONE); + uiItemR(row, ptr, x, 0, NULL, ICON_NONE); + uiItemR(row, ptr, y, 0, NULL, ICON_NONE); row= uiLayoutRow(layout, 1); uiItemR(row, ptr, width, UI_ITEM_R_SLIDER, NULL, ICON_NONE); @@ -2207,8 +2207,8 @@ { uiLayout *row; row= uiLayoutRow(layout, 1); - uiItemR(row, ptr, x, 0, X, ICON_NONE); - uiItemR(row, ptr, y, 0, Y, ICON_NONE); + uiItemR(row, ptr, x, 0, NULL, ICON_NONE); + uiItemR(row, ptr, y, 0, NULL, ICON_NONE); row= uiLayoutRow(layout, 1); uiItemR(row, ptr, width, UI_ITEM_R_SLIDER, NULL, ICON_NONE); uiItemR(row, ptr, height, UI_ITEM_R_SLIDER, NULL, ICON_NONE); Modified: trunk/blender/source/blender/makesrna/intern/rna_nodetree.c === --- trunk/blender/source/blender/makesrna/intern/rna_nodetree.c 2012-05-21 19:52:41 UTC (rev 46856) +++ trunk/blender/source/blender/makesrna/intern/rna_nodetree.c 2012-05-21 19:58:23 UTC (rev 46857) @@ -3023,28 +3023,28 @@ RNA_def_property_float_sdna(prop, NULL, x); RNA_def_property_float_default(prop, 0.5f); RNA_def_property_range(prop, -1.0f, 2.0f); - RNA_def_property_ui_text(prop, X position, X position of the middle of the box); + RNA_def_property_ui_text(prop, X, X position of the middle of the box); RNA_def_property_update(prop, NC_NODE|NA_EDITED, rna_Node_update); prop = RNA_def_property(srna, y, PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, y); RNA_def_property_float_default(prop, 0.5f); RNA_def_property_range(prop, -1.0f, 2.0f); - RNA_def_property_ui_text(prop, Y position, Y position of the middle of the box); + RNA_def_property_ui_text(prop, Y, Y position of the middle of the box); RNA_def_property_update(prop, NC_NODE|NA_EDITED, rna_Node_update); prop = RNA_def_property(srna, width, PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, width); RNA_def_property_float_default(prop, 0.3f); RNA_def_property_range(prop, 0.0f, 2.0f); - RNA_def_property_ui_text(prop, Width of the box, Width of the box); + RNA_def_property_ui_text(prop, Width, Width of the box); RNA_def_property_update(prop, NC_NODE|NA_EDITED, rna_Node_update); prop = RNA_def_property(srna, height, PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, height); RNA_def_property_float_default(prop, 0.2f); RNA_def_property_range(prop, 0.0f, 2.0f); - RNA_def_property_ui_text(prop, Height of the box, Height of the box); + RNA_def_property_ui_text(prop, Height, Height of the box); RNA_def_property_update(prop, NC_NODE|NA_EDITED, rna_Node_update); prop = RNA_def_property(srna, rotation, PROP_FLOAT, PROP_NONE); @@ -3070,28 +3070,28 @@ RNA_def_property_float_sdna(prop, NULL, x); RNA_def_property_float_default(prop, 0.5f); RNA_def_property_range(prop, -1.0f, 2.0f); - RNA_def_property_ui_text(prop, X position, X position of the middle of the box); + RNA_def_property_ui_text(prop, X, X position of the middle of the box); RNA_def_property_update(prop, NC_NODE|NA_EDITED, rna_Node_update); prop = RNA_def_property(srna, y, PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, y); RNA_def_property_float_default(prop, 0.5f); RNA_def_property_range(prop, -1.0f, 2.0f); - RNA_def_property_ui_text(prop, Y position, Y position of the middle of the box); + RNA_def_property_ui_text(prop, Y, Y position of the middle of the box); RNA_def_property_update(prop, NC_NODE|NA_EDITED, rna_Node_update); prop = RNA_def_property(srna, width, PROP_FLOAT, PROP_NONE);
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [46861] trunk/blender/source/blender: fix for
Revision: 46861 http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=46861 Author: mdewanchand Date: 2012-05-21 20:36:02 + (Mon, 21 May 2012) Log Message: --- fix for [#31502] Defocus max radius help tekst Modified Paths: -- trunk/blender/source/blender/makesrna/intern/rna_nodetree.c trunk/blender/source/blender/nodes/composite/nodes/node_composite_defocus.c Modified: trunk/blender/source/blender/makesrna/intern/rna_nodetree.c === --- trunk/blender/source/blender/makesrna/intern/rna_nodetree.c 2012-05-21 20:28:54 UTC (rev 46860) +++ trunk/blender/source/blender/makesrna/intern/rna_nodetree.c 2012-05-21 20:36:02 UTC (rev 46861) @@ -2427,7 +2427,7 @@ prop = RNA_def_property(srna, blur_max, PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, maxblur); RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_ui_text(prop, Max Blur, Blur limit, maximum CoC radius, 0=no limit); + RNA_def_property_ui_text(prop, Max Blur, Blur limit, maximum CoC radius); RNA_def_property_update(prop, NC_NODE|NA_EDITED, rna_Node_update); prop = RNA_def_property(srna, threshold, PROP_FLOAT, PROP_NONE); Modified: trunk/blender/source/blender/nodes/composite/nodes/node_composite_defocus.c === --- trunk/blender/source/blender/nodes/composite/nodes/node_composite_defocus.c 2012-05-21 20:28:54 UTC (rev 46860) +++ trunk/blender/source/blender/nodes/composite/nodes/node_composite_defocus.c 2012-05-21 20:36:02 UTC (rev 46861) @@ -868,7 +868,7 @@ nbd-gamco = 0; nbd-samples = 16; nbd-fstop = 128.f; - nbd-maxblur = 0; + nbd-maxblur = 16; nbd-bthresh = 1.f; nbd-scale = 1.f; nbd-no_zbuf = 1; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [46508] branches/tile/source/blender/ compositor: Tile Branch
Revision: 46508 http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=46508 Author: mdewanchand Date: 2012-05-10 20:24:20 + (Thu, 10 May 2012) Log Message: --- Tile Branch [#31298] plugging anything into size socket of blur node does nothing Modified Paths: -- branches/tile/source/blender/compositor/nodes/COM_BlurNode.cpp branches/tile/source/blender/compositor/nodes/COM_MixNode.cpp branches/tile/source/blender/compositor/operations/COM_BlurBaseOperation.cpp branches/tile/source/blender/compositor/operations/COM_BlurBaseOperation.h branches/tile/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp branches/tile/source/blender/compositor/operations/COM_FastGaussianBlurOperation.h branches/tile/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp branches/tile/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.h branches/tile/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp branches/tile/source/blender/compositor/operations/COM_GaussianXBlurOperation.h branches/tile/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp branches/tile/source/blender/compositor/operations/COM_GaussianYBlurOperation.h branches/tile/source/blender/compositor/operations/COM_MixBaseOperation.cpp branches/tile/source/blender/compositor/operations/COM_MixBaseOperation.h Modified: branches/tile/source/blender/compositor/nodes/COM_BlurNode.cpp === --- branches/tile/source/blender/compositor/nodes/COM_BlurNode.cpp 2012-05-10 19:25:18 UTC (rev 46507) +++ branches/tile/source/blender/compositor/nodes/COM_BlurNode.cpp 2012-05-10 20:24:20 UTC (rev 46508) @@ -36,7 +36,8 @@ bNode* editorNode = this-getbNode(); NodeBlurData * data = (NodeBlurData*)editorNode-storage; const bNodeSocket *sock = this-getInputSocket(1)-getbNodeSocket(); - const float size = ((const bNodeSocketValueFloat*)sock-default_value)-value; + //const float size = ((const bNodeSocketValueFloat*)sock-default_value)-value; + CompositorQuality quality = context-getQuality(); if (data-filtertype == R_FILTER_MITCH || data-filtertype == R_FILTER_CATROM) { @@ -45,8 +46,8 @@ if (data-filtertype == R_FILTER_FAST_GAUSS) { FastGaussianBlurOperation *operationfgb = new FastGaussianBlurOperation(); operationfgb-setData(data); - operationfgb-setSize(size); this-getInputSocket(0)-relinkConnections(operationfgb-getInputSocket(0), true, 0, graph); + this-getInputSocket(1)-relinkConnections(operationfgb-getInputSocket(1), true, 1, graph); this-getOutputSocket(0)-relinkConnections(operationfgb-getOutputSocket(0)); graph-addOperation(operationfgb); addPreviewOperation(graph, operationfgb-getOutputSocket(), 5); @@ -55,21 +56,21 @@ operationx-setData(data); operationx-setQuality(quality); this-getInputSocket(0)-relinkConnections(operationx-getInputSocket(0), true, 0, graph); - operationx-setSize(size); + this-getInputSocket(1)-relinkConnections(operationx-getInputSocket(1), true, 1, graph); graph-addOperation(operationx); GaussianYBlurOperation *operationy = new GaussianYBlurOperation(); operationy-setData(data); operationy-setQuality(quality); this-getOutputSocket(0)-relinkConnections(operationy-getOutputSocket()); - operationy-setSize(size); graph-addOperation(operationy); addLink(graph, operationx-getOutputSocket(), operationy-getInputSocket(0)); + addLink(graph, operationx-getInputSocket(1)-getConnection()-getFromSocket(), operationy-getInputSocket(1)); addPreviewOperation(graph, operationy-getOutputSocket(), 5); } else { GaussianBokehBlurOperation *operation = new GaussianBokehBlurOperation(); operation-setData(data); this-getInputSocket(0)-relinkConnections(operation-getInputSocket(0), true, 0, graph); - operation-setSize(size); + this-getInputSocket(1)-relinkConnections(operation-getInputSocket(1), true, 1, graph); operation-setQuality(quality); graph-addOperation(operation); this-getOutputSocket(0)-relinkConnections(operation-getOutputSocket()); Modified: branches/tile/source/blender/compositor/nodes/COM_MixNode.cpp === --- branches/tile/source/blender/compositor/nodes/COM_MixNode.cpp 2012-05-10 19:25:18 UTC (rev 46507) +++
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [46292] branches/tile/source/blender/ editors/space_node/node_edit.c: Tile branche
Revision: 46292 http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=46292 Author: mdewanchand Date: 2012-05-04 17:37:07 + (Fri, 04 May 2012) Log Message: --- Tile branche [#31282] Edit quality should be High by default Modified Paths: -- branches/tile/source/blender/editors/space_node/node_edit.c Modified: branches/tile/source/blender/editors/space_node/node_edit.c === --- branches/tile/source/blender/editors/space_node/node_edit.c 2012-05-04 17:04:20 UTC (rev 46291) +++ branches/tile/source/blender/editors/space_node/node_edit.c 2012-05-04 17:37:07 UTC (rev 46292) @@ -378,7 +378,7 @@ sce-nodetree= ntreeAddTree(Compositing Nodetree, NTREE_COMPOSIT, 0); sce-nodetree-chunksize = 256; - sce-nodetree-edit_quality = NTREE_QUALITY_LOW; + sce-nodetree-edit_quality = NTREE_QUALITY_HIGH; sce-nodetree-render_quality = NTREE_QUALITY_HIGH; ntemp.type = CMP_NODE_COMPOSITE; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [46299] branches/tile/source/blender/ compositor: Tile Branche
Revision: 46299 http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=46299 Author: mdewanchand Date: 2012-05-04 21:23:27 + (Fri, 04 May 2012) Log Message: --- Tile Branche [#31242] Fast Gaussian blur results in a black screen Modified Paths: -- branches/tile/source/blender/compositor/CMakeLists.txt branches/tile/source/blender/compositor/nodes/COM_BlurNode.cpp Added Paths: --- branches/tile/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp branches/tile/source/blender/compositor/operations/COM_FastGaussianBlurOperation.h Modified: branches/tile/source/blender/compositor/CMakeLists.txt === --- branches/tile/source/blender/compositor/CMakeLists.txt 2012-05-04 18:06:52 UTC (rev 46298) +++ branches/tile/source/blender/compositor/CMakeLists.txt 2012-05-04 21:23:27 UTC (rev 46299) @@ -305,6 +305,8 @@ operations/COM_BokehBlurOperation.h operations/COM_VariableSizeBokehBlurOperation.cpp operations/COM_VariableSizeBokehBlurOperation.h + operations/COM_FastGaussianBlurOperation.cpp + operations/COM_FastGaussianBlurOperation.h operations/COM_BlurBaseOperation.cpp operations/COM_BlurBaseOperation.h operations/COM_DirectionalBlurOperation.cpp Modified: branches/tile/source/blender/compositor/nodes/COM_BlurNode.cpp === --- branches/tile/source/blender/compositor/nodes/COM_BlurNode.cpp 2012-05-04 18:06:52 UTC (rev 46298) +++ branches/tile/source/blender/compositor/nodes/COM_BlurNode.cpp 2012-05-04 21:23:27 UTC (rev 46299) @@ -27,6 +27,7 @@ #include COM_GaussianYBlurOperation.h #include COM_ExecutionSystem.h #include COM_GaussianBokehBlurOperation.h +#include COM_FastGaussianBlurOperation.h BlurNode::BlurNode(bNode *editorNode): Node(editorNode) { } @@ -41,8 +42,14 @@ if (data-filtertype == R_FILTER_MITCH || data-filtertype == R_FILTER_CATROM) { quality = COM_QUALITY_HIGH; } - - if (!data-bokeh) { + if (data-filtertype == R_FILTER_FAST_GAUSS) { + FastGaussianBlurOperation *operationfgb = new FastGaussianBlurOperation(); + operationfgb-setdata(data); + operationfgb-setSize(size); + this-getInputSocket(0)-relinkConnections(operationfgb-getInputSocket(0), true, 0, graph); + this-getOutputSocket(0)-relinkConnections(operationfgb-getOutputSocket(0)); + graph-addOperation(operationfgb); + }else if (!data-bokeh) { GaussianXBlurOperation *operationx = new GaussianXBlurOperation(); operationx-setData(data); operationx-setQuality(quality); Added: branches/tile/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp === --- branches/tile/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp (rev 0) +++ branches/tile/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp 2012-05-04 21:23:27 UTC (rev 46299) @@ -0,0 +1,192 @@ +/* + * Copyright 2011, Blender Foundation. + * + * 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. + * + * Contributor: + * Jeroen Bakker + * Monique Dewanchand + */ + +#include COM_FastGaussianBlurOperation.h +#include MEM_guardedalloc.h +#include BLI_utildefines.h + +FastGaussianBlurOperation::FastGaussianBlurOperation(): NodeOperation(){ + this-inputOperation = NULL; + this-addInputSocket(COM_DT_COLOR); + this-addOutputSocket(COM_DT_COLOR); + this-setComplex(true); + this-data = NULL; +} + +void FastGaussianBlurOperation::initExecution(){ + this-inputOperation = this-getInputSocketReader(0); + sx = data-sizex * this-size/2.0f; + sy = data-sizey * this-size/2.0f; +} + +void FastGaussianBlurOperation::deinitExecution(){ + this-inputOperation = NULL; + this-data = NULL; +} + +void FastGaussianBlurOperation::executePixel(float *color,int x, int y, MemoryBuffer *inputBuffers[], void *data
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [46301] branches/tile/source/blender/ compositor/nodes/COM_BlurNode.cpp: Tile Branche
Revision: 46301 http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=46301 Author: mdewanchand Date: 2012-05-04 21:31:34 + (Fri, 04 May 2012) Log Message: --- Tile Branche [#31242] Fast Gaussian blur results in a black screen Added viewer Modified Paths: -- branches/tile/source/blender/compositor/nodes/COM_BlurNode.cpp Modified: branches/tile/source/blender/compositor/nodes/COM_BlurNode.cpp === --- branches/tile/source/blender/compositor/nodes/COM_BlurNode.cpp 2012-05-04 21:28:21 UTC (rev 46300) +++ branches/tile/source/blender/compositor/nodes/COM_BlurNode.cpp 2012-05-04 21:31:34 UTC (rev 46301) @@ -49,6 +49,7 @@ this-getInputSocket(0)-relinkConnections(operationfgb-getInputSocket(0), true, 0, graph); this-getOutputSocket(0)-relinkConnections(operationfgb-getOutputSocket(0)); graph-addOperation(operationfgb); + ddPreviewOperation(graph, operationfgb-getOutputSocket(), 5); }else if (!data-bokeh) { GaussianXBlurOperation *operationx = new GaussianXBlurOperation(); operationx-setData(data); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [46302] branches/tile/source/blender/ compositor: Tile branche
Revision: 46302 http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=46302 Author: mdewanchand Date: 2012-05-04 21:45:51 + (Fri, 04 May 2012) Log Message: --- Tile branche [#31242] Fast Gaussian blur results in a black screen Modified Paths: -- branches/tile/source/blender/compositor/nodes/COM_BlurNode.cpp branches/tile/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp branches/tile/source/blender/compositor/operations/COM_FastGaussianBlurOperation.h Modified: branches/tile/source/blender/compositor/nodes/COM_BlurNode.cpp === --- branches/tile/source/blender/compositor/nodes/COM_BlurNode.cpp 2012-05-04 21:31:34 UTC (rev 46301) +++ branches/tile/source/blender/compositor/nodes/COM_BlurNode.cpp 2012-05-04 21:45:51 UTC (rev 46302) @@ -44,12 +44,12 @@ } if (data-filtertype == R_FILTER_FAST_GAUSS) { FastGaussianBlurOperation *operationfgb = new FastGaussianBlurOperation(); - operationfgb-setdata(data); + operationfgb-setData(data); operationfgb-setSize(size); this-getInputSocket(0)-relinkConnections(operationfgb-getInputSocket(0), true, 0, graph); this-getOutputSocket(0)-relinkConnections(operationfgb-getOutputSocket(0)); graph-addOperation(operationfgb); - ddPreviewOperation(graph, operationfgb-getOutputSocket(), 5); + addPreviewOperation(graph, operationfgb-getOutputSocket(), 5); }else if (!data-bokeh) { GaussianXBlurOperation *operationx = new GaussianXBlurOperation(); operationx-setData(data); Modified: branches/tile/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp === --- branches/tile/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp 2012-05-04 21:31:34 UTC (rev 46301) +++ branches/tile/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp 2012-05-04 21:45:51 UTC (rev 46302) @@ -24,25 +24,15 @@ #include MEM_guardedalloc.h #include BLI_utildefines.h -FastGaussianBlurOperation::FastGaussianBlurOperation(): NodeOperation(){ - this-inputOperation = NULL; - this-addInputSocket(COM_DT_COLOR); - this-addOutputSocket(COM_DT_COLOR); - this-setComplex(true); - this-data = NULL; +FastGaussianBlurOperation::FastGaussianBlurOperation(): BlurBaseOperation(){ } void FastGaussianBlurOperation::initExecution(){ - this-inputOperation = this-getInputSocketReader(0); + BlurBaseOperation::initExecution(); sx = data-sizex * this-size/2.0f; sy = data-sizey * this-size/2.0f; } -void FastGaussianBlurOperation::deinitExecution(){ - this-inputOperation = NULL; - this-data = NULL; -} - void FastGaussianBlurOperation::executePixel(float *color,int x, int y, MemoryBuffer *inputBuffers[], void *data) { MemoryBuffer *newData = (MemoryBuffer*)data; @@ -62,7 +52,7 @@ } void* FastGaussianBlurOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers){ - MemoryBuffer *newBuf = (MemoryBuffer*)this-inputOperation-initializeTileData(rect, memoryBuffers); + MemoryBuffer *newBuf = (MemoryBuffer*)this-inputProgram-initializeTileData(rect, memoryBuffers); MemoryBuffer *copy = newBuf-duplicate(); int c; Modified: branches/tile/source/blender/compositor/operations/COM_FastGaussianBlurOperation.h === --- branches/tile/source/blender/compositor/operations/COM_FastGaussianBlurOperation.h 2012-05-04 21:31:34 UTC (rev 46301) +++ branches/tile/source/blender/compositor/operations/COM_FastGaussianBlurOperation.h 2012-05-04 21:45:51 UTC (rev 46302) @@ -23,14 +23,11 @@ #ifndef _COM_FastGaussianBlurOperation_h #define _COM_FastGaussianBlurOperation_h -#include COM_NodeOperation.h +#include COM_BlurBaseOperation.h #include DNA_node_types.h -class FastGaussianBlurOperation: public NodeOperation { +class FastGaussianBlurOperation: public BlurBaseOperation { private: - SocketReader *inputOperation; - NodeBlurData *data; - float size; float sx; float sy; public: @@ -39,9 +36,6 @@ void executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data); void initExecution(); - void deinitExecution(); - void setdata(NodeBlurData *data){this-data = data;} - void setSize(float size){this-size = size;} void IIR_gauss(MemoryBuffer *src, float sigma, int channel, int xy); void* initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers); void deinitializeTileData(rcti *rect, MemoryBuffer **memoryBuffers, void