# HasSpline fails for attributes with spline and time samples

**URL:** <https://forum.aousd.org/t/hasspline-fails-for-attributes-with-spline-and-time-samples/2854>\
**Category:** USD\
**Created:** [February 11, 2026, 7:56pm UTC](https://forum.aousd.org/t/hasspline-fails-for-attributes-with-spline-and-time-samples/2854 "2026-02-11T19:56:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![barbalt](https://avatars.discourse-cdn.com/v4/letter/b/3bc359/32.png) [@barbalt](https://forum.aousd.org/u/barbalt)\
**Post date:** [February 11, 2026, 7:56pm UTC](https://forum.aousd.org/t/hasspline-fails-for-attributes-with-spline-and-time-samples/2854/1 "2026-02-11T19:56:13Z")

</div>

Hello,

As the title says, the function HasSpline in an attribute fails if that attribute has both splines and time samples. Is that expected? I’ve tested with usd 25.11 and 24.11

Consider the following code:

```python
stage = Usd.Stage.CreateInMemory()

prim_path = "/TestPrim"

xform = UsdGeom.Xform.Define(stage, prim_path)

prim = xform.GetPrim()

translateXOp = xform.AddTranslateXOp()

translateYOp = xform.AddTranslateYOp()

timeFrames = [1.0, 5.0, 10.0]

xValues = [0.0, 5.0, 10.0]

yValues = [0.0, 3.0, 6.0]

spline = Ts.Spline()

knots = Ts.KnotMap()

for time, value in zip(timeFrames, xValues):

    knot = Ts.Knot()

    knot.SetTime(time)

    knot.SetValue(value)

    knots[time] = knot

spline.SetKnots(knots)

translateXAttr = translateXOp.GetAttr()

translateXAttr.SetSpline(spline)

translateYAttr = translateYOp.GetAttr()

translateYAttr.SetSpline(spline)

for time, value in zip(timeFrames, yValues): # Removing this for loop makes HasSpline become true

    translateXAttr.Set(value, time)

    translateYAttr.Set(value, time)

print(f"translateX:")

print(f" - Has Spline: {translateXAttr.HasSpline()}")

print(f" - Has time samples: {translateXAttr.GetNumTimeSamples() > 0}")

print(f"translateY:")

print(f" - Has Spline: {translateYAttr.HasSpline()}")

print(f" - Has time samples: {translateYAttr.GetNumTimeSamples() > 0}")

```

---

<div class="post-metadata">

**Author:** ![jackohoeg](https://avatars.discourse-cdn.com/v4/letter/j/5e9695/32.png) [@jackohoeg](https://forum.aousd.org/u/jackohoeg)\
**Post date:** [February 12, 2026, 3:13pm UTC](https://forum.aousd.org/t/hasspline-fails-for-attributes-with-spline-and-time-samples/2854/2 "2026-02-12T15:13:23Z")

</div>

Hey @barbalt,

I believe this is expected behavior. The [documentation](https://github.com/PixarAnimationStudios/OpenUSD/blob/v25.11/pxr/usd/usd/attribute.h#L529-L532) on `HasSpline`states:

> Returns true if this attribute has a spline as the strongest value source.

If we refer to section 12.3.2 of v1.0.1 of the [Core Specification](https://drive.google.com/file/d/1lh-28b4mN37WrH2zVM5d0YQ2gZtS8wNO/view), which covers time-based attribute resolution, it states that:

> Time Samples have higher priority over _Spline evaluation_ or _Value clips_.

So if `timeSamples` and `spline` are both authored on the same `spec`, the `timeSamples` will be considered stronger. Therefore, `HasSpline` will return false.

---

<div class="post-metadata">

**Author:** ![barbalt](https://avatars.discourse-cdn.com/v4/letter/b/3bc359/32.png) [@barbalt](https://forum.aousd.org/u/barbalt)\
**Post date:** [February 12, 2026, 3:40pm UTC](https://forum.aousd.org/t/hasspline-fails-for-attributes-with-spline-and-time-samples/2854/3 "2026-02-12T15:40:04Z")

</div>

Hey @jackohoeg thanks for the reply.

I know that USD would prefer to use the time samples over the spline when both are authored, but we can’t retrieve the spline information when that’s the case seems strange to me..

Your answer makes sense though.. This seems to be like the intended behavior..
