Page MenuHome

Switch Node Polish
ClosedPublic

Authored by Hans Goudey (HooglyBoogly) on May 4 2021, 9:44 PM.

Details

Summary

Based on the task T88006, there are a few simple changes to make to improve the switch node

  • Change the label to "False" / "True" for clarity
  • Change default to geometry, as it's the basic data container in geometry nodes
  • Change node header to NODE_CLASS_CONVERTOR, which was an oversight in the original patch

I will add the new socket types (material and texture) in a separate commit.

Thanks to @Eitan Traurig (EitanSomething) for the original patch.

Diff Detail

Repository
rB Blender
Branch
switch_polishing (branched from master)
Build Status
Buildable 14380
Build 14380: arc lint + arc unit

Event Timeline

Eitan Traurig (EitanSomething) requested review of this revision.May 4 2021, 9:44 PM
Eitan Traurig (EitanSomething) created this revision.

You can use version_node_socket_name to version node links for the change. I guess you can just copy that into versioning_300.c

  • Add versioning

As far as I can tell I did everything right but it hangs when I open a file from the current version of 3.0 with a switch node.

Thanks! It doesn't hang for me in my testing. Could you look into that a little more? Maybe pause execution with a debugger to see where it's stuck?

I would just commit this but I'd like to figure out what's happening for you first.

source/blender/blenloader/intern/versioning_300.c
72

For me this requires #include <string.h> at the top of this file.

115

New lines before and after this block

This revision is now accepted and ready to land.May 7 2021, 6:25 AM

I am using a lite, would that affect anything? I will test it on a more complete build later today to see if that makes a difference.

Jacques Lucke (JacquesLucke) requested changes to this revision.May 10 2021, 1:26 PM

The issue is that the versioning code does not fix all sockets. Remember that there are _001, ... sockets

source/blender/blenloader/intern/versioning_300.c
72

For me too.

This revision now requires changes to proceed.May 10 2021, 1:26 PM

The issue is that the versioning code does not fix all sockets. Remember that there are _001, ... sockets

How would I go about fixing that?

How would I go about fixing that?

Not sure if that is the cleanest way, but you could just create a version of version_node_socket_name that works based on prefixes instead of exact names.

Dalai Felinto (dfelinto) requested changes to this revision.May 27 2021, 1:01 PM

@Eitan Traurig (EitanSomething) hi. If this is something you can't handle, try to get help from other developers from the community, or unclaim the original task, so someone else can pick it up.

@Eitan Traurig (EitanSomething) hi. If this is something you can't handle, try to get help from other developers from the community, or unclaim the original task, so someone else can pick it up.

I currently don't have time to work on it so someone in the community can pick it up

Add versioning code for the rest of the socket names

Hans Goudey (HooglyBoogly) marked an inline comment as done.May 28 2021, 3:45 PM
  • Cleanup: White space
  • Fix broken versioning code: Don't change "switch", no suffix on name
  • Fix dumb logic in versioning code

I've tested this properly now, this should be good.

Jacques Lucke (JacquesLucke) added inline comments.
source/blender/blenloader/intern/versioning_300.c
78

socket->identifier[0] == 'A' ? "False" : "True" -> socket->name

This revision is now accepted and ready to land.May 28 2021, 5:23 PM
This revision was automatically updated to reflect the committed changes.