Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

edit Points class #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

edit Points class #13

wants to merge 1 commit into from

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