Page MenuHome

Use ntreeContainsTree in more place
Needs ReviewPublic

Authored by Iliya Katueshenock (Moder) on Dec 27 2022, 12:36 PM.

Details

Summary

I tried to unify the code for checking the nodes' group for collision.
I've changed the naming conventions a bit, trying to make them context dependent and more general.


Also, in the future can be add:

  • Map cache to reduce recursion.
  • Text output of collision (inputs: NodeGroup, MyNodeGroup, output: NodeGroup->NodeGroup.001->NodeGroup.002->MyNodeGroup).

Diff Detail

Event Timeline

Iliya Katueshenock (Moder) requested review of this revision.Dec 27 2022, 12:36 PM
Iliya Katueshenock (Moder) created this revision.
Iliya Katueshenock (Moder) retitled this revision from Cleanup: Use ntreeHasTree in more place to Cleanup: Use ntreeContainTree in more place.
Iliya Katueshenock (Moder) edited the summary of this revision. (Show Details)
Iliya Katueshenock (Moder) edited the summary of this revision. (Show Details)
Iliya Katueshenock (Moder) edited the summary of this revision. (Show Details)
  • Merge master
  • Some naming and comment changes
Iliya Katueshenock (Moder) retitled this revision from Cleanup: Use ntreeContainTree in more place to Use ntreeContainsTree in more place.
Iliya Katueshenock (Moder) set the repository for this revision to rB Blender.
Iliya Katueshenock (Moder) edited the summary of this revision. (Show Details)
Hans Goudey (HooglyBoogly) requested changes to this revision.Wed, Jan 25, 11:32 PM

Looks good. Just two naming/tooltip suggestions.

source/blender/makesrna/intern/rna_nodetree.c
12725–12727

This comment can be moved to the function's description. Suggestion: Check if the node tree contains another. Used to avoid creating recursive node groups

12728

contains_in -> contains_group

This revision now requires changes to proceed.Wed, Jan 25, 11:32 PM
source/blender/makesrna/intern/rna_nodetree.c
12728

A . contains_in . B mean, that searching in B group try to find A group.
but
A . contains_group . B mean, that B can containing in A group and this trying to confirm?

source/blender/makesrna/intern/rna_nodetree.c
12728

I think contains_group is clearer. The function acts like a question-- "Does A contain B". A is the subject and B is the direct object. "contains_in" sounds like incorrect grammar IMO

Iliya Katueshenock (Moder) marked 2 inline comments as done.
Iliya Katueshenock (Moder) edited the summary of this revision. (Show Details)
  • Change py method name
Iliya Katueshenock (Moder) marked an inline comment as done.Fri, Jan 27, 3:44 AM
This revision is now accepted and ready to land.Mon, Feb 6, 4:35 AM
This revision now requires review to proceed.Tue, Feb 7, 12:11 AM