# class BoneSettings

Settings for the Simplygon Reduction/Remeshing classes With the BoneSettings object, the user can setup all the parameters for how the BoneLOD processor should simplify the links between geometries and bones. Bones can be un-linked from the geometry either with a set ratio or depending on a selected pixel size on screen.

# Properties

Property Description
BoneReductionTargetBoneCount The desired bone count. The range is 0->inf.
BoneReductionTargetBoneCountEnabled Enable bone count as a reduction target. The reducer will stop when the set bone count has been reached.
BoneReductionTargetBoneRatio The desired bone reduction ratio. The range is 0->1.
BoneReductionTargetBoneRatioEnabled Enable bone ratio as a reduction target. The reducer will stop when the set bone-ratio has been reached.
BoneReductionTargetMaxDeviation The MaxDeviation value, the maximum surface-deviation between the reduced geometry and the original.
BoneReductionTargetMaxDeviationEnabled Enable max deviation as a reduction target. The reducer will stop when the set max deviation has been reached.
BoneReductionTargetOnScreenSize The OnScreenSize value, the maximum surface-deviation between the reduced geometry and the original.
BoneReductionTargetOnScreenSizeEnabled Enable on screen size as a reduction target. The reducer will stop when the set on screen size has been reached.
BoneReductionTargetStopCondition The stop condition for the bone reducer. Any: the reducer will stop when any single one of the set reduction targets have been reached. All: the reducer will stop when all enabled reduction targets have been set.
LimitBonesPerVertex Decides whether unused bones should be removed.
LockBoneSelectionSetID The ID of the selection set that contains all of the bones that will be locked, and cannot be removed in the BoneLOD process. If a bone is locked, all its ancestors will be locked also. If the ID is -1, then no bones are selected.
LockBoneSelectionSetName The name of the selection set that contains all of the bones that will be locked, and cannot be removed in the BoneLOD process. If a bone is locked, all its ancestors will be locked also. If both name and id are set for the locked selection set, the name will be used.
MaxBonePerVertex Decides the maximum limit of how many bones can be connected to each vertex. If for example set to 1, then each vertex will only be linked to 1 bone.
Name The name of the BoneSettings object. (Inherited from Object)
RemoveBoneSelectionSetID The ID of the selection set that contains all of the bones that will be forced to be removed in the BoneLOD process, UNLESS they are locked. If a bone is set to be removed, all its descendants will be removed also. If both name and id are set for the remove selection set, the name will be used.
RemoveBoneSelectionSetName The name of the selection set that contains all of the bones that will be forced to be removed in the BoneLOD process, UNLESS they are locked. If a bone is set to be removed, all its descendants will be removed also. If both name and id are set for the remove selection set, the name will be used.
RemoveUnusedBones Decides whether unused bones should be removed.
UseBoneReducer Enables or disables the bone reduction processing that actually removes bones. Even with this flag off, the bones per vertex can still be limited.

# Methods

Method Description
AddObserver Adds a user-defined observer object to the interface, that will receive events from the interface. (Inherited from Object)
GetBoolParameter Get a named parameter boolean value. (Inherited from SettingsObject)
GetClass Get the name of the BoneSettings class. (Inherited from Object)
GetDoubleParameter Get a named parameter floating point value. (Inherited from SettingsObject)
GetErrorString Returns a string describing the error that was found the last time ValidateSettings was performed. (Inherited from SettingsObject)
GetIntParameter Get a named parameter integer value. (Inherited from SettingsObject)
GetStringParameter Get a named parameter string value. (Inherited from SettingsObject)
GetUIntParameter Get a named parameter unsigned integer value. (Inherited from SettingsObject)
IsA Returns true if BoneSettings is a or is a descendant of the class named as the type parameter. (Inherited from Object)
IsNull Returns true if the BoneSettings object is invalid. (Inherited from Object)
IsSameObjectAs Returns true if the BoneSettings object is valid. (Inherited from Object)
NonNull Returns true if the BoneSettings object is valid. (Inherited from Object)
PrintInfo Prints the content/info of the BoneSettings object to the log. (Inherited from Object)
RemoveObserver Removes a previously added observer object. (Inherited from Object)
SetBoneReductionTargets Set bone reduction targets and stop condition used in the bone reduction.
SetBoolParameter Set a named parameter boolean value. (Inherited from SettingsObject)
SetDoubleParameter Set a named parameter floating point value. (Inherited from SettingsObject)
SetIntParameter Set a named parameter integer value. (Inherited from SettingsObject)
SetStringParameter Set a named parameter string value. (Inherited from SettingsObject)
SetUIntParameter Set a named parameter unsigned integer value. (Inherited from SettingsObject)
SetValidateParameterNames Set if parameter names should be validated or not. Parameters that previously do not exist will generate and error if validation is enabled and be allowed if validation is disabled. (Inherited from SettingsObject)
ToJSON Get settings as JSON for debugging purposes. (Inherited from SettingsObject)
ValidateSettings Validates the current settings values. (Inherited from SettingsObject)

