The `Action::last_slot_handle` field is set to a high-ish value, to disambiguate slot handles from array indices. Slot handles are opaque integers, and are just used to find a slot with that particular handle. Its exact value is irrelevant; Blender only ensures that slot handles are never reused within the same Action. This particular value was obtained by taking the 31 most significant bits of the TentHash value (Nathan's hash function) for the string "Quercus&Laksa" (Sybren's cats). Pull Request: https://projects.blender.org/blender/blender/pulls/131310
59 lines
1.2 KiB
C
59 lines
1.2 KiB
C
/* SPDX-FileCopyrightText: 2024 Blender Authors
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
/** \file
|
|
* \ingroup DNA
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <math.h>
|
|
|
|
/* clang-format off */
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
/** \name Action Struct
|
|
* \{ */
|
|
|
|
/* The last_slot_handle is set to a high value to disambiguate slot handles from
|
|
* array indices.
|
|
*
|
|
* This particular value was obtained by taking the 31 most-significant bits of
|
|
* the TentHash value (Nathan's hash function) for the string "Quercus&Laksa"
|
|
* (Sybren's cats). */
|
|
#define DNA_DEFAULT_ACTION_LAST_SLOT_HANDLE 0x37627bf5
|
|
|
|
#define _DNA_DEFAULT_bAction \
|
|
{ \
|
|
.last_slot_handle = DNA_DEFAULT_ACTION_LAST_SLOT_HANDLE, \
|
|
}
|
|
|
|
/** \} */
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
/** \name ActionLayer Struct
|
|
* \{ */
|
|
|
|
#define _DNA_DEFAULT_ActionLayer \
|
|
{ \
|
|
.influence = 1.0f, \
|
|
}
|
|
|
|
/** \} */
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
/** \name ActionStrip Struct
|
|
* \{ */
|
|
|
|
#define _DNA_DEFAULT_ActionStrip \
|
|
{ \
|
|
.data_index = -1, \
|
|
.frame_start = -INFINITY, \
|
|
.frame_end = INFINITY, \
|
|
}
|
|
|
|
/** \} */
|
|
|
|
/* clang-format on */
|