speckle-sharp
speckle-sharp copied to clipboard
Grasshopper Connector - Handling TextToNative() conversion of Speckle.Objects.Other.Text
Prerequisites
- [x] I read the contribution guidelines
- [x] I checked the documentation and found no answer.
- [x] I checked existing issues and found no similar issue.
- [x] I checked the community forum for related discussions and found no answer.
- [x] I'm reporting the issue to the correct repository (see also speckle-server, speckle-sharp, specklepy, speckle-docs, and others)
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
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
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! 😄
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.
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 :)
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 :)
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 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!