TacoAttrAtLocation = GetAttr('taco', atLocation='/root/whatever') Local tacoInheritedValue = tacoInheritedAttr:getValue() If you just want the first value at time 0.0, there's a convenient method for that in OpScript: Local tacoInheritedValue = tacoInheritedList Local tacoInheritedList = tacoInheritedAttr:getNearestSample(0.0) Convert to a table/list by calling getNearestSample() Local tacoInheritedAttr = Interface.GetGlobalAttr("taco") TacoInheritedList = GetAttr("taco", inherit=True) GetAttr() returns None if not available globally or locally
![lua table insert lua table insert](https://minio.scielo.br/documentstore/1678-4804/QYzbpg7rKB8kJXrNs7K6L3w/29b540fbfe62b4be90ae499f4d9de1b2b0a4302f.gif)
Local tacoSingleValue = tacoAttr:getValue()
![lua table insert lua table insert](https://image1.slideserve.com/2394007/lua-performance-benchmarks4-l.jpg)
If you just want the first value at time 0.0, there's a convenient function for that in Lua: First element (Note that Lua table indices start at 1) Local tacoList = tacoAttr:getNearestSample(0.0) Convert to a table/list by calling the getNearestSample method Local tacoAttr = Interface.GetAttr("taco")
![lua table insert lua table insert](https://cdn.educba.com/academy/wp-content/uploads/2021/01/Lua-Table.jpg)
If tacoList: # returns None if not available locally For details on the OpScript API, see the OpScript Reference documentation available from the Help > Documentation menu in Katana. This is not an exhaustive list, but may offer a helpful "cheat sheet" for those with AttributeScripts in existing scenes who may wish to convert over to OpScript.įor more information on OpScript, please refer to Working with Attributes, or look at the OpScript tutorials in the Help > Example Projects menu in Katana. The following Python function examples for AttributeScript have Lua function examples for use with OpScript.