Add Object name to Add Object adjustment panel #62332

Open
opened 2019-03-07 21:21:41 +01:00 by William Reynish · 10 comments

When adding objects, it can be advantageous to set the object name immediately.

We can support this by adding the object name to the Add Object adjustment panel:

image.png

Suggestion by HooglyBoogly on Devtalk.

When adding objects, it can be advantageous to set the object name immediately. We can support this by adding the object name to the Add Object adjustment panel: ![image.png](https://archive.blender.org/developer/F6780753/image.png) Suggestion by HooglyBoogly on Devtalk.
Added subscribers: @WilliamReynish, @CharlieJolly, @schweppie, @Hexbob6, @freemind, @PierreSchiller, @SteffenD, @remotecrab131, @Thane5, @orvb, @brezdo, @iss, @0o00o0oo, @ideasman42, @RamiroCantu, @Regnas

Added subscriber: @DuarteRamos

Added subscriber: @DuarteRamos

While I don't have a strong opinion on this, think overall it's not an improvement but would be interested to know if artists in the studio think this is helpful.


Would rather not have this, there are many properties related to object creation we could allow to edit here.

Editing a name shouldn't be difficult, showing less information up-front and making sure it simple for users to edit things is better.

*While I don't have a strong opinion on this, think overall it's not an improvement but would be interested to know if artists in the studio think this is helpful.* --- Would rather not have this, there are many properties related to object creation we could allow to edit here. Editing a name shouldn't be difficult, showing less information up-front and making sure it simple for users to edit things is better.
Member

Added subscriber: @HooglyBoogly

Added subscriber: @HooglyBoogly
Member

I thought it would be worth it because I end up naming most of the primitives I add in many workflows anyway, so it saves a step of finding it in the outliner or properties.

I'm not sure adding an object name section in the n panel is better than this, and it seems like the alternative. That way you're cluttering the UI that the user always sees rather than presenting one more option when it's most useful.

There could be ways of integrating / hiding it more in the UI that would increase the difficulty of implementation but not have the drawback of another option in the menu. I agree it would be nice to have more opinions.

I thought it would be worth it because I end up naming most of the primitives I add in many workflows anyway, so it saves a step of finding it in the outliner or properties. I'm not sure adding an object name section in the n panel is better than this, and it seems like the alternative. That way you're cluttering the UI that the user always sees rather than presenting one more option when it's most useful. There could be ways of integrating / hiding it more in the UI that would increase the difficulty of implementation but not have the drawback of another option in the menu. I agree it would be nice to have more opinions.
Member

I've been pursuing this for a bit. I thought I would provide an update in case it was helpful to anyone:

As far as I can tell, OBJECT_OT_add is only used for lattices. The other object additions have there own callback functions. So each callback will have to be changed separately. The mesh primitive add functions are in editmesh_add.c.

I added a new function that adds the name property in object_add.c:

void ED_object_add_object_name(wmOperatorType *ot, const char *default_name)
{
    PropertyRNA *prop;
    prop = RNA_def_string(ot->srna, "input_name", default_name, 64, "Name", "The name of the new object");
    RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}

I used this in all of the primitive add functions. The problem is that the same operators are used in edit mode and object mode, so the name field is added in edit mode as well. So I need to check if edit mode is active before adding the property. This looks like the best way to do that:

Object *obedit = CTX_data_edit_object(C);
   
if (obedit == NULL) {...}

However, there is no reference to the blender context in the primitive add functions (MESH_OT_primitive_*_add); the reference is only in the exec functions. Unless there is another way to access whether edit mode is active or not, implementing this change might be more complicated.

I've been pursuing this for a bit. I thought I would provide an update in case it was helpful to anyone: As far as I can tell, `OBJECT_OT_add` is only used for lattices. The other object additions have there own callback functions. So each callback will have to be changed separately. The mesh primitive add functions are in `editmesh_add.c`. I added a new function that adds the name property in `object_add.c`: ``` void ED_object_add_object_name(wmOperatorType *ot, const char *default_name) { PropertyRNA *prop; prop = RNA_def_string(ot->srna, "input_name", default_name, 64, "Name", "The name of the new object"); RNA_def_property_flag(prop, PROP_SKIP_SAVE); } ``` I used this in all of the primitive add functions. The problem is that the same operators are used in edit mode and object mode, so the name field is added in edit mode as well. So I need to check if edit mode is active before adding the property. This looks like the best way to do that: ``` Object *obedit = CTX_data_edit_object(C); if (obedit == NULL) {...} ``` However, there is no reference to the blender context in the primitive add functions (`MESH_OT_primitive_*_add`); the reference is only in the exec functions. Unless there is another way to access whether edit mode is active or not, implementing this change might be more complicated.

Removed subscriber: @brezdo

Removed subscriber: @brezdo

Another concern I have with this is it's going to use the operator redo to re-run the action,
so if users are adding a heavy mesh, they will get a noticeable delay when changing the name.

Then users can reasonably report a bug that renaming is slow, giving us more things to fix.

Another concern I have with this is it's going to use the operator redo to re-run the action, so if users are adding a heavy mesh, they will get a noticeable delay when changing the name. Then users can reasonably report a bug that renaming is slow, giving us more things to fix.

Removed subscriber: @Thane5

Removed subscriber: @Thane5

Removed subscriber: @Hexbob6

Removed subscriber: @Hexbob6
Philipp Oeser removed the
Interest
User Interface
label 2023-02-10 09:25:52 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
7 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#62332
No description provided.