For C/C++ doc-strings should be located in headers, move function comments into the headers, in some cases merging with existing doc-strings, in other cases, moving implementation notes into the function body.
50 lines
1.3 KiB
C++
50 lines
1.3 KiB
C++
/* SPDX-FileCopyrightText: 2022 Blender Authors
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
/** \file
|
|
* \ingroup draw
|
|
*/
|
|
|
|
#include "DNA_particle_types.h"
|
|
#include "RNA_access.hh"
|
|
#include "RNA_path.hh"
|
|
#include "RNA_types.hh"
|
|
|
|
#include "draw_handle.hh"
|
|
#include "draw_manager.hh"
|
|
#include "draw_shader_shared.hh"
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
/** \name ObjectAttributes
|
|
* \{ */
|
|
|
|
bool ObjectAttribute::sync(const blender::draw::ObjectRef &ref, const GPUUniformAttr &attr)
|
|
{
|
|
/* This function mirrors `lookup_instance_property` in `cycles/blender/blender_object.cpp`. */
|
|
|
|
hash_code = attr.hash_code;
|
|
|
|
/* If requesting instance data, check the parent particle system and object. */
|
|
if (attr.use_dupli) {
|
|
return BKE_object_dupli_find_rgba_attribute(
|
|
ref.object, ref.dupli_object, ref.dupli_parent, attr.name, &data_x);
|
|
}
|
|
return BKE_object_dupli_find_rgba_attribute(ref.object, nullptr, nullptr, attr.name, &data_x);
|
|
}
|
|
|
|
/** \} */
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
/** \name LayerAttributes
|
|
* \{ */
|
|
|
|
bool LayerAttribute::sync(const Scene *scene, const ViewLayer *layer, const GPULayerAttr &attr)
|
|
{
|
|
hash_code = attr.hash_code;
|
|
|
|
return BKE_view_layer_find_rgba_attribute(scene, layer, attr.name, &data.x);
|
|
}
|
|
|
|
/** \} */
|