F2 renaming selection and not only for the active object?

hello

could we rapidly change the code of the new F2 function ?
why is it only for the active object and not only for every single selected object ?
a simple code like that would do it :

textentry = "name"
for ob in bpy.context.selected_objects:
	ob.name = textentry

im learning to code, i’d like to be involved for simple changes like that, but i dont know what’s the actual process of changing the blender master core and post it for review ? any link/tutorials for beginners ?

2 Likes

I guess the standard approach would be to bring the alt key into this per the Blender standard of using alt to apply an operation to all selected objects. Either alt+F2 to bring up the dialog or alt+Enter to confirm the name entry.

alt+F2 looks like it would be the easiest to implement using python. I think alt+Enter would require some more serious C.

1 Like

This does make sense that ALT+F2 or ALT+operator entry should rename all in selection.

Blender REALLY needs to add ALT = apply to all selected to absolutely everything - there are so many inconsistent workflows here.

2 Likes

Could’ someone tell me where to self educate ourself about how to change blender code/compile/post code to review

I’m just now starting to dig into the code myself, but I haven’t tried compiling any changes yet.

Here’s the starting point for windows:
https://wiki.blender.org/wiki/Building_Blender/Windows

I actually brought up the code last night to look into this very thing since it sounded like it would be a simple thing to change. I’m not sure what the best approach to doing this would be because it is mostly handled as a pop-up that displays the property of a single object using python. Located here:
“(install folder)\2.80\scripts\startup\bl_ui\space_topbar.py”. It’s the class called “TOPBAR_PT_name”

There is a simple way to do this by hijacking the way the property is modified directly in this py file, but my impression is that this wouldn’t be the way preferred by BF to handle this. They seem to prefer to use python only to give access to properties in the UI. The real place to change this would be in the C code for how these properties are changed. The way the code is laid out right now, it seems like they don’t have a unified system for applying property changes. Basically, if you want the ALT convention to work for a certain property, you have to handle that on a per property basis. There is a LOT of reused code in Blender. This may be because of the nature of using a non object oriented programming language like C, but I may be wrong about that and it is just a software design issue at the root.

Agreed. Inconsistency is a major issue. I couldn’t tell you off the top of my head what operators and properties can be directly applied to all selected objects and what can’t. I just try it when I need it and hope for the best. Let me put it this way: I’ve gotten good at writing quick “for each” statements in the python console.

DISCLAIMER: I’m a complete hack at this stuff and can usually get scripts to work, but I may or may not be doing so in the best, most efficient way. My knowledge is not deep at all. Just trying to help.