Skip to content

Conversation

@shrimo
Copy link

@shrimo shrimo commented Apr 30, 2019

simple class for points.

simple class for points.
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):

# print content
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):


def set_positions(self, *args):
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants