I’m not sure if this is what you wanted.
PictureSurface.gh (6.8 KB)
Close, but picture surface also automatically tiles itself.
The above surface is a picture surface and the below surface is a just a surface (you can check it in the properties > object type). As you can see, the tiling is automatic
If you change the ‘Size’ panel, and push it to rhino, you can see that the picture surface scales correctly while the grasshopper surface will keep on tiling. Also, in your script you have set the display mode to rendered which is not something I want as it will only reflect in the one active viewport. A picture surface always shows up in any display mode, that is the behavior I want.
picture vs gh surface.3dm (3.4 MB)
picture vs gh surface.gh (24.1 KB)
It works fine on my end, and fyi.
PictureSurface.gh (14.1 KB)
This is similar to the function of the Picture command in Rhino. Essentially, it runs the SetObjectDisplayMode command, setting the object’s display mode to always show as Rendered. This ensures the picture remains visible in any display mode.
Okay yes, your script works in the way I wanted to.
This still does not give me a Picture Surface which as you pointed out is the Picture command from Rhino. Is there no way to create this via grasshopper?
Here is the Grasshopper Surface
surfaceID: 0db124c2-9c4d-4920-bf83-a156d373d99b (121)
Object name: (not named)
Layer name: Grasshopper::Surfaces
Render Material:
source = from obj
index = 3
Attribute UserData:
UserData ID: 2544A64E-220D-4d65-B8D4-611BB57B46C7
Plug-in: Rhino
description: RhinoCommon UserDictionary
saved in file: yes
copy count: 1
Geometry:
Valid surface.
surface.
Plane Surface
“U”: (0.000 <= U <= 500.000)
“V”: (0.000 <= V <= 250.000)
Edge Tally:
4 boundary edges
Edge Tolerances: all 0.000
Vertex Tolerances: all 0.000
Render mesh: 1 mesh 4 vertices 1 polygons
Created with fast meshing parameters.
Analysis mesh: none present
And this is from the Picture Command
picture surfaceID: dd9dc94c-669b-4a3a-8597-2e1740902873 (3)
Object name: 000001.png
Layer name: Default
Render Material:
source = from obj
index = 2
Attribute UserData:
UserData ID: 2544A64E-220D-4d65-B8D4-611BB57B46C7
Plug-in: Rhino
description: RhinoCommon UserDictionary
saved in file: no
copy count: 1
UserData ID: 3F460FF7-9289-4fc0-BF66-7D7B7DC658BF
Plug-in: Rhino
description: Rhino Picture Frame Marker
saved in file: yes
copy count: 11
Geometry:
Valid surface.
surface.
Plane Surface
“U”: (0.000 <= U <= 500.000)
“V”: (0.000 <= V <= 250.000)
Edge Tally:
4 boundary edges
Edge Tolerances: all 0.000
Vertex Tolerances: all 0.000
Render mesh: 1 mesh 4 vertices 1 polygons
Created with fast meshing parameters.
Analysis mesh: none present
I want to be able to use commands like SelPicture but I cannot do that with the grasshopper generated surface. It seems that Picture Surface is an object type, how do we make that via grasshopper? Right now the only way to make it is using the Picture command in Rhino.
Thank you for your reply. I finally understand your requirement. However, currently, you need to call the AddPictureFrame function to achieve it. I referenced to a discussion thread where @clement shared a GhPython script for your reference.
AddPictureFrame.gh (9.8 KB)
Great, this is what I was looking for. I had 100 images I wanted to add in my rhino file with the Picture command.
Since this python script is calling a Function and directly baking, there is no way to use the Model Object components and Content Cache right? I also have attributes I want to attach to the Picture Surface. Is that something I will have to work around for time being by first baking and then after that query them by name and attach information using content cache?
I believe this is a feature that needs to be added. I have logged this requirement with our development engineers.
RH-91235 Add Picture Frame to Rhino Data Types



