AutoWeightInterface Implementation

内容表

关于

maxon::AutoWeightInterface is the base interface for custom auto-weight algorithms. These algorithms are displayed in the Weight Manager an can be used with the CAWeightMgr class (see CAWeightMgr Manual ).

AutoWeightInterface

The maxon::AutoWeightInterface allows to implement these methods:

Existing functionality (normalizing and smoothing) can be included by using the existing component maxon::AutoWeightComponents::BaseClass.

// This example shows an implementation of AutoWeightInterface.
class ExampleAutoWeightImpl : public maxon::Component <ExampleAutoWeightImpl, maxon::AutoWeightInterface> { MAXON_COMPONENT ( NORMAL , maxon::AutoWeightComponents::BaseClass);
public : MAXON_METHOD maxon::Result<void> CalculateWeights( maxon::BaseArray < maxon::BaseArray<maxon::Float> >& weights, BaseDocument * doc, PolygonObject * op, const maxon::BaseArray<maxon::Bone> & bones, maxon::AutoWeightPointJointSelections & autoWeightPointJointSelections) { iferr_scope ;

// get parameters const maxon::Bool boolValue = self .GetOrDefault(maxonexample::ANIMATION::AUTOWEIGHT::EXAMPLE::ATTRIBUTE); const maxon::Float floatvalue = self .GetOrDefault(maxonexample::ANIMATION::AUTOWEIGHT::EXAMPLE::OTHER_ATTRIBUTE); DiagnosticOutput ( "Values: @, @" , boolValue, floatvalue);

// resize weights array const maxon::Int jointCnt = autoWeightPointJointSelections. _jointCount ; weights.Resize(jointCnt) iferr_return ; for ( maxon::Int jointIndex = 0; jointIndex < jointCnt; ++jointIndex) { weights[jointIndex].Resize(autoWeightPointJointSelections. _pointCount ) iferr_return ; }

// calculate weights

return maxon::OK ; } }; MAXON_COMPONENT_CLASS_REGISTER (ExampleAutoWeightImpl, maxon::AutoWeightAlgos , "net.maxonexample.animation.autoweight.example" );

描述

The custom description of the implementation must include "net.maxon.animation.autoweight.base". The name of the implementation is set using "net.maxon.object.base.name".

延伸阅读

maxon::ComponentWithBase
定义: objectbase.h:2472
maxon::AutoWeightPointJointSelections::_pointCount
Int32 _pointCount
The lock joint selection.
定义: autoweight.h:31
MAXON_COMPONENT
#define MAXON_COMPONENT(KIND,...)
定义: objectbase.h:2036
maxon::OK
return OK
定义: apibase.h:2532
maxon::Bool
bool Bool
boolean type, possible values are only false/true, 8 bit
定义: apibase.h:177
iferr_return
#define iferr_return
定义: resultbase.h:1434
MAXON_COMPONENT_CLASS_REGISTER
#define MAXON_COMPONENT_CLASS_REGISTER(C,...)
定义: objectbase.h:2233
maxon::Float
Float64 Float
定义: apibase.h:193
maxon::BaseArray
定义: basearray.h:366
maxon::AutoWeightAlgos
定义: autoweight.h:105
DiagnosticOutput
#define DiagnosticOutput(formatString,...)
定义: debugdiagnostics.h:166
maxon::Result< void >
MAXON_METHOD
#define MAXON_METHOD
定义: interfacebase.h:855
maxon::Int
Int64 Int
signed 32/64 bit int, size depends on the platform
定义: apibase.h:184
iferr_scope
#define iferr_scope
定义: resultbase.h:1343
maxon::AutoWeightPointJointSelections
定义: autoweight.h:25
SCULPTBRUSHMODE::NORMAL
@ NORMAL
Samples the surface as the user moves over it the SculptObject and returns a new hit point and normal...
PolygonObject
定义: c4d_baseobject.h:1597
BaseDocument
定义: c4d_basedocument.h:490
maxon::AutoWeightPointJointSelections::_jointCount
Int32 _jointCount
The amount of points in the mesh.
定义: autoweight.h:32

Copyright  © 2014-2025 乐数软件    

工业和信息化部: 粤ICP备14079481号-1