Reading vertex colour attributes from Blender Alembic export

   2769   2   0
User Avatar
Member
2 posts
Joined: Oct. 2013
Offline
So I need to extract vertex colours from an Alembic exported in Blender. I'm almost there–using the Python node I can get an empty array of Cd attributes:
import _alembic_hom_extensions as abc

def getAbcAttr(attrName):
    geo = hou.pwd().geometry()
    time = hou.frame() / hou.fps()
    
    if geo.findGlobalAttrib("abcFileName") is not None:
        url = geo.attribValue("abcFileName")

        for childGeo in abc.alembicGetSceneHierarchy(url, "/")[2]:  
            path = "/" + childGeo[0] + "/" + childGeo[2][0][0]
            
            x = abc.alembicArbGeometry(url, path, attrName, time)
            print(x) 
            
getAbcAttr("Cd")

From the abcls output below, can anybody tell me what I need to change in the script to get the attribute values?

/crv_GP_Layer_1_mesh_007/crv_GP_Layer_1_mesh_007Shape/.arbGeomParams:
CompoundProperty Cd {
arrayExtent=1
geoScope=fvr
interpretation=rgba
isGeomParam=true
podExtent=4
podName=float32_t
}
/crv_GP_Layer_1_mesh_007/crv_GP_Layer_1_mesh_007Shape/Cd:
ArrayProperty float32_t[4] .vals[1] {
arrayExtent=1
geoScope=fvr
interpretation=rgba
isGeomParam=true
podExtent=4
podName=float32_t
}
User Avatar
Member
2539 posts
Joined: June 2008
Offline
I submitted this as a Houdini bug but SESI claims it is a Blender export bug.
I have reported this to the Blender developers and there is some investigation in progress.
https://developer.blender.org/T53745 [developer.blender.org]

It is an interesting approach to try and pull the information directly from the .abc file, however.

Are you unpacking your Alembic before you run the Python?
Edited by Enivob - Jan. 18, 2018 15:49:42
Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Member
2 posts
Joined: Oct. 2013
Offline
Yup, I'm unpacking, but the discussion at the link you provided seems to definitively confirm it's a Blender bug, not a Houdini problem. Thanks!
  • Quick Links