- User Since
- Oct 2 2010, 9:45 PM (520 w, 5 d)
Apr 6 2020
Apr 4 2020
Mar 31 2020
Mar 24 2020
rebased to 28827b62f7777a51bb4899021b5248486d2a4687
Mar 15 2020
Mar 12 2020
Apparently, this bug used to be compensated by another bug, adressed in rBe993667a46c2
This also affects ordinary nested groups.
This case seems resolved in D6484
This case seems resolved in D6484
rebased to current master
This is related, but it's opposite effect.
NodeCustomGroup is needed because it contains reference to NodeTree which should be usercounted.
Mar 11 2020
Feb 29 2020
Added fix for copypasting materials.
Feb 28 2020
Feb 17 2020
improved clarity in names, description, code
Feb 14 2020
I tried to fix it by replacing (approximately) dst_material->nodetree = ntreeCopyTree_ex(src=matcopybuf.nodetree, do_id_user=true) with BKE_id_copy_ex(&matcopybuf, &dst_material, flag)
Feb 11 2020
Still missing some weird cases.
Feb 10 2020
Ok. Quick and dirty fix almost worked, but messed things up. So I abandoned it.
Feb 8 2020
increased code clarity
Feb 7 2020
Added pointer property asserts.
Feb 6 2020
Added copy/remove tests for Material, Light, World, Scene
Feb 4 2020
Jan 26 2020
Jan 14 2020
The patch should be corrected to handle other IDs that contain built-in nodetree, and might contain some NodeCustomGroups
Then I'll put retated information here to avoid any non-automated confusion.
What is the policy, @Dalai Felinto (dfelinto) ?
Jan 8 2020
Dec 31 2019
I've debugged the case once more.
With patch D6484 applied: it makes MATERIAL_OT_copy operation be called with CREATE_NO_MAIN | COPY_NO_API flag set (do not update counter, do not call api), and MATERIAL_OT_paste operation be called with 0 flag (to update counters, and call api).
Without the patch, both operations are called with flag == 0 and (supposed) to update counters twice. But they don't anyway.
I'm sorry for flooding in mail. This is the last update in this year.
Dec 30 2019
The node_tree = None doesn't make any sense here, actually. It remains from some code rearrangements. But it shouldn't affect anything. It's a class property for the case when an instance miss it for some reason.
I failed to understand logic of BKE_library_foreach_ID_link and id_copy_libmanagement_cb which are used within BKE_id_copy_ex to update counters.
But the point is that it prevents updating counters for nodetrees that belong to materials, so that the updating is postponed until all material data has been copied completely.
Dec 29 2019
Added tests for ID.copy applied to a tree, Nodes.clear and BlendDataNodeTrees.remove
@Jacques Lucke (JacquesLucke) , I don't understand everything in details, but it seems to me that the property is deinfed as pointer property in build/source/blender/makesrna/intern/rna_nodetree_gen.c:
Dec 25 2019
Dec 24 2019
Fixed ungrouping test again.
the copy api chould be called and/or user counters incremented.
Dec 23 2019
Dec 21 2019
Refactored assertions to check total calls.
Dec 19 2019
Removed excessive nested node checks, sanity checks.
Dec 18 2019
@Miguel Porces (cmporces), the node copypasting case that you have mentioned is covered by the tests, and they pass.
Am I doing something wrong?
Changed checks of calls to copy to fit API logic.
For copypaste scenario assumtion is based on add-on developer's logic: api method copy is called when node is copied and the argument is a real source node being copied.
Dec 17 2019
Fixed op_material_clone and op_material_copypaste
Dec 16 2019
Dec 14 2019
Solution: tree.nodes.clear() should be called.
Not quite obvious, but fair enough.
Dec 10 2019
Dec 9 2019
Dec 8 2019
Dec 5 2019
When material is copied, function BKE_node_tree_copy_data, sets flag LIB_ID_CREATE_NO_USER_REFCOUNT for copying nodes.
Dec 3 2019
Nov 24 2019
The workaround is to register classes in reverse order: first 'baz', and then 'bar'.
Nov 20 2019
Sep 12 2019
If I do it in object mode with mesh, I can later "apply transform", it resets object scale to 1 and internal parameters (such as skin or edges bevel) will be recalculated. For curves this does not work.