Notifications
Clear all
[Closed] Converting INodeList to INodeTab
Aug 01, 2016 3:10 pm
This is probably a stupid question, but is there a preferred method to convert an INodeList to an INodeTab?
I’ve got some code that creates an INodeList, but I want to use this array later in my code with ‘SaveNodes()’ which requires a INodeTab.
import MaxPlus
numLayers = MaxPlus.LayerManager_GetNumLayers()
assets=[]
for i in range(numLayers):
lyrName=MaxPlus.LayerManager_GetLayer(i).GetName()
objs=MaxPlus.LayerManager_GetLayer(i).GetNodes()
if (len(objs)) > 0 :
assets.append(objs)
It’s the code “MaxPlus.LayerManager_GetLayer(i).GetNodes()” that returns the iNodeList
I suppose I can iterate through the list and add the contents to an empty INodeTab, but I wondered if there was some way to cast between the two data types?
I’m also curious to know what the difference is between INodeList and INodeTab and where I should use one over the other for any particular reason.
Thanks in advance for any help!
p.