Abc.ChildIterator Error: This class cannot be instantiated from Python

284 views
Skip to first unread message

Jagadeesh

unread,
Apr 4, 2013, 9:45:24 PM4/4/13
to alembic-d...@googlegroups.com
Hey guys 

I'm using the Alembic python bindings to iterate over the iObjects in an alembic archive. I tried to instantiate the class alembic.Abc.ChildIterator. But I get this error 

Runtime Error: This class cannot be instantiated from Python 

Is this an abstract class ? How do I iterate over the objects in the abc ? 
Any help much appreciated. 

Thanks 
-J 

Lucas Miller

unread,
Apr 5, 2013, 12:11:49 AM4/5/13
to alembic-d...@googlegroups.com

Hopefully this helps:
https://code.google.com/p/alembic/source/browse/python/PyAlembic/Tests/testAlembicImport.py#95

Lucas

--
You received this message because you are subscribed to the Google Groups "alembic-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to alembic-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Jagadeesh

unread,
Apr 8, 2013, 9:44:34 PM4/8/13
to alembic-d...@googlegroups.com
Hey Lucas

Thanks for your reply. I'm using the cask wrapper to dupe a hierarchy of an alembic file to another file. But I get this error in write_to_file() method. It happens when setting the value on property save. 

ERROR: Unhandled type float64_t with extent 16

All array properties throws one of these errors 

ERROR: Unhandled type float64_t with extent 6

No registered converter was able to produce a C++ rvalue of type Alembic::Abc::v4::TypedArraySample<Alembic::Abc::v4::V3fTPTraits> from this Python object of type V3fArray

Am I doing anything wrong ? Any ideas much appreciated.

Thanks 
-J

Lucas Miller

unread,
Apr 8, 2013, 10:31:38 PM4/8/13
to alembic-d...@googlegroups.com

Hmmm I'm not familiar enough with cask to know whether or not its a bug.   It looks like you are trying to read a property that is not a V3f (possibly a matrix) as a V3f.

--

Jagadeesh

unread,
Apr 9, 2013, 5:58:14 AM4/9/13
to alembic-d...@googlegroups.com
Hey Lucas

It has nothing to do with cask I believe. I just tested using the pyalembic property.setValue() method and still I get the same error. I guess there's something is goin wrong with boost python when it's trying to convert the python equivalent of the c++ type. But I believe I compiled it correctly. Not sure where it went wrong. 

-J

Lucas Miller

unread,
Apr 9, 2013, 12:37:19 PM4/9/13
to alembic-d...@googlegroups.com
What are you passing into setValue, and what property are you trying to set?
A simple code snippet would help a lot.

Thanks,

Lucas


--

Ryan Galloway

unread,
Apr 9, 2013, 1:48:44 PM4/9/13
to alembic-d...@googlegroups.com

Here's a simple test for reading via cask. cd into the lib/Alembic/AbcGeom/Tests area and run the AbcGeom_PolyMeshTest. Then in python, see if you can read the properties:

>>> a = cask.Archive("meshOptPropTest.abc")
>>> a.top.children["mesh"].properties[".geom/.selfBnds"].iobject.getDataType().getPod()
alembic.Util.POD.kFloat64POD
>>> a.top.children["mesh"].properties[".geom/.selfBnds"].iobject.getDataType().getExtent()
6
>>> a.top.children["mesh"].properties[".geom/.velocities"].values[0]
<imath.V3fArray object at 0x1090fa0>



--

Jagadeesh

unread,
Apr 9, 2013, 11:18:12 PM4/9/13
to alembic-d...@googlegroups.com
Hey Ryan,

Thanks for your reply. I did a simple test using cask as you said. I printed out the value of the iProperty which is <imath.V3fArray object at 0x22d1280> and when I try to set this value to the oProperty, I get this error 

Error setting <imath.V3fArray object at 0x22d1280> on P 
No registered converter was able to produce a C++ rvalue of type Alembic::Abc::v5::TypedArraySample<Alembic::Abc::v5::V3fTPTraits> from this Python object of type V3fArray

Any ideas ?? 

Thanks 
-J

Jagadeesh

unread,
Apr 9, 2013, 11:27:34 PM4/9/13
to alembic-d...@googlegroups.com
Hey Lucas

https://code.google.com/p/alembic/source/browse/python/PyAlembic/Tests/testCacheCube.py

This is the one that I used to test pyAlembic. And I get the error on the testExportCubeGeom() method. Line 159 vals.setValue( xformvec[0] )

this is the value of xformvec[0] = M44d((1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1))

RuntimeError: ERROR: Unhandled type float64_t with extent 16

Line 174 counts.setValue( faceCounts) throws this error

 TypeError: No registered converter was able to produce a C++ rvalue of type Alembic::Abc::v5::TypedArraySample<Alembic::Abc::v5::Int32TPTraits> from this Python object of type IntArray

Note: All array properties throws this error 

Thanks 
-J

Ryan Galloway

unread,
Apr 16, 2013, 11:15:44 AM4/16/13
to alembic-d...@googlegroups.com

I can't reproduce this and therefore don't have a precise answer for you, but it seems to be a problem in your build of boost, or specifically the extract lib in boost.python. Try rebuilding it and make sure you're using a compatible version (1.48 - 1.52).


Reply all
Reply to author
Forward
0 new messages