@@ -146,16 +146,16 @@ def isSequenceDataType(obj):
146146 IECore .M44fData : (imath .M44f , True ),
147147 IECore .M44dData : (imath .M44d , True ),
148148
149- IECore .BoolVectorData : ( list , False , bool ),
149+ IECore .BoolVectorData : ( list , True , bool ),
150150 IECore .CharVectorData : (list , False , str ),
151151 IECore .UCharVectorData : (list , False , int ),
152- IECore .IntVectorData : (list , False , int ),
152+ IECore .IntVectorData : (list , True , int ),
153153 IECore .UIntVectorData : (list , False , int ),
154154 IECore .HalfVectorData : (list , False , float ),
155155 IECore .FloatVectorData : (list , False , float ),
156- IECore .DoubleVectorData : (list , False , float ),
157- IECore .StringVectorData : (list , False , str ),
158- IECore .InternedStringVectorData : (list , False , IECore .InternedString ),
156+ IECore .DoubleVectorData : (list , True , float ),
157+ IECore .StringVectorData : (list , True , str ),
158+ IECore .InternedStringVectorData : (list , True , IECore .InternedString ),
159159 IECore .ShortVectorData : (list , False , int ),
160160 IECore .UShortVectorData : (list , False , int ),
161161 IECore .Int64VectorData : (list , False , int ),
@@ -166,27 +166,27 @@ def isSequenceDataType(obj):
166166 IECore .V3fVectorDataBase : (list , False , imath .V3f ),
167167 IECore .V3dVectorDataBase : (list , False , imath .V3d ),
168168 IECore .V3iVectorDataBase : (list , False , imath .V3i ),
169- IECore .V2fVectorData : (list , False , imath .V2f ),
170- IECore .V2dVectorData : (list , False , imath .V2d ),
171- IECore .V2iVectorData : (list , False , imath .V2i ),
172- IECore .V3fVectorData : (list , False , imath .V3f ),
173- IECore .V3dVectorData : (list , False , imath .V3d ),
174- IECore .V3iVectorData : (list , False , imath .V3i ),
175- IECore .QuatfVectorData : (list , False , imath .Quatf ),
176- IECore .QuatdVectorData : (list , False , imath .Quatd ),
177- IECore .Box2iVectorData : (list , False , imath .Box2i ),
178- IECore .Box2fVectorData : (list , False , imath .Box2f ),
179- IECore .Box2dVectorData : (list , False , imath .Box2d ),
180- IECore .Box3iVectorData : (list , False , imath .Box3i ),
181- IECore .Box3fVectorData : (list , False , imath .Box3f ),
182- IECore .Box3dVectorData : (list , False , imath .Box3d ),
183- IECore .M33fVectorData : (list , False , imath .M33f ),
184- IECore .M33dVectorData : (list , False , imath .M33d ),
185- IECore .M44fVectorData : (list , False , imath .M44f ),
186- IECore .M44dVectorData : (list , False , imath .M44d ),
187- IECore .Color3fVectorData : (list , False , imath .Color3f ),
169+ IECore .V2fVectorData : (list , True , imath .V2f ),
170+ IECore .V2dVectorData : (list , True , imath .V2d ),
171+ IECore .V2iVectorData : (list , True , imath .V2i ),
172+ IECore .V3fVectorData : (list , True , imath .V3f ),
173+ IECore .V3dVectorData : (list , True , imath .V3d ),
174+ IECore .V3iVectorData : (list , True , imath .V3i ),
175+ IECore .QuatfVectorData : (list , True , imath .Quatf ),
176+ IECore .QuatdVectorData : (list , True , imath .Quatd ),
177+ IECore .Box2iVectorData : (list , True , imath .Box2i ),
178+ IECore .Box2fVectorData : (list , True , imath .Box2f ),
179+ IECore .Box2dVectorData : (list , True , imath .Box2d ),
180+ IECore .Box3iVectorData : (list , True , imath .Box3i ),
181+ IECore .Box3fVectorData : (list , True , imath .Box3f ),
182+ IECore .Box3dVectorData : (list , True , imath .Box3d ),
183+ IECore .M33fVectorData : (list , True , imath .M33f ),
184+ IECore .M33dVectorData : (list , True , imath .M33d ),
185+ IECore .M44fVectorData : (list , True , imath .M44f ),
186+ IECore .M44dVectorData : (list , True , imath .M44d ),
187+ IECore .Color3fVectorData : (list , True , imath .Color3f ),
188188 #IECore.Color3dVectorData: (list, False, IECore.Color3d),
189- IECore .Color4fVectorData : (list , False , imath .Color4f ),
189+ IECore .Color4fVectorData : (list , True , imath .Color4f ),
190190 #IECore.Color4dVectorData: (list, False, IECore.Color4d),
191191
192192 IECore .CompoundData : (dict , True , None ),
@@ -245,6 +245,9 @@ def valueTypeFromSequenceType(sequenceType):
245245## \ingroup python
246246def dataTypeFromElementType (elementType ):
247247
248+ if elementType is list :
249+ raise TypeError ( "`list` type is ambiguous and not a valid input to dataTypeFromElementType()" )
250+
248251 for (dataType , value ) in __dataTypesConversionDict .items ():
249252 if value is None :
250253 continue
@@ -262,7 +265,9 @@ def dataTypeFromElement(element):
262265 # We have to check the list contents.
263266 elementValueType = type (element [0 ])
264267 for (dataType , value ) in __dataTypesConversionDict .items ():
265- if value [0 ] is list and len (value ) >= 2 and value [2 ] is elementValueType :
268+ if value is None :
269+ continue
270+ if value [0 ] is list and len (value ) >= 2 and value [1 ] and value [2 ] is elementValueType :
266271 return dataType
267272
268273 return dataTypeFromElementType (type (element ))
0 commit comments