Files
test2/source/blender/draw/intern/draw_resource.cc
Campbell Barton e955c94ed3 License Headers: Set copyright to "Blender Authors", add AUTHORS
Listing the "Blender Foundation" as copyright holder implied the Blender
Foundation holds copyright to files which may include work from many
developers.

While keeping copyright on headers makes sense for isolated libraries,
Blender's own code may be refactored or moved between files in a way
that makes the per file copyright holders less meaningful.

Copyright references to the "Blender Foundation" have been replaced with
"Blender Authors", with the exception of `./extern/` since these this
contains libraries which are more isolated, any changed to license
headers there can be handled on a case-by-case basis.

Some directories in `./intern/` have also been excluded:

- `./intern/cycles/` it's own `AUTHORS` file is planned.
- `./intern/opensubdiv/`.

An "AUTHORS" file has been added, using the chromium projects authors
file as a template.

Design task: #110784

Ref !110783.
2023-08-16 00:20:26 +10:00

53 lines
1.4 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.h"
/* -------------------------------------------------------------------- */
/** \name ObjectAttributes
* \{ */
/**
* Go through all possible source of the given object uniform attribute.
* Returns true if the attribute was correctly filled.
* This function mirrors lookup_instance_property in cycles/blender/blender_object.cpp
*/
bool ObjectAttribute::sync(const blender::draw::ObjectRef &ref, const GPUUniformAttr &attr)
{
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(Scene *scene, ViewLayer *layer, const GPULayerAttr &attr)
{
hash_code = attr.hash_code;
return BKE_view_layer_find_rgba_attribute(scene, layer, attr.name, &data.x);
}
/** \} */