Skip to content

Commit

Permalink
Add units to root object on send (#392)
Browse files Browse the repository at this point in the history
  • Loading branch information
oguzhankoral authored Sep 23, 2024
1 parent 4fcf11e commit bc3f23d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion speckle_connector_3/src/actions/send_actions/send.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class Send < Action
def self.update_state(state, resolve_id, model_card_id)
# Set active path always to model to be safe always. Later we can address it
state.sketchup_state.sketchup_model.active_path = nil
units = Converters::SKETCHUP_UNITS[state.sketchup_state.length_units]
model_card = state.speckle_state.send_cards[model_card_id]
unless model_card.send_filter.selected_object_ids.any?
resolve_js_script = "sendBinding.receiveResponse('#{resolve_id}')"
Expand All @@ -35,7 +36,7 @@ def self.update_state(state, resolve_id, model_card_id)
end

unpacked_entities = SketchupModel::Definitions::DefinitionManager
.new(Converters::SKETCHUP_UNITS[state.sketchup_state.length_units])
.new(units)
.unpack_entities(entities)

unpacked_materials = SketchupModel::Materials::MaterialManager.new.unpack_materials(entities)
Expand All @@ -50,6 +51,7 @@ def self.update_state(state, resolve_id, model_card_id)
base[:instanceDefinitionProxies] = unpacked_entities.instance_definition_proxies
base[:renderMaterialProxies] = unpacked_materials
base[:colorProxies] = unpacked_colors
base[:units] = units

id, batches, refs = converter.serialize(base, state.user_state.preferences)
new_speckle_state = new_speckle_state.with_object_references(model_card.project_id, refs)
Expand Down

0 comments on commit bc3f23d

Please sign in to comment.