Created
August 21, 2019 11:44
-
-
Save lukpazera/f8f501a35b3455157045734620867d9d to your computer and use it in GitHub Desktop.
This is how to read evaluated setup channels using MODO python SDK. The crucial bit is using scene.SetupChannels() in line 11. Stolen from Foundry's coding slack channel.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scene_svc = lx.service.Scene() | |
sel_svc = lx.service.Selection() | |
pkt_trans = lx.object.ItemPacketTranslation(sel_svc.Allocate(lx.symbol.sSELTYP_ITEM)) | |
sel_type = sel_svc.LookupType(lx.symbol.sSELTYP_ITEM) | |
for i in xrange(sel_svc.Count(sel_type)): | |
pkt = sel_svc.ByIndex(sel_type, i) | |
item = pkt_trans.Item(pkt) | |
scene = item.Context() | |
chanRead = lx.object.ChannelRead(scene.SetupChannels()) | |
index = item.ChannelLookup(lx.symbol.sICHAN_XFRMCORE_WPOSMATRIX) | |
if index > -1: | |
matrix_val = chanRead.ValueObj(item, index) | |
matrix = lx.object.Matrix(matrix_val) | |
print matrix.Get4() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment