Skip to content

Instantly share code, notes, and snippets.

@lukpazera
Last active January 28, 2016 14:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukpazera/ae0bad4cb997e2a6e88a to your computer and use it in GitHub Desktop.
Save lukpazera/ae0bad4cb997e2a6e88a to your computer and use it in GitHub Desktop.
One way to pass item argument to command. Doing the same by using lx.eval and passing item ident is much easier though.
import modo
item = modo.Scene().selected[0]
cmdSvc = lx.service.Command()
cmd = cmdSvc.Spawn(lx.symbol.iCTAG_NULL, 'texture.reference')
attr = lx.object.Attributes(cmd)
val = attr.Value(attr.Lookup("item"), True)
valRef = lx.object.ValueReference(val)
valRef.SetObject(item)
cmd.Execute(lx.symbol.fCMD_EXEC_DEFAULT)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment