speckle-sharp icon indicating copy to clipboard operation
speckle-sharp copied to clipboard

Grasshopper Connector - Handling TextToNative() conversion of Speckle.Objects.Other.Text

Open d3ssy opened this issue 2 years ago • 3 comments

Prerequisites

What package are you referring to?

ConnectorGrasshopper

Describe the bug

Speckle.Objects.Other.Text is not converted when deconstruction a Speckle Block in Grasshopper.

To Reproduce

  • Send a Rhino block from Rhino to Speckle
  • Receive block from Speckle in Grasshopper via connector
  • Deconstruct Speckle Object
  • Retrieve Blocks in Stream
  • Deconstruct blocks
  • Access Geometry property
  • Text objects remain unconverted

Expected behavior

  • Convert the text objects to TextTags in Grasshopper, or just as plain text strings.

Screenshots

image

System Info

If applicable, please fill in the below details - they help a lot!

Desktop (please complete the following information):

  • OS: Windows 10

Failure Logs

Additional context

Proposed Solution (if any)

  • Add preprocessor directive and dedicated conversion method on converter:
  • https://github.com/specklesystems/speckle-sharp/blob/b49fe366d75bfac5c704cabc8294c04295d2d6c0/Objects/Converters/ConverterRhinoGh/ConverterRhinoGhShared/ConverterRhinoGh.cs#L665

Optional: Affected Projects

d3ssy avatar Aug 10 '22 10:08 d3ssy

Hey @d3ssy!

We don't convert text entities because Grasshopper does not have a direct translation of what Text actually does, which would lead to quite a lossy conversion.

What would your expected output of this conversion be in GH native types? Just the text?

Since our Text class also holds positioning information, we made the decision of not providing a direct conversion, and just allowing the users to expand the text object and pick the information they needed.

This may not be "ideal", and If you've got suggestions on how this should work we're happy to hear them! 😄

AlanRynne avatar Aug 12 '22 08:08 AlanRynne

Could you move text (and others) to an additional output Other when the input to the DSO gh component is a block. All outputs in Other would not be converted.

d3ssy avatar Aug 12 '22 17:08 d3ssy

Hmm, that would be tricky, as it would be effectively changing the structure of the object being expanded, and this could conflict with an actual property called Other that a user may have created.

If you want to filter out non-converted objects I'd say just plug the output into a Geometry node and then filter by null? Or maybe I'm missing something in your use-case :)

AlanRynne avatar Sep 01 '22 10:09 AlanRynne

Closing this as we're not going to handle Text objects differently in Grasshopper for now.

If there is a need to be able to distinguish between what is a Speckle object and what is not, we could instead make the parameter GH_SpeckleBase public, so you could plug in a random list of objects, and anything that is not a Base object (i.e. anything that was not converted in your case) would be null.

If you feel like this would work for you, feel free to open a separate issue for this. Or reopen this one if you still think this a priority for you :)

AlanRynne avatar Oct 17 '22 20:10 AlanRynne

That is actually a great idea!

On Mon, Oct 17, 2022, 10:47 PM Alan Rynne @.***> wrote:

Closing this as we're not going to handle Text objects differently in Grasshopper for now.

If there is a need to be able to distinguish between what is a Speckle object and what is not, we could instead make the parameter GH_SpeckleBase public, so you could plug in a random list of objects, and anything that is not a Base object (i.e. anything that was not converted in your case) would be null.

If you feel like this would work for you, feel free to open a separate issue for this. Or reopen this one if you still think this a priority for you :)

— Reply to this email directly, view it on GitHub https://github.com/specklesystems/speckle-sharp/issues/1495#issuecomment-1281475346, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPXUIWPLHLGQH7L2XBXU6LWDW3NNANCNFSM56EAJLNQ . You are receiving this because you were mentioned.Message ID: @.***>

d3ssy avatar Oct 19 '22 06:10 d3ssy

@d3ssy made a separate issue for that ☝🏼, should be quite a quick fix so it may go out on our next release 2.10.

Thanks for the feedback!

AlanRynne avatar Oct 27 '22 21:10 AlanRynne