A selection tool in the style of C4D

I am a designer and I have recently switched from C4D to Blender.
I am missing a tool in Blender that was very useful in C4D, the “Fill Selection” tool. 0071. fill selection in cinema 4d - YouTube
There is no indication that this tool is being developed for Blender.
With the help of Ai GPT, I created this script, but it still doesn’t work.
The installation goes well and I should be able to find the “fill selection” tool in the list of mesh tools, but despite my multiple attempts, nothing happens.

Do you have any ideas? Maybe it’s simply not possible? :slight_smile:
Thx !

bl_info = {
“name”: “Fill selection”,
“author”: “Florian Guzek”,
“version”: (1, 0, 0),
“blender”: (3, 2, 1),
“location”: “View3D > Edit Mode > Tool Shelf”,
“description”: “Fill Selection Tool”,
“warning”: “”,
“wiki_url”: “”,
“tracker_url”: “”,
“category”: “Mesh”,
}

import bpy
import bmesh

def fill_selection(direction):
# Get the active mesh
mesh = bpy.context.view_layer.objects.active.data

# Create a BMesh object from the mesh
bm = bmesh.new()
bm.from_mesh(mesh)

# Expand the selection in the specified direction
if direction == "outward":
    bm.select_history_expand(True)
elif direction == "inward":
    bm.select_history_expand(False)

# Update the mesh with the modified BMesh
bm.to_mesh(mesh)
bm.free()

class FillSelectionOperator(bpy.types.Operator):
bl_idname = “mesh.fill_selection”
bl_label = “Fill Selection”
bl_options = {“REGISTER”, “UNDO”}

direction: bpy.props.EnumProperty(
    name="Direction",
    items=[
        ("outward", "Outward", "Expand the selection outward"),
        ("inward", "Inward", "Expand the selection inward"),
    ],
)

def execute(self, context):
    fill_selection(self.direction)
    return {"FINISHED"}

def register():
bpy.utils.register_class(FillSelectionOperator)

def unregister():
bpy.utils.unregister_class(FillSelectionOperator)

if name == “main”:
register()

Blender has a similar command already, but it’s not an active tool as you would expect… hope it helps…

4 Likes

Funny thread

  1. feature request
  2. of c4d
  3. script from chatgpt :skull:
3 Likes

Hi, my advice is to spend a little more time learning the ropes instead of rushing to develop a feature that’s already there. Then if you’re missing something from C4D that’s actually not in Blender, by all means go for it !

1 Like

Yes, programmers have developed an AI that will take the job of artists, it is normal that artists can in turn take the job of developers!

2 Likes

@Hadriscus That’s a great idea! That way no need for a forum! I’ll get to work on it! Thank you!

@TheRedWaxPolice Yes, that’s almost it. :slight_smile: It works with edges and vertices, not faces. It’s not as convenient but it can help in the meantime. Thank you !

ouch. point taken. :smiley:

1 Like