Blender
V4.3
source
blender
editors
space_outliner
tree
tree_element_gpencil_effect.cc
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2023 Blender Authors
2
*
3
* SPDX-License-Identifier: GPL-2.0-or-later */
4
9
#include "
DNA_object_types.h
"
10
#include "
DNA_outliner_types.h
"
11
#include "
DNA_shader_fx_types.h
"
12
13
#include "
BLI_listbase.h
"
14
15
#include "
BLT_translation.hh
"
16
17
#include "
../outliner_intern.hh
"
18
19
#include "
tree_element_gpencil_effect.hh
"
20
21
namespace
blender::ed::outliner
{
22
23
TreeElementGPencilEffectBase::TreeElementGPencilEffectBase
(
TreeElement
&legacy_te,
Object
&
object
)
24
:
AbstractTreeElement
(legacy_te), object_(object)
25
{
26
BLI_assert
(legacy_te.
store_elem
->
type
==
TSE_GPENCIL_EFFECT_BASE
);
27
legacy_te.
name
=
IFACE_
(
"Effects"
);
28
}
29
30
void
TreeElementGPencilEffectBase::expand
(
SpaceOutliner
&
/*space_outliner*/
)
const
31
{
32
int
index;
33
LISTBASE_FOREACH_INDEX
(
ShaderFxData
*, fx, &object_.
shader_fx
, index) {
34
add_element
(&
legacy_te_
.
subtree
, &object_.
id
, fx, &
legacy_te_
,
TSE_GPENCIL_EFFECT
, index);
35
}
36
}
37
38
TreeElementGPencilEffect::TreeElementGPencilEffect
(
TreeElement
&legacy_te,
39
Object
&
/*object*/
,
40
ShaderFxData
&fx)
41
:
AbstractTreeElement
(legacy_te),
/* object_(object), */
fx_(fx)
42
{
43
BLI_assert
(legacy_te.
store_elem
->
type
==
TSE_GPENCIL_EFFECT
);
44
legacy_te.
name
= fx_.
name
;
45
legacy_te.
directdata
= &fx_;
46
}
47
48
void
TreeElementGPencilEffect::expand
(
SpaceOutliner
&
/*space_outliner*/
)
const
49
{
50
if
(fx_.
type
==
eShaderFxType_Swirl
) {
51
add_element
(&
legacy_te_
.
subtree
,
52
reinterpret_cast<
ID
*
>
(((
SwirlShaderFxData
*)(&fx_))->object),
53
nullptr
,
54
&
legacy_te_
,
55
TSE_LINKED_OB
,
56
0);
57
}
58
}
59
60
}
// namespace blender::ed::outliner
BLI_assert
#define BLI_assert(a)
Definition
BLI_assert.h:50
BLI_listbase.h
LISTBASE_FOREACH_INDEX
#define LISTBASE_FOREACH_INDEX(type, var, list, index_var)
Definition
BLI_listbase.h:380
BLT_translation.hh
IFACE_
#define IFACE_(msgid)
Definition
BLT_translation.hh:41
DNA_object_types.h
Object is a sort of wrapper for general info.
DNA_outliner_types.h
TSE_GPENCIL_EFFECT
@ TSE_GPENCIL_EFFECT
Definition
DNA_outliner_types.h:111
TSE_GPENCIL_EFFECT_BASE
@ TSE_GPENCIL_EFFECT_BASE
Definition
DNA_outliner_types.h:110
TSE_LINKED_OB
@ TSE_LINKED_OB
Definition
DNA_outliner_types.h:77
DNA_shader_fx_types.h
eShaderFxType_Swirl
@ eShaderFxType_Swirl
Definition
DNA_shader_fx_types.h:26
blender::ed::outliner::AbstractTreeElement
Definition
tree_element.hh:29
blender::ed::outliner::AbstractTreeElement::add_element
TreeElement * add_element(ListBase *lb, ID *owner_id, void *create_data, TreeElement *parent, short type, short index, const bool expand=true) const
Definition
tree_element.cc:240
blender::ed::outliner::AbstractTreeElement::legacy_te_
TreeElement & legacy_te_
Definition
tree_element.hh:36
blender::ed::outliner::TreeElementGPencilEffectBase::expand
void expand(SpaceOutliner &) const override
Definition
tree_element_gpencil_effect.cc:30
blender::ed::outliner::TreeElementGPencilEffectBase::TreeElementGPencilEffectBase
TreeElementGPencilEffectBase(TreeElement &legacy_te, Object &object)
Definition
tree_element_gpencil_effect.cc:23
blender::ed::outliner::TreeElementGPencilEffect::expand
void expand(SpaceOutliner &) const override
Definition
tree_element_gpencil_effect.cc:48
blender::ed::outliner::TreeElementGPencilEffect::TreeElementGPencilEffect
TreeElementGPencilEffect(TreeElement &legacy_te, Object &object, ShaderFxData &fx)
Definition
tree_element_gpencil_effect.cc:38
blender::ed::outliner
Definition
outliner_collections.cc:42
outliner_intern.hh
ID
Definition
DNA_ID.h:413
Object
Definition
DNA_object_types.h:193
Object::shader_fx
ListBase shader_fx
Definition
DNA_object_types.h:247
Object::id
ID id
Definition
DNA_object_types.h:196
ShaderFxData
Definition
DNA_shader_fx_types.h:50
ShaderFxData::type
int type
Definition
DNA_shader_fx_types.h:53
ShaderFxData::name
char name[64]
Definition
DNA_shader_fx_types.h:59
SpaceOutliner
Definition
DNA_space_types.h:289
SwirlShaderFxData
Definition
DNA_shader_fx_types.h:215
TreeStoreElem::type
short type
Definition
DNA_outliner_types.h:16
blender::ed::outliner::TreeElement
Definition
outliner_intern.hh:84
blender::ed::outliner::TreeElement::subtree
ListBase subtree
Definition
outliner_intern.hh:95
blender::ed::outliner::TreeElement::name
const char * name
Definition
outliner_intern.hh:102
blender::ed::outliner::TreeElement::store_elem
TreeStoreElem * store_elem
Definition
outliner_intern.hh:97
blender::ed::outliner::TreeElement::directdata
void * directdata
Definition
outliner_intern.hh:103
tree_element_gpencil_effect.hh
Generated on Thu Feb 6 2025 07:36:39 for Blender by
doxygen
1.11.0