Collada parser mostly works for single object/material models

This commit is contained in:
2020-01-30 13:36:34 -06:00
parent b8e53c7a88
commit dbf4edbb93
4 changed files with 39 additions and 8 deletions

View File

@@ -30,8 +30,26 @@ class IMICFPS
def parse
end
def change_object(name)
@model.objects << Model::ModelObject.new(name)
def set_object(id: nil, name: nil)
_model = nil
if id
_model = @model.objects.find { |o| o.id == id }
elsif name
_model = @model.objects.find { |o| o.id == id }
else
raise "Must provide either an id: or name:"
end
if _model
@model.current_object = _model
else
raise "Couldn't find ModelObject!"
end
end
def change_object(id, name)
@model.objects << Model::ModelObject.new(id, name)
@model.current_object = @model.objects.last
end