Blender
V4.5
source
blender
draw
intern
draw_resource.cc
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2022 Blender Authors
2
*
3
* SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9
#include "
BKE_duplilist.hh
"
10
#include "
GPU_material.hh
"
11
12
#include "
draw_handle.hh
"
13
#include "
draw_shader_shared.hh
"
14
15
/* -------------------------------------------------------------------- */
18
19
bool
ObjectAttribute::sync(
const
blender::draw::ObjectRef
&ref,
const
GPUUniformAttr
&attr)
20
{
21
/* This function mirrors `lookup_instance_property` in `cycles/blender/blender_object.cpp`. */
22
23
hash_code
= attr.
hash_code
;
24
25
/* If requesting instance data, check the parent particle system and object. */
26
if
(attr.
use_dupli
) {
27
return
BKE_object_dupli_find_rgba_attribute
(
28
ref.
object
, ref.
dupli_object
, ref.
dupli_parent
, attr.
name
, &
data_x
);
29
}
30
return
BKE_object_dupli_find_rgba_attribute
(ref.
object
,
nullptr
,
nullptr
, attr.
name
, &
data_x
);
31
}
32
34
35
/* -------------------------------------------------------------------- */
38
39
bool
LayerAttribute::sync(
const
Scene
*scene,
const
ViewLayer
*layer,
const
GPULayerAttr
&attr)
40
{
41
hash_code
= attr.
hash_code
;
42
43
return
BKE_view_layer_find_rgba_attribute
(scene, layer, attr.
name
, &
data
.x);
44
}
45
BKE_duplilist.hh
BKE_object_dupli_find_rgba_attribute
bool BKE_object_dupli_find_rgba_attribute(const Object *ob, const DupliObject *dupli, const Object *dupli_parent, const char *name, float r_value[4])
Definition
object_dupli.cc:2072
BKE_view_layer_find_rgba_attribute
bool BKE_view_layer_find_rgba_attribute(const Scene *scene, const ViewLayer *layer, const char *name, float r_value[4])
Definition
object_dupli.cc:2113
GPU_material.hh
draw_handle.hh
draw_shader_shared.hh
GPULayerAttr
Definition
GPU_material.hh:163
GPULayerAttr::name
char name[256]
Definition
GPU_material.hh:167
GPULayerAttr::hash_code
uint32_t hash_code
Definition
GPU_material.hh:169
GPUUniformAttr
Definition
GPU_material.hh:246
GPUUniformAttr::hash_code
uint32_t hash_code
Definition
GPU_material.hh:252
GPUUniformAttr::use_dupli
bool use_dupli
Definition
GPU_material.hh:253
GPUUniformAttr::name
char name[68]
Definition
GPU_material.hh:250
LayerAttribute::data
float4 data
Definition
draw_shader_shared.hh:281
LayerAttribute::hash_code
uint hash_code
Definition
draw_shader_shared.hh:282
ObjectAttribute::data_x
float data_x
Definition
draw_shader_shared.hh:263
ObjectAttribute::hash_code
uint hash_code
Definition
draw_shader_shared.hh:264
Scene
Definition
DNA_scene_types.h:2106
ViewLayer
Definition
DNA_layer_types.h:149
blender::draw::ObjectRef
Definition
draw_handle.hh:81
blender::draw::ObjectRef::dupli_parent
Object * dupli_parent
Definition
draw_handle.hh:86
blender::draw::ObjectRef::object
Object * object
Definition
draw_handle.hh:82
blender::draw::ObjectRef::dupli_object
DupliObject * dupli_object
Definition
draw_handle.hh:84
Generated on
for Blender by
doxygen
1.15.0