Getting alembic frame range as an attribute

   4349   3   1
User Avatar
Member
339 posts
Joined: 12月 2014
Offline
I'd like to grab start and end frames from the alembic SOP as attributes, I can see it in the node info but I'm not sure how to access those values directly, any tips? Thanks!
User Avatar
Member
191 posts
Joined: 10月 2018
Offline
I was looking for the same thing and this is working for me in python:

node = hou.node('/obj/geo1/alembic1')
tree = node.infoTree()
branches = tree.branches()

info = "Alembic SOP Info"

if info in branches :
    rows = branches[info].rows()
    start = ""
    end = ""
    
    for row in rows :
        if row[0] == "Start Frame" :
            start = row[1]
        if row[0] == "End Frame" :
            end = row[1]
    
    if start != "" and end != "" :
        print (start + " - " + end)
else :
    print "No info available."
User Avatar
Member
45 posts
Joined: 4月 2016
Offline
It would be nice if this was added as detail attributes on the alembic import node.
User Avatar
スタッフ
332 posts
Joined: 7月 2005
Offline
The Alembic HOM Extensions provide access to the range of time samples in the Alembic archive. You can convert these to frame values if needed.

import _alembic_hom_extensions as ahe
start_time, end_time = ahe.alembicTimeRange(filename)
  • Quick Links