GPv3: Outliner support #111105

Merged
Falk David merged 7 commits from filedescriptor/blender:gpv3-outliner-support into main 2023-08-14 17:40:27 +02:00
Member

This PR adds support for displaying the content of the GPv3 object in the outliner.

image

This PR adds support for displaying the content of the GPv3 object in the outliner. ![image](/attachments/0f125e01-e98e-4e7c-be19-fb5ff1d66302)
Falk David added this to the Grease Pencil project 2023-08-14 10:47:01 +02:00
Falk David requested review from Julian Eisel 2023-08-14 10:47:25 +02:00
Falk David force-pushed gpv3-outliner-support from 05e95fad66 to fe6f8e81ce 2023-08-14 10:48:52 +02:00 Compare
Author
Member

@blender-bot build

@blender-bot build
Julian Eisel requested changes 2023-08-14 11:25:59 +02:00
@ -0,0 +22,4 @@
{
BLI_assert(legacy_te.store_elem->type == TSE_GREASE_PENCIL_NODE);
legacy_te.name = node.name;
legacy_te.directdata = &node;
Member

Let's avoid usages of directdata. All necessary data can be stored directly within TreeElementGreasePencilNode. Code that needs access to it can use tree_element_cast() to get this from the TreeElement, and then use accessors to type-safely get the data.

Let's avoid usages of `directdata`. All necessary data can be stored directly within `TreeElementGreasePencilNode`. Code that needs access to it can use `tree_element_cast()` to get this from the `TreeElement`, and then use accessors to type-safely get the data.
filedescriptor marked this conversation as resolved
@ -0,0 +37,4 @@
&legacy_te_,
TSE_GREASE_PENCIL_NODE,
0,
child->wrap().is_group());
Member

I don't see a reason to use the expand option here. It exists because sometimes we just want to display some objects or collections, without expanding their entire hierarchy. It's mostly a performance workaround. Here there just isn't anything to expand, so the expand() function won't add elements anyway.

I don't see a reason to use the `expand` option here. It exists because sometimes we just want to display some objects or collections, without expanding their entire hierarchy. It's mostly a performance workaround. Here there just isn't anything to expand, so the `expand()` function won't add elements anyway.
Author
Member

I tried setting this to false but then I cannot expand groups with a single child. They show up as if they had no child at all.

I tried setting this to `false` but then I cannot expand groups with a single child. They show up as if they had no child at all.
Member

You don't need to set it at all, it has a default parameter value of true.

You don't need to set it at all, it has a default parameter value of `true`.
Author
Member

Ah that explains it, ok.

Ah that explains it, ok.
filedescriptor marked this conversation as resolved
@ -117,6 +117,7 @@ typedef enum eTreeStoreElemType {
TSE_LIBRARY_OVERRIDE = 45,
TSE_LIBRARY_OVERRIDE_OPERATION = 46,
TSE_GENERIC_LABEL = 47, /* No ID */
TSE_GREASE_PENCIL_NODE = 48, /* No ID */
Member

The comment says this is not an ID, but TreeStoreElem.id actually points to a valid ID. Checking above, it seems like the ID is needed, so the comment can be removed. Otherwise (if it wouldn't actually point to an ID), TSE_IS_REAL_ID() would have to be updated.

The comment says this is not an ID, but `TreeStoreElem.id` actually points to a valid ID. Checking above, it seems like the ID is needed, so the comment can be removed. Otherwise (if it wouldn't actually point to an ID), `TSE_IS_REAL_ID()` would have to be updated.
filedescriptor marked this conversation as resolved
Falk David requested review from Julian Eisel 2023-08-14 12:00:51 +02:00
Author
Member

@JulianEisel Seems like the windows bot is failing, but I don't understand why.

@JulianEisel Seems like the windows bot is failing, but I don't understand why.
Author
Member

I'm also wondering about the current use of the folder icon. I think it fits well but the yellowish color in the outliner doesn't make much sense. It should be light grey like the collections. We also plan to add color tags to them.

@pablovazquez what do you think?

I'm also wondering about the current use of the folder icon. I think it fits well but the yellowish color in the outliner doesn't make much sense. It should be light grey like the collections. We also plan to add color tags to them. @pablovazquez what do you think?
Julian Eisel requested changes 2023-08-14 12:17:02 +02:00
Julian Eisel left a comment
Member

@JulianEisel Seems like the windows bot is failing, but I don't understand why.

Noted the likely fix inline.

> @JulianEisel Seems like the windows bot is failing, but I don't understand why. Noted the likely fix inline.
@ -0,0 +11,4 @@
#include "tree_element.hh"
namespace blender::bke::greasepencil {
struct TreeNode;
Member

Should be class, otherwise MSVC won't build.

Should be `class`, otherwise MSVC won't build.
filedescriptor marked this conversation as resolved
@ -133,6 +134,7 @@ typedef enum eTreeStoreElemType {
TSE_RNA_ARRAY_ELEM, \
TSE_ID_BASE, \
TSE_GP_LAYER, \
TSE_GREASE_PENCIL_NODE, \
Member

Nope, this is still pointing to an ID, so this shouldn't be included here :) (Note the negation: #define TSE_IS_REAL_ID(_tse) (!ELEM(...)))

Nope, this is still pointing to an ID, so this shouldn't be included here :) (Note the negation: `#define TSE_IS_REAL_ID(_tse) (!ELEM(...))`)
filedescriptor marked this conversation as resolved
Member

I'm also wondering about the current use of the folder icon. I think it fits well but the yellowish color in the outliner doesn't make much sense. It should be light grey like the collections. We also plan to add color tags to them.

I actually don't think we should use the folder icon like that. A folder is a metaphor used for file hierarchies on disk, we are not dealing with files here. Does this need an icon even? Or we just use the regular layer icon, I still wonder if we should even expose layers and layer groups as separate concepts to the user. As far as they are concerned a layer may simply support nesting.

> I'm also wondering about the current use of the folder icon. I think it fits well but the yellowish color in the outliner doesn't make much sense. It should be light grey like the collections. We also plan to add color tags to them. I actually don't think we should use the folder icon like that. A folder is a metaphor used for file hierarchies on disk, we are not dealing with files here. Does this need an icon even? Or we just use the regular layer icon, I still wonder if we should even expose layers and layer groups as separate concepts to the user. As far as they are concerned a layer may simply support nesting.
Author
Member

As far as they are concerned a layer may simply support nesting.

The difference is that a layer group cannot be drawn on, they don't store any stroke or animation data. They are simply a way to organize layers together.

So, to me, it wouldn't make sense to have them use the same icon as layers.

> As far as they are concerned a layer may simply support nesting. The difference is that a layer group cannot be drawn on, they don't store any stroke or animation data. They are simply a way to organize layers together. So, to me, it wouldn't make sense to have them use the same icon as layers.
Author
Member

@blender-bot build

@blender-bot build
First-time contributor

I'm also wondering about the current use of the folder icon. I think it fits well but the yellowish color in the outliner doesn't make much sense. It should be light grey like the collections. We also plan to add color tags to them.

@pablovazquez what do you think?

IIRC, wasn't planned to support coloring groups, so i anticipate that it will be reflected in the outliner ?

> I'm also wondering about the current use of the folder icon. I think it fits well but the yellowish color in the outliner doesn't make much sense. It should be light grey like the collections. We also plan to add color tags to them. > > @pablovazquez what do you think? IIRC, wasn't planned to support coloring groups, so i anticipate that it will be reflected in the outliner ?
Author
Member

We also plan to add color tags to them.

@hamza-el-barmaki That's what I said here, yes.

> We also plan to add color tags to them. @hamza-el-barmaki That's what I said here, yes.
Julian Eisel reviewed 2023-08-14 12:49:07 +02:00
@ -0,0 +40,4 @@
&legacy_te_,
TSE_GREASE_PENCIL_NODE,
0,
child->wrap().is_group());
Member

This should still be unnecessary.

This should still be unnecessary.
filedescriptor marked this conversation as resolved
Falk David force-pushed gpv3-outliner-support from ee40b144c9 to 006f44859c 2023-08-14 12:58:19 +02:00 Compare
Falk David requested review from Julian Eisel 2023-08-14 13:43:19 +02:00
Author
Member

@JulianEisel Also let me know if the changes I've made to deal with showing the number of layers in a layer group or in the object-data (using MergedIconRow) are fine. The code is a bit messy there so I'm not too sure of this.

@JulianEisel Also let me know if the changes I've made to deal with showing the number of layers in a layer group or in the object-data (using `MergedIconRow`) are fine. The code is a bit messy there so I'm not too sure of this.
Member

@JulianEisel Also let me know if the changes I've made to deal with showing the number of layers in a layer group or in the object-data (using MergedIconRow) are fine. The code is a bit messy there so I'm not too sure of this.

I wouldn't bother much with it, this code needs refactoring anyway. The recent changes/refactors in the Outliner code should help quite a bit.

> @JulianEisel Also let me know if the changes I've made to deal with showing the number of layers in a layer group or in the object-data (using `MergedIconRow`) are fine. The code is a bit messy there so I'm not too sure of this. I wouldn't bother much with it, this code needs refactoring anyway. The recent changes/refactors in the Outliner code should help quite a bit.
Julian Eisel approved these changes 2023-08-14 15:12:16 +02:00
Julian Eisel left a comment
Member

Accepting, but I still have objections against the folder icon. Maybe commit without this for now?

Accepting, but I still have objections against the folder icon. Maybe commit without this for now?
Author
Member

@JulianEisel For the folder icon: https://devtalk.blender.org/t/ui-discussion-grease-pencil-layer-and-layer-group-icons/30693
Would it be okay to commit as is and wait for the devtalk thread to resolve the questions about the icons? Then create another PR that fixes the icons properly?

@JulianEisel For the folder icon: https://devtalk.blender.org/t/ui-discussion-grease-pencil-layer-and-layer-group-icons/30693 Would it be okay to commit as is and wait for the devtalk thread to resolve the questions about the icons? Then create another PR that fixes the icons properly?
Member

Problem is that such temporary icons often end up in a release and being not so temporary anymore. I would rather remove it entirely for now.

Problem is that such temporary icons often end up in a release and being not so temporary anymore. I would rather remove it entirely for now.
Author
Member

@JulianEisel I would have to do that in the properties panel and dopesheet as well then. I agree that this should not end up in a release, but since GPv3 is experimental, that is unlikely to happen. It's only really there for testing purposes.
But I can create a PR removing it from everywhere if this is really needed.

@JulianEisel I would have to do that in the properties panel and dopesheet as well then. I agree that this should not end up in a release, but since GPv3 is experimental, that is unlikely to happen. It's only really there for testing purposes. But I can create a PR removing it from everywhere if this is really needed.
Julian Eisel approved these changes 2023-08-14 15:39:39 +02:00
Julian Eisel left a comment
Member

Okay, given that this icon is used in other places already I'm fine with keeping it.

Okay, given that this icon is used in other places already I'm fine with keeping it.
Falk David merged commit 310ccbdc33 into main 2023-08-14 17:40:27 +02:00
Falk David deleted branch gpv3-outliner-support 2023-08-14 17:40:29 +02:00
Sign in to join this conversation.
No reviewers
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
3 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#111105
No description provided.