Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def unpack_materials(entities)

unless material.nil?
if render_material_proxies.has_key?(material.persistent_id.to_s)
render_material_proxies[material.persistent_id.to_s].add_object_id(entity.persistent_id.to_s)
render_material_proxies[material.persistent_id.to_s].try_add_object_id(entity.persistent_id.to_s)
else
convert_material_and_add_to_proxies(material, entity)
end
Expand All @@ -43,7 +43,7 @@ def unpack_materials(entities)
unless back_material.nil?
if render_material_proxies.has_key?(back_material.persistent_id.to_s)
render_material_proxies[back_material.persistent_id.to_s]
.add_object_id("#{entity.persistent_id.to_s}_back")
.try_add_object_id("#{entity.persistent_id.to_s}_back")
else
convert_material_and_add_to_proxies(back_material, entity, true)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ def initialize(sketchup_material, value, object_ids, application_id: nil)
end

# @param object_id [String] application id of the object to add into proxy list
def add_object_id(object_id)
object_ids.append(object_id)
self[:objects] = object_ids
def try_add_object_id(object_id)
unless object_ids.include?(object_id)
object_ids.append(object_id)
self[:objects] = object_ids
end
end
end
end
Expand Down