# Static methods

Method Description
IsClassA Returns true if the class is a or is a descendant of the class named as the type parameter. (Inherited from Object)
SafeCast SafeCast makes sure the input object is of a class that can be cast into spBoneSettings, and if this is the case, returns the object cast into spBoneSettings. (Inherited from Object)

# Properties details

# BoneReductionTargetBoneCount

The desired bone count. The range is 0->inf.

# Syntax

// Setter
void SetBoneReductionTargetBoneCount( unsigned int value ) const;

// Getter
unsigned int GetBoneReductionTargetBoneCount() const;

# SetBoneReductionTargetBoneCount parameters

Type Name Min Max Description
unsigned int value 0 UINT_MAX The value to which BoneCount will be set.

# GetBoneReductionTargetBoneCount return value

Type: unsigned int

Default: 100

# BoneReductionTargetBoneCountEnabled

Enable bone count as a reduction target. The reducer will stop when the set bone count has been reached.

# Syntax

// Setter
void SetBoneReductionTargetBoneCountEnabled( bool value ) const;

// Getter
bool GetBoneReductionTargetBoneCountEnabled() const;

# SetBoneReductionTargetBoneCountEnabled parameters

Type Name Min Max Description
bool value The desired value of BoneCountEnabled.

# GetBoneReductionTargetBoneCountEnabled return value

Type: bool

Default: false

# BoneReductionTargetBoneRatio

The desired bone reduction ratio. The range is 0->1.

# Syntax

// Setter
void SetBoneReductionTargetBoneRatio( real value ) const;

// Getter
real GetBoneReductionTargetBoneRatio() const;

# SetBoneReductionTargetBoneRatio parameters

Type Name Min Max Description
real value 0 1 The value to which ReductionRatio will be set.

# GetBoneReductionTargetBoneRatio return value

Type: real

Default: 0.5

# BoneReductionTargetBoneRatioEnabled

Enable bone ratio as a reduction target. The reducer will stop when the set bone-ratio has been reached.

# Syntax

// Setter
void SetBoneReductionTargetBoneRatioEnabled( bool value ) const;

// Getter
bool GetBoneReductionTargetBoneRatioEnabled() const;

# SetBoneReductionTargetBoneRatioEnabled parameters

Type Name Min Max Description
bool value The desired value of BoneRatioEnabled.

# GetBoneReductionTargetBoneRatioEnabled return value

Type: bool

Default: true

# BoneReductionTargetMaxDeviation

The MaxDeviation value, the maximum surface-deviation between the reduced geometry and the original.

# Syntax

// Setter
void SetBoneReductionTargetMaxDeviation( real value ) const;

// Getter
real GetBoneReductionTargetMaxDeviation() const;

# SetBoneReductionTargetMaxDeviation parameters

Type Name Min Max Description
real value 0 REAL_MAX The value to which MaxDeviation will be set.

# GetBoneReductionTargetMaxDeviation return value

Type: real

Default: 0.0

# BoneReductionTargetMaxDeviationEnabled

Enable max deviation as a reduction target. The reducer will stop when the set max deviation has been reached.

# Syntax

// Setter
void SetBoneReductionTargetMaxDeviationEnabled( bool value ) const;

// Getter
bool GetBoneReductionTargetMaxDeviationEnabled() const;

# SetBoneReductionTargetMaxDeviationEnabled parameters

Type Name Min Max Description
bool value The desired value of MaxDeviationEnabled.

# GetBoneReductionTargetMaxDeviationEnabled return value

Type: bool

Default: false

# BoneReductionTargetOnScreenSize

The OnScreenSize value, the maximum surface-deviation between the reduced geometry and the original.

# Syntax

