73 return (
raw & 0x80000000u) != 0;
78 return (
raw & 0x7FFFFFFFu);
117class ResourceHandle {
136 return id_.has_inverted_handedness();
160class ResourceHandleRange {
174 return id_.first.raw != 0;
179 return id_.has_inverted_handedness();
184 return id_.id_range();
211 return id_.first.raw;
217 return id_.first.index();
225 friend DupliCacheManager;
231 Object *
const dupli_parent_ =
nullptr;
247 Object *dupli_parent =
nullptr,
258 return dupli_parent_ !=
nullptr;
263 return (dupli_parent_ ? dupli_parent_ :
object) == active_object;
268 return duplis_ !=
nullptr;
274 return duplis_->size();
286 return object->object_to_world();
303 if (dupli_parent_ ==
nullptr) {
308 return dupli_object_->random_id * (1.0f /
float(0xFFFFFFFF));
314 float r_value[4])
const
321 object, (*duplis_)[
instance_index], dupli_parent_, name, r_value);
328 object, dupli_object_, dupli_parent_, name, r_value);
340 const LightLinking *light_linking =
object->light_linking;
347 const LightLinking *parent_light_linking = dupli_parent_->light_linking;
353 const LightLinking *light_linking =
object->light_linking;
359 const LightLinking *light_linking =
object->light_linking;
366 const LightLinking *parent_light_linking = dupli_parent_->light_linking;
372 const LightLinking *light_linking =
object->light_linking;
389 flags |= get_flags(*dupli_parent_->runtime);
404 if (dupli_parent_ && dupli_object_) {
406 Collection *collection = dupli_parent_->instance_collection;
407 if (collection !=
nullptr) {
410 dupli_mat = dupli_parent_->object_to_world() * dupli_mat;
413 dupli_mat =
object->object_to_world() *
math::invert(dupli_object_->ob->object_to_world());
422 return dupli_object_->preview_instance_index;
430 return dupli_object_->preview_base_geometry;
442 if (!dupli_parent_ || active_object != dupli_parent_) {
446 if (dupli_parent_->runtime->sculpt_session &&
447 (dupli_parent_->runtime->sculpt_session->mode_type ==
OB_MODE_SCULPT))
458 switch (dupli_parent_->type) {
503 Object *parent_ =
nullptr;
518 ob_ref.dupli_object_)
520 parent_ = ob_ref.dupli_parent_;
523 id_[i] = dupli->persistent_id[i];
524 if (id_[i] == std::numeric_limits<int>::max()) {
531 if (ob_ref.sub_key_ != 0) {
532 sub_key_ = ob_ref.sub_key_;
558 if (hash_value_ != k.hash_value_) {
564 if (parent_ != k.parent_) {
567 if (sub_key_ != k.sub_key_) {
572 if (id_[i] != k.id_[i]) {
575 if (id_[i] == std::numeric_limits<int>::max()) {
Object groups, one object can be in many groups at once.
#define OB_MODE_ALL_PAINT_MESH
#define OB_MODE_ALL_PAINT_GPENCIL
#define SET_FLAG_FROM_TEST(value, test, flag)
constexpr IndexRange()=default
ObjectKey(const ObjectRef &ob_ref, int instance_index)
bool operator==(const ObjectKey &k) const
ObjectKey(const ObjectRef &ob_ref)
bool parent_is_in_edit_paint_mode(const Object *active_object, eObjectMode ob_mode, eContextObjectMode ctx_mode) const
ObjectRef(const ObjectRef &ob_ref, uint sub_key)
bool is_active(const Object *active_object) const
uint64_t get_light_set_membership() const
ObjectRef(Object *ob, Object *dupli_parent=nullptr, DupliObject *dupli_object=nullptr)
uint8_t get_receiver_light_set() const
uint recalc_flags(uint64_t last_update) const
float4x4 object_to_world() const
int preview_instance_index() const
float4x4 particles_matrix() const
uint64_t get_shadow_set_membership() const
bool find_rgba_attribute(const GPUUniformAttr &attr, int instance_index, float r_value[4]) const
const bke::GeometrySet * preview_base_geometry() const
uint8_t get_blocker_shadow_set() const
bool find_rgba_attribute(const char *name, bool use_dupli, int instance_index, float r_value[4]) const
int instances_count() const
float4x4 object_to_world(int instance_index) const
float random(int instance_index) const
friend class ResourceHandle
ResourceHandleRange(ResourceHandle handle)
bool has_inverted_handedness() const
ResourceHandle sub_handle(int index) const
ResourceHandleRange()=default
IndexRange id_range() const
bool has_inverted_handedness() const
friend class ResourceHandleRange
ccl_device_inline dual1 len(const ccl_private dual< T > &a)
static constexpr uint64_t LIGHT_LINK_MASK_ALL
CartesianBasis invert(const CartesianBasis &basis)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
unsigned __int64 uint64_t
BLI_INLINE unsigned int BLI_hash_int_2d(unsigned int kx, unsigned int ky)
bool BKE_object_dupli_find_rgba_attribute(const Object *ob, const DupliObject *dupli, const Object *dupli_parent, const char *name, float r_value[4])
MatBase< float, 4, 4 > float4x4
@ CTX_MODE_EDIT_POINTCLOUD
@ CTX_MODE_EDIT_GREASE_PENCIL
VecBase< float, 4 > float4
constexpr int MAX_DUPLI_RECUR
T * DEG_get_original(T *id)
BLI_INLINE unsigned int BLI_hash_string(const char *str)
VecBase< float, 3 > float3
bool DRW_object_is_in_edit_mode(const Object *ob)
constexpr uint64_t get_default_hash(const T &v, const Args &...args)
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
uint8_t blocker_shadow_set
uint8_t receiver_light_set
uint64_t light_set_membership
uint64_t shadow_set_membership
LightLinkingRuntime runtime
static MatBase identity()
bke::ObjectRuntime * runtime
ResourceIDRange()=default
ResourceIDRange(ResourceID first_id, uint len)
bool has_inverted_handedness() const
ResourceIDRange(ResourceID id)
IndexRange id_range() const
bool has_inverted_handedness() const
ResourceID(uint index, bool inverted_handedness)