Skip to content

Commit

Permalink
Wrap receive into sketchup operation for performance improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
oguzhankoral committed Nov 28, 2023
1 parent ba8b902 commit e5e2729
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions speckle_connector/src/actions/receive_objects.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ def update_state(state)
converter = Converters::ToNative.new(state, @stream_id, @stream_name, @branch_name, @source_app)
# Have side effects on the sketchup model. It effects directly on the entities by adding new objects.
start_time = Time.now.to_f
state.sketchup_state.sketchup_model.start_operation('Receive Speckle Objects', true)
state = converter.receive_commit_object(@base)
if state.user_state.model_preferences[:merge_coplanar_faces]
Converters::CleanUp.merge_coplanar_faces(converter.converted_faces)
end
state.sketchup_state.sketchup_model.commit_operation
elapsed_time = (Time.now.to_f - start_time).round(3)
puts "==== Converting to Native executed in #{elapsed_time} sec ===="
puts "==== Source application is #{@source_app}. ===="
Expand Down

0 comments on commit e5e2729

Please sign in to comment.