// Setter
void SetBoneReductionTargetOnScreenSize( unsigned int value ) const;

// Getter
unsigned int GetBoneReductionTargetOnScreenSize() const;

# SetBoneReductionTargetOnScreenSize parameters

Type Name Min Max Description
unsigned int value 20 4000 The value to which OnScreenSize will be set.

# GetBoneReductionTargetOnScreenSize return value

Type: unsigned int

Default: 300

# BoneReductionTargetOnScreenSizeEnabled

Enable on screen size as a reduction target. The reducer will stop when the set on screen size has been reached.

# Syntax

// Setter
void SetBoneReductionTargetOnScreenSizeEnabled( bool value ) const;

// Getter
bool GetBoneReductionTargetOnScreenSizeEnabled() const;

# SetBoneReductionTargetOnScreenSizeEnabled parameters

Type Name Min Max Description
bool value Value to set if on screen size should be used in the reduction.

# GetBoneReductionTargetOnScreenSizeEnabled return value

Type: bool

Default: false

# BoneReductionTargetStopCondition

The stop condition for the bone reducer. Any: the reducer will stop when any single one of the set reduction targets have been reached. All: the reducer will stop when all enabled reduction targets have been set.

# Syntax

// Setter
void SetBoneReductionTargetStopCondition( Simplygon::EStopCondition value ) const;

// Getter
Simplygon::EStopCondition GetBoneReductionTargetStopCondition() const;

# SetBoneReductionTargetStopCondition parameters

Type Name Min Max Description
EStopCondition value The flag to which StopCondition will be set.

# GetBoneReductionTargetStopCondition return value

Type: EStopCondition

Default: All

Key Value Comment
Any 0 Simplygon will stop as soon as one of the reduction targets has been fulfilled.
All 1 Simplygon will continue processing until all of the reduction targets have been fulfilled.

# LimitBonesPerVertex

Decides whether unused bones should be removed.

# Syntax

// Setter
void SetLimitBonesPerVertex( bool value ) const;

// Getter
bool GetLimitBonesPerVertex() const;

# SetLimitBonesPerVertex parameters

Type Name Min Max Description
bool value The desired flag value.

# GetLimitBonesPerVertex return value

Type: bool

Default: false

# LockBoneSelectionSetID

The ID of the selection set that contains all of the bones that will be locked, and cannot be removed in the BoneLOD process. If a bone is locked, all its ancestors will be locked also. If the ID is -1, then no bones are selected.

# Syntax

// Setter
void SetLockBoneSelectionSetID( rid value ) const;

// Getter
rid GetLockBoneSelectionSetID() const;

# SetLockBoneSelectionSetID parameters

Type Name Min Max Description
rid value -1 The ID of the selection set.

# GetLockBoneSelectionSetID return value

Type: rid

Default: -1

# LockBoneSelectionSetName

The name of the selection set that contains all of the bones that will be locked, and cannot be removed in the BoneLOD process. If a bone is locked, all its ancestors will be locked also. If both name and id are set for the locked selection set, the name will be used.

# Syntax

// Setter
void SetLockBoneSelectionSetName( const char * value ) const;

// Getter
spString GetLockBoneSelectionSetName() const;

# SetLockBoneSelectionSetName parameters

Type Name Min Max Description
const char * value The name of the selection set.

# GetLockBoneSelectionSetName return value

Type: spString

Default: nullptr

# MaxBonePerVertex

Decides the maximum limit of how many bones can be connected to each vertex. If for example set to 1, then each vertex will only be linked to 1 bone.

# Syntax

// Setter
void SetMaxBonePerVertex( unsigned int value ) const;

// Getter
unsigned int GetMaxBonePerVertex() const;

# SetMaxBonePerVertex parameters

Type Name Min Max Description
unsigned int value 0 SG_NUM_SUPPORTED_BONES_PER_VERTEX The desired maximum bones per vertex.

# GetMaxBonePerVertex return value

Type: unsigned int

Default: SG_NUM_SUPPORTED_BONES_PER_VERTEX

# Name

The name of the BoneSettings object. (Inherited from Object)

# Syntax

// Setter
void SetName( const char * name ) const;

// Getter
spString GetName() const;

# SetName parameters

Type Name Min Max Description
const char * name New name of the object.

# GetName return value

Type: spString

# RemoveBoneSelectionSetID

