Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ variable get & set object center example
- example: setObjCent("scene_001", "Rock", 750) --]]
- -- * let's get the object center value * --
- function getObjCent(scnName, scnObj)
- getCent = getObject('Scenes[' .. scnName .. '].SceneObjects[' .. scnObj .. ']'):getInt(VObjectCenter)
- end
- -- * let's set the new object center value & check if it's correct afterwards! * --
- function setObjCent(scnName, scnObj, val)
- getObjCent(scnName, scnObj) -- get the current object center value of the linked object!
- print('Current value of ' .. scnObj .. ' is ' .. getCent ..'!') -- print the current object center value!
- --*--
- getObject('Scenes[' .. scnName .. '].SceneObjects[' .. scnObj .. ']'):setValue(VObjectCenter, val) -- set the new object center value!
- --*--
- getObjCent(scnName, scnObj) -- get the new object center value of the linked object!
- print('New value of ' .. scnObj .. ' is ' .. getCent .. '!') -- print the new object center value!
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement