Skip to content

add_scene_3d_instanceAddScene3dInstanceAddScene3dInstanceadd_scene_3d_instanceT_add_scene_3d_instance🔗

Short description🔗

add_scene_3d_instanceAddScene3dInstanceAddScene3dInstanceadd_scene_3d_instanceT_add_scene_3d_instance — Add an instance of a 3D object model to a 3D scene.

Signature🔗

add_scene_3d_instance( scene_3d Scene3D, object_model_3d ObjectModel3D, pose Pose, out integer InstanceIndex )void AddScene3dInstance( const HTuple& Scene3D, const HTuple& ObjectModel3D, const HTuple& Pose, HTuple* InstanceIndex )static void HOperatorSet.AddScene3dInstance( HTuple scene3D, HTuple objectModel3D, HTuple pose, out HTuple instanceIndex )def add_scene_3d_instance( scene_3d: HHandle, object_model_3d: MaybeSequence[HHandle], pose: Sequence[Union[float, int]] ) -> int

Herror T_add_scene_3d_instance( const Htuple Scene3D, const Htuple ObjectModel3D, const Htuple Pose, Htuple* InstanceIndex )

Hlong HScene3D::AddScene3dInstance( const HObjectModel3DArray& ObjectModel3D, const HPoseArray& Pose ) const

Hlong HScene3D::AddScene3dInstance( const HObjectModel3D& ObjectModel3D, const HPose& Pose ) const

int HScene3D.AddScene3dInstance( HObjectModel3D[] objectModel3D, HPose[] pose )

int HScene3D.AddScene3dInstance( HObjectModel3D objectModel3D, HPose pose )

Description🔗

add_scene_3d_instanceAddScene3dInstance adds an instance of the 3D model ObjectModel3DobjectModel3Dobject_model_3d to the 3D scene Scene3Dscene3Dscene_3d and returns its index in InstanceIndexinstanceIndexinstance_index. If multiple 3D object models are supplied, it is possible to set one pose for all instances or one pose for every instance.

The pose of the object instance in the scene coordinate system must be given in Poseposepose. The operator set_scene_3d_instance_poseSetScene3dInstancePose can be used to change this pose. As long as no global scene pose is set with set_scene_3d_to_world_poseSetScene3dToWorldPose, this pose is evaluated relative to the world coordinate system.

Parameters of the instance, such as its color, are set with the operator set_scene_3d_instance_paramSetScene3dInstanceParam.

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

Parameters🔗

Scene3Dscene3Dscene_3d (input_control) scene_3d → (handle)HTuple (HHandle)HScene3D, HTuple (IntPtr)HHandleHtuple (handle)

Handle of the 3D scene.

ObjectModel3DobjectModel3Dobject_model_3d (input_control) object_model_3d(-array) → (handle)HTuple (HHandle)HObjectModel3D, HTuple (IntPtr)MaybeSequence[HHandle]Htuple (handle)

Handle of the 3D object model.

Poseposepose (input_control) pose(-array) → (real / integer)HTuple (double / Hlong)HPose, HTuple (double / int / long)Sequence[Union[float, int]]Htuple (double / Hlong)

Pose of the 3D object model.

Number of elements: 7

InstanceIndexinstanceIndexinstance_index (output_control) integer → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Index of the new instance in the 3D scene.

Result🔗

add_scene_3d_instanceAddScene3dInstance returns 2 (H_MSG_TRUE) if all parameters are correct. If necessary, an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

create_scene_3dCreateScene3d

Possible successors

set_scene_3d_instance_paramSetScene3dInstanceParam, set_scene_3d_instance_poseSetScene3dInstancePose

See also

remove_scene_3d_instanceRemoveScene3dInstance

Module🔗

3D Metrology