Regular API function

simSetObjectParent / sim.setObjectParent

Description Sets an object's parent object. Dynamically simulated objects, together with their hierarchy tree, will be dynamically reset (this however does not apply to static shapes). See also sim.getObjectParent.
C/C++
synopsis
simInt simSetObjectParent(simInt objectHandle,simInt parentObjectHandle,simBool keepInPlace)
C/C++
parameters
objectHandle: handle of the object that will become child of the parent object. Can be combined with sim_handleflag_assembly (simply add sim_handleflag_assembly to objectHandle), if the two objects can be assembled via a predefined assembly transformation (refer to the assembling option in the object common properties). In that case, parentObjectHandle can't be -1, and keepInPlace should be set to false.
parentObjectHandle: handle of the object that will become parent, or -1 if the object should become parentless.
keepInPlace: indicates whether the object's absolute position and orientation should stay same
C/C++
return value
-1 if operation was not successful
Lua synopsis sim.setObjectParent(int objectHandle,int parentObjectHandle,bool keepInPlace)
Lua parameters
Similar to the C-function counterpart
Lua return values
Python synopsis sim.setObjectParent(int objectHandle,int parentObjectHandle,bool keepInPlace)