Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions cask.py
Original file line number Diff line number Diff line change
Expand Up @@ -1683,5 +1683,19 @@ def __init__(self, *args, **kwargs):

class Points(Object):
"""Points I/O Object subclass."""
_sample_class = alembic.AbcGeom.OPointsSchemaSample
def __init__(self, *args, **kwargs):
super(Points, self).__init__(*args, **kwargs)

def set_positions(self, *args):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see Xform.set_scale, https://github.com/alembic/cask/blob/master/cask.py#L1617

This should probably accept both a V3fArray or a list of values, and check the type.

Suggested change
def set_positions(self, *args):
def set_positions(self, positions):

content = args[0]
# print content
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this

positions = imath.V3fArray(len(content))
ids = imath.IntArray(len(content))
for i in range(0, len(content)):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can then enumerate on the positions to get the id,

Suggested change
for i in range(0, len(content)):
for i, position in enumerate(positions):

positions[i] = content[i]
ids[i] = i
points_sample = alembic.AbcGeom.OPointsSchemaSample()
points_sample.setIds(ids)
points_sample.setPositions(positions)
self.set_sample(points_sample)