The ID of the selection set that contains all of the bones that will be forced to be removed in the BoneLOD process, UNLESS they are locked. If a bone is set to be removed, all its descendants will be removed also. If both name and id are set for the remove selection set, the name will be used.

# Syntax

// Setter
void SetRemoveBoneSelectionSetID( rid value ) const;

// Getter
rid GetRemoveBoneSelectionSetID() const;

# SetRemoveBoneSelectionSetID parameters

Type Name Min Max Description
rid value -1 The ID of the selection set.

# GetRemoveBoneSelectionSetID return value

Type: rid

Default: -1

# RemoveBoneSelectionSetName

The name of the selection set that contains all of the bones that will be forced to be removed in the BoneLOD process, UNLESS they are locked. If a bone is set to be removed, all its descendants will be removed also. If both name and id are set for the remove selection set, the name will be used.

# Syntax

// Setter
void SetRemoveBoneSelectionSetName( const char * value ) const;

// Getter
spString GetRemoveBoneSelectionSetName() const;

# SetRemoveBoneSelectionSetName parameters

Type Name Min Max Description
const char * value The name of the selection set.

# GetRemoveBoneSelectionSetName return value

Type: spString

Default: nullptr

# RemoveUnusedBones

Decides whether unused bones should be removed.

# Syntax

// Setter
void SetRemoveUnusedBones( bool value ) const;

// Getter
bool GetRemoveUnusedBones() const;

# SetRemoveUnusedBones parameters

Type Name Min Max Description
bool value The desired flag value.

# GetRemoveUnusedBones return value

Type: bool

Default: false

# UseBoneReducer

Enables or disables the bone reduction processing that actually removes bones. Even with this flag off, the bones per vertex can still be limited.

# Syntax

// Setter
void SetUseBoneReducer( bool value ) const;

// Getter
bool GetUseBoneReducer() const;

# SetUseBoneReducer parameters

Type Name Min Max Description
bool value The desired flag value.

# GetUseBoneReducer return value

Type: bool

Default: false

# Methods details

# AddObserver

Adds a user-defined observer object to the interface, that will receive events from the interface. (Inherited from Object)

# Syntax

rid AddObserver( const spObserver & observer ) const;

# Parameters

Type Name Min Max Description
Observer observer Observer is the object that will receive events.

# Return value

Type: rid

# GetBoolParameter

Get a named parameter boolean value.

# Syntax

bool GetBoolParameter( const char * name ) const;

# Parameters

Type Name Min Max Description
const char * name Parameter name.

# Return value

Type: bool

# GetClass

Get the name of the BoneSettings class. (Inherited from Object)

# Syntax

spString GetClass() const;

# Parameters

GetClass takes no parameters.

# Return value

Type: spString

# GetDoubleParameter

Get a named parameter floating point value.

# Syntax

double GetDoubleParameter( const char * name ) const;

# Parameters

Type Name Min Max Description
const char * name Parameter name.

# Return value

Type: double

# GetErrorString

Returns a string describing the error that was found the last time ValidateSettings was performed.

# Syntax

spString GetErrorString() const;

# Parameters

GetErrorString takes no parameters.

# Return value

Type: spString

# GetIntParameter

Get a named parameter integer value.

# Syntax

int GetIntParameter( const char * name ) const;

# Parameters

Type Name Min Max Description
const char * name Parameter name.

# Return value

Type: int

# GetStringParameter

Get a named parameter string value.

# Syntax

spString GetStringParameter( const char * name ) const;

# Parameters

Type Name Min Max Description
const char * name Parameter name.

# Return value

Type: spString

# GetUIntParameter

Get a named parameter unsigned integer value.

# Syntax

unsigned int GetUIntParameter( const char * name ) const;

# Parameters

Type Name Min Max Description
const char * name Parameter name.

# Return value

Type: unsigned int

# IsA

Returns true if BoneSettings is a or is a descendant of the class named as the type parameter. (Inherited from Object)

# Syntax

bool IsA( const char * type ) const;

# Parameters

Type Name Min Max Description
const char * type Name of the class to check if BoneSettings is, or is a descendant of.

# Return value

Type: bool

# IsNull

Returns true if the BoneSettings object is invalid. (Inherited from Object)

# Syntax

bool IsNull() const;

# Parameters

IsNull takes no parameters.

# Return value

Type: bool

# IsSameObjectAs

Returns true if the BoneSettings object is valid. (Inherited from Object)

# Syntax

bool IsSameObjectAs( const spObject & object ) const;

# Parameters

Type Name Min Max Description
Object object Object to compare with.

# Return value

Type: bool

# NonNull

Returns true if the BoneSettings object is valid. (Inherited from Object)

# Syntax

bool NonNull() const;

# Parameters

NonNull takes no parameters.

# Return value

Type: bool

# PrintInfo

Prints the content/info of the BoneSettings object to the log. (Inherited from Object)

# Syntax

void PrintInfo() const;

# Parameters

PrintInfo takes no parameters.

# RemoveObserver

Removes a previously added observer object. (Inherited from Object)

# Syntax

void RemoveObserver( rid observerId ) const;

# Parameters

Type Name Min Max Description
rid observerId ObserverId is the id returned by AddObserver when the observer was added.

# SetBoneReductionTargets

Set bone reduction targets and stop condition used in the bone reduction.

# Syntax

void SetBoneReductionTargets( Simplygon::EStopCondition stopCondition , bool useBoneRatio , bool useBoneCount , bool useMaxDeviation , bool useOnScreenSize ) const;

# Parameters

Type Name Min Max Description
EStopCondition stopCondition The value to which BoneReductionTargetStopCondition will be set.
bool useBoneRatio The value to which BoneReductionTargetBoneRatioEnabled will be set.
bool useBoneCount The value to which BoneReductionTargetBoneCountEnabled will be set.
bool useMaxDeviation The value to which BoneReductionTargetMaxDeviationEnabled will be set.
bool useOnScreenSize The value to which BoneReductionTargetOnScreenSizeEnabled will be set.

# SetBoolParameter

Set a named parameter boolean value.

# Syntax

bool SetBoolParameter( const char * name , bool value ) const;

# Parameters

Type Name Min Max Description
const char * name Parameter name.
bool value New value for parameter.

# Return value

Type: bool

# SetDoubleParameter

Set a named parameter floating point value.

# Syntax

bool SetDoubleParameter( const char * name , double value ) const;

# Parameters

Type Name Min Max Description
const char * name Parameter name.
double value New value for parameter.

# Return value

Type: bool

# SetIntParameter

Set a named parameter integer value.

# Syntax

bool SetIntParameter( const char * name , int value ) const;

# Parameters

Type Name Min Max Description
const char * name Parameter name.
int value New value for parameter.

# Return value

Type: bool

# SetStringParameter

Set a named parameter string value.

# Syntax

bool SetStringParameter( const char * name , const char * value ) const;

# Parameters

Type Name Min Max Description
const char * name Parameter name.
const char * value New value for parameter.

# Return value

Type: bool

# SetUIntParameter

Set a named parameter unsigned integer value.

# Syntax

bool SetUIntParameter( const char * name , unsigned int value ) const;

# Parameters

Type Name Min Max Description
const char * name Parameter name.
unsigned int value New value for parameter.

# Return value

Type: bool

# SetValidateParameterNames

Set if parameter names should be validated or not. Parameters that previously do not exist will generate and error if validation is enabled and be allowed if validation is disabled.

# Syntax

void SetValidateParameterNames( bool validate ) const;

# Parameters

Type Name Min Max Description
bool validate Flag indicating if validation is performed or not.

# ToJSON

Get settings as JSON for debugging purposes.

# Syntax

spString ToJSON() const;

# Parameters

ToJSON takes no parameters.

# Return value

Type: spString

# ValidateSettings

Validates the current settings values.

# Syntax

bool ValidateSettings() const;

# Parameters

ValidateSettings takes no parameters.

# Return value

Type: bool

# Static methods details

# IsClassA

Returns true if the class is a or is a descendant of the class named as the type parameter. (Inherited from Object)

# Syntax

static bool IsClassA( const char * type ) const;

# Parameters

Type Name Min Max Description
const char * type Name of the class to check if the class is, or is a descendant of.

# Return value

Type: bool

# SafeCast

SafeCast makes sure the input object is of a class that can be cast into spBoneSettings, and if this is the case, returns the object cast into spBoneSettings. (Inherited from Object)

# Syntax

static spBoneSettings SafeCast( const spObject & object ) const;

# Parameters

Type Name Min Max Description
Object object Object to cast.

# Return value

Type: BoneSettings