Blender
V4.3
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
9
#include "
DNA_particle_types.h
"
10
#include "
RNA_access.hh
"
11
#include "
RNA_path.hh
"
12
#include "
RNA_types.hh
"
13
14
#include "
draw_handle.hh
"
15
#include "
draw_manager.hh
"
16
#include "
draw_shader_shared.hh
"
17
18
/* -------------------------------------------------------------------- */
22
bool
ObjectAttribute::sync(
const
blender::draw::ObjectRef
&ref,
const
GPUUniformAttr
&attr)
23
{
24
/* This function mirrors `lookup_instance_property` in `cycles/blender/blender_object.cpp`. */
25
26
hash_code
= attr.
hash_code
;
27
28
/* If requesting instance data, check the parent particle system and object. */
29
if
(attr.
use_dupli
) {
30
return
BKE_object_dupli_find_rgba_attribute
(
31
ref.
object
, ref.
dupli_object
, ref.
dupli_parent
, attr.
name
, &
data_x
);
32
}
33
return
BKE_object_dupli_find_rgba_attribute
(ref.
object
,
nullptr
,
nullptr
, attr.
name
, &
data_x
);
34
}
35
38
/* -------------------------------------------------------------------- */
42
bool
LayerAttribute::sync(
const
Scene
*scene,
const
ViewLayer
*layer,
const
GPULayerAttr
&attr)
43
{
44
hash_code
= attr.
hash_code
;
45
46
return
BKE_view_layer_find_rgba_attribute
(scene, layer, attr.
name
, &data.x);
47
}
48
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:1942
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:1983
DNA_particle_types.h
RNA_access.hh
RNA_path.hh
RNA_types.hh
draw_handle.hh
draw_manager.hh
draw_shader_shared.hh
GPULayerAttr
Definition
GPU_material.hh:399
GPULayerAttr::name
char name[68]
Definition
GPU_material.hh:403
GPULayerAttr::hash_code
uint32_t hash_code
Definition
GPU_material.hh:405
GPUUniformAttr
Definition
GPU_material.hh:372
GPUUniformAttr::hash_code
uint32_t hash_code
Definition
GPU_material.hh:378
GPUUniformAttr::use_dupli
bool use_dupli
Definition
GPU_material.hh:379
GPUUniformAttr::name
char name[68]
Definition
GPU_material.hh:376
LayerAttribute::hash_code
uint hash_code
Definition
draw_shader_shared.hh:292
ObjectAttribute::data_x
float data_x
Definition
draw_shader_shared.hh:273
ObjectAttribute::hash_code
uint hash_code
Definition
draw_shader_shared.hh:274
Scene
Definition
DNA_scene_types.h:1988
ViewLayer
Definition
DNA_layer_types.h:151
blender::draw::ObjectRef
Definition
draw_handle.hh:52
blender::draw::ObjectRef::dupli_parent
Object * dupli_parent
Definition
draw_handle.hh:57
blender::draw::ObjectRef::object
Object * object
Definition
draw_handle.hh:53
blender::draw::ObjectRef::dupli_object
DupliObject * dupli_object
Definition
draw_handle.hh:55
Generated on Thu Feb 6 2025 07:36:39 for Blender by
doxygen
1.11.0