11 #ifndef __GU_MOTIONCLIPUTIL_H_INCLUDED__
12 #define __GU_MOTIONCLIPUTIL_H_INCLUDED__
43 if (
SYSisEqual(target_rate, source_rate, 1e-2))
48 if (target_rate > source_rate)
69 { myStart =
v; myClampStart =
clamp; }
72 { myStart = clampClipSeconds(v); myClampStart =
clamp; }
80 { myEnd =
v; myClampEnd =
clamp; }
83 { myEnd = clampClipSeconds(v); myClampEnd =
clamp; }
126 bool myClampStart =
false;
127 bool myClampEnd =
false;
140 void initFromTimeMap(
164 { mySourceRate = rate; }
197 {
return myRightEndBehavior; }
208 {
return myLeftEndBehavior; }
219 return mySourceRange == other.mySourceRange
220 && mySourceRate == other.mySourceRate
221 && myRange == other.myRange
222 && myRate == other.myRate
223 && myName == other.myName
224 && mySopPathUsed == other.mySopPathUsed
225 && mySopPath == other.mySopPath
226 && myRightEndBehaviorUsed == other.myRightEndBehaviorUsed
227 && myRightEndBehavior == other.myRightEndBehavior
228 && myLeftEndBehaviorUsed == other.myLeftEndBehaviorUsed
229 && myLeftEndBehavior == other.myLeftEndBehavior;
234 return (!
operator==(other));
248 bool mySopPathUsed{
false};
251 bool myRightEndBehaviorUsed{
false};
255 bool myLeftEndBehaviorUsed{
false};
268 bool isEmpty()
const {
return myOptions.isEmpty(); }
285 void addDetailAttrib(
307 bool update(
const GU_Detail *gdp,
bool &did_change);
316 namespace GU_MotionClipNames
346 if (myClampStart && clip_seconds < myStart)
347 clip_seconds = myStart;
348 else if (myClampEnd && clip_seconds > myEnd)
349 clip_seconds = myEnd;
357 return SYSsafediv(t - myStart, mySpeed) + myPlaybackStart;
363 fpreal t = (scene_seconds - myPlaybackStart)*mySpeed;
367 #endif // __GU_MOTIONCLIPUTIL_H_INCLUDED__
UT_StringHolder leftEndBehavior() const
bool hasInvalidRange() const
Returns true when we have both start/end and start > end.
const UT_StringHolder & sopPath() const
const UT_Vector2R & range() const
fpreal playbackStart() const
void setSourceRate(fpreal rate)
void setClampedEnd(fpreal v, bool clamp=true)
This variant will first clamp v to existing parameters.
void setClampedStart(fpreal v, bool clamp=true)
This variant will first clamp v to existing parameters.
const UT_Vector2R & sourceRange() const
void setSourceRange(fpreal start, fpreal end)
fpreal toClipSeconds(fpreal scene_seconds) const
Convert from scene time to clip time.
GLsizei const GLchar *const * path
void reset()
Reset to default constructed state.
fpreal sourceRate() const
void setPlaybackStart(fpreal v)
Mapper class for conversion between clip and scene time (in seconds)
UT_StringHolder rightEndBehavior() const
const UT_StringHolder & name() const
GU_API const UT_StringHolder blendshape_channel
Attribute storing the channel name that provides the shape's weight.
GU_API const UT_StringHolder blendshape_name
Attribute storing the unique name of the blendshape input.
GU_API const UT_StringHolder blendshape_inbetween_name
Attribute storing the name of a blendshape inbetween.
fpreal toSceneSeconds(fpreal clip_seconds) const
Convert from clip time to scene time.
CH_Manager * CHgetManager()
fpreal getGlobalStart() const
fpreal clampClipSeconds(fpreal clip_seconds) const
Clamp clip time depending to available clip range.
void setRate(fpreal rate)
bool operator==(const GU_MotionClipInfo &other) const
fpreal getGlobalEnd() const
GLuint const GLchar * name
bool isEmpty() const
Returns whether there are any channels in the map.
GU_API const UT_StringHolder blendshape_inbetween_weight
Attribute storing the weight position of a blendshape inbetween.
void setStart(fpreal v, bool clamp=true)
bool SYSequalZero(const UT_Vector3T< T > &v)
bool GUsampleRatesNeedInterpolation(fpreal target_rate, fpreal source_rate)
Returns true if target_rate needs interpolation into source_rate.
void setRange(fpreal start, fpreal end)
bool operator!=(const GU_MotionClipInfo &other) const
void setEnd(fpreal v, bool clamp=true)
void trimRange(fpreal start, fpreal end)
Trim the current range to the given (assumes we have valid range)
void reset()
Reset to the default scene's global range, unclamped.
bool SYSisEqual(const UT_Vector2T< T > &a, const UT_Vector2T< T > &b, S tol=SYS_FTOLERANCE)
Componentwise equality.