Skip to content

Commit 074f772

Browse files
committed
replaced deprecated API functions
1 parent 1fb62e4 commit 074f772

14 files changed

+16
-18
lines changed

3D text generator.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ function close_callback()
138138
end
139139

140140
function update(generateNew)
141-
local s = sim.getObjectSelection()
141+
local s = sim.getObjectSel()
142142
local parentDummy
143143
if #s == 1 then
144144
local data = sim.readCustomTableData(s[1], '__info__')

Alias change.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ function hideDlg()
7070
end
7171

7272
function replace_callback(ui, id, v)
73-
local selectedObjects = sim.getObjectSelection()
73+
local selectedObjects = sim.getObjectSel()
7474
local originalString = simUI.getEditValue(ui, 1)
7575
local replacementString = simUI.getEditValue(ui, 2)
7676
if #originalString > 0 then

Collision check.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ function sysCall_selChange(inData)
359359
end
360360

361361
function update()
362-
local s = sim.getObjectSelection()
362+
local s = sim.getObjectSel()
363363
local o1 = -1
364364
local o2 = -1
365365
if #s >= 1 and #s <= 2 then

Custom data block explorer.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function sysCall_init()
99
cbor = require 'org.conman.cbor'
1010
sim.addLog(
1111
sim.verbosity_scriptinfos,
12-
"This tool will display the custom data blocks attached to the selected object, or the custom data blocks attached to the scene, if no object is selected. Custom data blocks can be written and read with simWriteCustomDataBlock and simReadCustomDataBlock."
12+
"This tool will display the custom data blocks attached to the selected object, or the custom data blocks attached to the scene, if no object is selected. Custom data blocks can be written and read with sim.writeCustomString/Buffer/TableData and sim.readCustomString/Buffer/TableData."
1313
)
1414
object = -1
1515
selectedDecoder = 1

Define joint group.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function sysCall_init()
1111

1212
-- get selection, expand selected models:
1313
local sel = {}
14-
for _, handle in ipairs(sim.getObjectSelection()) do
14+
for _, handle in ipairs(sim.getObjectSel()) do
1515
table.insert(sel, handle)
1616
if sim.getModelProperty(handle) & sim.modelproperty_not_model == 0 then
1717
for _, handle1 in ipairs(sim.getObjectsInTree(handle, sim.handle_all, 1)) do

Denavit Hartenberg creator.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ function sysCall_selChange(inData)
136136
end
137137

138138
function buildJoint(revoluteJoint)
139-
local sel = sim.getObjectSelection()
139+
local sel = sim.getObjectSel()
140140
local objMatr = sim.getObjectMatrix(sel[1])
141141
if sim.getObjectType(sel[1]) == sim.object_joint_type then
142142
objMatr = sim.multiplyMatrices(objMatr, sim.poseToMatrix(sim.getObjectChildPose(sel[1]))) -- don't forget the joint's intrinsic transformation

Denavit Hartenberg extractor.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ end
66

77
function sysCall_init()
88
simUI = require 'simUI'
9-
local sel = sim.getObjectSelection()
9+
local sel = sim.getObjectSel()
1010
if #sel ~= 1 then
1111
simUI.msgBox(
1212
simUI.msgbox_type.critical, simUI.msgbox_buttons.ok, 'Denavit-Hartenberg extractor',

Distance check.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ function sysCall_selChange(inData)
136136
end
137137

138138
function update()
139-
local s = sim.getObjectSelection()
139+
local s = sim.getObjectSel()
140140
local o1 = -1
141141
local o2 = -1
142142
if #s >= 1 and #s <= 2 then

Inverse Kinematics generator.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ function sysCall_init()
7171
</ui>]]
7272
)
7373
updateUi()
74-
local sel = sim.getObjectSelection()
74+
local sel = sim.getObjectSel()
7575
if #sel == 1 then
7676
local idx = table.find(comboRobotModelHandle, sel[1])
7777
if idx then simUI.setComboboxSelectedIndex(ui, ui_comboRobotModel, idx - 1, false) end

Minimalistic exporter.lua

+3-5
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ function sysCall_init()
7474
file:write("//\n")
7575
file:write("//\n")
7676

77-
local selectedObjects = sim.getObjectSelection()
77+
local selectedObjects = sim.getObjectSel()
7878
local allObjects = sim.getObjectsInTree(sim.handle_scene)
79-
if selectedObjects and #selectedObjects == 1 then
79+
if #selectedObjects == 1 then
8080
allObjects = sim.getObjectsInTree(selectedObjects[1])
8181
end
8282
local allIndividualShapesToRemove = {}
@@ -215,9 +215,7 @@ function sysCall_init()
215215
file:write("\n")
216216
end
217217
file:close()
218-
for i = 1, #allIndividualShapesToRemove, 1 do
219-
sim.removeObject(allIndividualShapesToRemove[i])
220-
end
218+
sim.removeObjects(allIndividualShapesToRemove)
221219
end
222220
return {cmd = 'cleanup'}
223221
end

Motion Planning generator.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function sysCall_init()
2626
</ui>]]
2727
)
2828
updateUi()
29-
local sel = sim.getObjectSelection()
29+
local sel = sim.getObjectSel()
3030
if #sel == 1 then
3131
local idx = table.find(comboRobotModelHandle, sel[1])
3232
if idx then simUI.setComboboxSelectedIndex(ui, ui_comboRobotModel, idx - 1, false) end

Referenced handles explorer.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ function abortEdit()
6363
end
6464

6565
function acceptEdit()
66-
sim.setReferencedHandles(object, sim.getObjectSelection())
66+
sim.setReferencedHandles(object, sim.getObjectSel())
6767
abortEdit()
6868
end
6969

Screenshot tool.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ function render_callback(ui, id, v)
311311
local cutOff = 0
312312
if config.transparent then cutOff = 0.99 end
313313
image, resX, resY = sim.getVisionSensorCharImage(visSens, 0, 0, 0, 0, cutOff)
314-
sim.removeObject(visSens)
314+
sim.removeObjects({visSens})
315315
end
316316

317317
function save_callback(ui, id, v)

Script capture.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ function onObjectAdded(handle)
103103
sim.getObjectInt32Param(handle, sim.shapeintparam_edge_visibility)
104104
)
105105
else
106-
code = string.format('%s=sim.createMeshShape(...)', id)
106+
code = string.format('%s=sim.createShape(...)', id)
107107
end
108108
elseif objType == sim.object_joint_type then
109109
local jointType = sim.getJointType(handle)

0 commit comments

Comments
 (0)