diff --git a/src/scene/Scene.php b/src/scene/Scene.php index 620065f..25599ac 100644 --- a/src/scene/Scene.php +++ b/src/scene/Scene.php @@ -2,6 +2,7 @@ namespace Blobt\Luxcore\scene; +use function PHPSTORM_META\type; class Scene extends BaseCfg { @@ -44,32 +45,32 @@ class Scene extends BaseCfg if( $object instanceof objects\Objects ) { - $temp = 'obj_'.sprintf("%014d",count($this->objects)+1); + $temp = sprintf("%014d",count($this->objects)+1); $this->objects[$temp] = $object; } else if( $object instanceof materials\MaterialsBase ) { - $temp = 'material_'.sprintf("%014d",count($this->materials)+1); + $temp = $object->type.'_'.sprintf("%014d",count($this->materials)+1); $this->materials[$temp] = $object; } else if($object instanceof ligth\LightBase) { - $temp = 'light_'.sprintf("%014d",count($this->lights)+1); + $temp = $object->type.'_'.sprintf("%014d",count($this->lights)+1); $this->lights[$temp] = $object; } else if($object instanceof camera\Camera) { - $temp = 'camera_'.sprintf("%014d",count($this->camera)+1); + $temp = $object->type.'_'.sprintf("%014d",count($this->camera)+1); $this->camera[$temp] = $object; } else if($object instanceof texture\TextureBase) { - $temp = 'texture_'.sprintf("%014d",count($this->textures)+1); + $temp = $object->type.'_'.sprintf("%014d",count($this->textures)+1); $this->textures[$temp] = $object; } else if( $object instanceof volumes\VolumesBase ) { - $temp = 'volume_'.sprintf("%014d",count($this->volumes)+1); + $temp = $object->type.'_'.sprintf("%014d",count($this->volumes)+1); $this->volumes[$temp] = $object; } else;