Blender V5.0
curves.cpp File Reference
#include <optional>
#include "blender/attribute_convert.h"
#include "blender/sync.h"
#include "blender/util.h"
#include "scene/attribute.h"
#include "scene/camera.h"
#include "scene/curves.h"
#include "scene/hair.h"
#include "scene/object.h"
#include "scene/scene.h"
#include "util/color.h"
#include "util/hash.h"
#include "util/log.h"
#include "BKE_attribute.hh"
#include "BKE_curves.hh"

Go to the source code of this file.

Functions

static float shaperadius (const float shape, const float root, const float tip, const float time)
static bool ObtainCacheParticleData (Hair *hair, BL::Mesh *b_mesh, BL::Object *b_ob, ParticleCurveData *CData, bool background)
static bool ObtainCacheParticleUV (Hair *hair, BL::Mesh *b_mesh, BL::Object *b_ob, ParticleCurveData *CData, bool background, const int uv_num)
static bool ObtainCacheParticleVcol (Hair *hair, BL::Mesh *b_mesh, BL::Object *b_ob, ParticleCurveData *CData, bool background, const int vcol_num)
static void ExportCurveSegments (Scene *scene, Hair *hair, ParticleCurveData *CData)
static float4 CurveSegmentMotionCV (ParticleCurveData *CData, const int sys, const int curve, const int curvekey)
static float4 LerpCurveSegmentMotionCV (ParticleCurveData *CData, const int sys, const int curve, const float step)
static void export_hair_motion_validate_attribute (Hair *hair, const int motion_step, const int num_motion_keys, bool have_motion)
static void ExportCurveSegmentsMotion (Hair *hair, ParticleCurveData *CData, const int motion_step)
template<typename TypeInCycles, typename GetValueAtIndex>
static void fill_generic_attribute (const int num_curves, const int num_points, TypeInCycles *data, const AttributeElement element, const GetValueAtIndex &get_value_at_index)
static void attr_create_motion_from_velocity (Hair *hair, const blender::Span< blender::float3 > src, const float motion_scale)
static void attr_create_generic (Scene *scene, Hair *hair, const blender::bke::CurvesGeometry &b_curves, const bool need_motion, const float motion_scale)
static float4 curve_point_as_float4 (const blender::Span< blender::float3 > b_positions, const blender::Span< float > b_radius, const int index)
static float4 interpolate_curve_points (const blender::Span< blender::float3 > b_positions, const blender::Span< float > b_radius, const int first_point_index, const int num_points, const float step)
static void export_hair_curves (Scene *scene, Hair *hair, const blender::bke::CurvesGeometry &b_curves, const bool need_motion, const float motion_scale)
static void export_hair_curves_motion (Hair *hair, const blender::bke::CurvesGeometry &b_curves, const int motion_step)

Function Documentation

◆ attr_create_generic()

◆ attr_create_motion_from_velocity()

void attr_create_motion_from_velocity ( Hair * hair,
const blender::Span< blender::float3 > src,
const float motion_scale )
static

◆ curve_point_as_float4()

float4 curve_point_as_float4 ( const blender::Span< blender::float3 > b_positions,
const blender::Span< float > b_radius,
const int index )
static

◆ CurveSegmentMotionCV()

◆ export_hair_curves()

◆ export_hair_curves_motion()

◆ export_hair_motion_validate_attribute()

void export_hair_motion_validate_attribute ( Hair * hair,
const int motion_step,
const int num_motion_keys,
bool have_motion )
static

◆ ExportCurveSegments()

◆ ExportCurveSegmentsMotion()

◆ fill_generic_attribute()

template<typename TypeInCycles, typename GetValueAtIndex>
void fill_generic_attribute ( const int num_curves,
const int num_points,
TypeInCycles * data,
const AttributeElement element,
const GetValueAtIndex & get_value_at_index )
static

Definition at line 683 of file blender/curves.cpp.

References assert, ATTR_ELEMENT_CURVE, ATTR_ELEMENT_CURVE_KEY, data, element, and i.

◆ interpolate_curve_points()

float4 interpolate_curve_points ( const blender::Span< blender::float3 > b_positions,
const blender::Span< float > b_radius,
const int first_point_index,
const int num_points,
const float step )
static

Definition at line 827 of file blender/curves.cpp.

References clamp(), curve_point_as_float4(), float, min, mix, and step.

Referenced by export_hair_curves_motion().

◆ LerpCurveSegmentMotionCV()

float4 LerpCurveSegmentMotionCV ( ParticleCurveData * CData,
const int sys,
const int curve,
const float step )
static

◆ ObtainCacheParticleData()

◆ ObtainCacheParticleUV()

bool ObtainCacheParticleUV ( Hair * hair,
BL::Mesh * b_mesh,
BL::Object * b_ob,
ParticleCurveData * CData,
bool background,
const int uv_num )
static

◆ ObtainCacheParticleVcol()

bool ObtainCacheParticleVcol ( Hair * hair,
BL::Mesh * b_mesh,
BL::Object * b_ob,
ParticleCurveData * CData,
bool background,
const int vcol_num )
static

◆ shaperadius()

float shaperadius ( const float shape,
const float root,
const float tip,
const float time )
static

Definition at line 32 of file blender/curves.cpp.

References assert, and powf.

Referenced by CurveSegmentMotionCV(), and ExportCurveSegments().