Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore(units): Add units info to root object on send #392

Merged
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
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
Loading