Skip to content

Commit

Permalink
Merge pull request #6 from mewpull/fix-nil-deref-in-AnimationCurve-st…
Browse files Browse the repository at this point in the history
…ringPrefix-new

add support for FocalLength AnimationCurveNodes
  • Loading branch information
200sc authored Feb 13, 2021
2 parents 2a32fd7 + 7f5aca6 commit d59153e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions animationCurve.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,16 @@ func (acn *AnimationCurveNode) stringPrefix(prefix string) string {
}
s += "bone_link_property=\"" + acn.BoneLinkProp + "\""
s += " mode=" + fmt.Sprintf("%d", acn.mode)

// NOTE: an animation curve node which specify the focal length property has
// exactly one curve (FocalLength), rather than three (X,Y,Z).
if strings.HasPrefix(acn.Object.name, "FocalLength") {
s += "\n" + prefix + "\t"
s += " FocalLength: "
s += acn.Curves[0].String()
return s
}

for i, curve := range acn.Curves {
s += "\n" + prefix + "\t"
switch i {
Expand Down

0 comments on commit d59153e

Please sign in to comment.