This is a general question about .rui files but it specifically relates to an issue that I have found with the .rui files produced with the Rhino 8 ScriptEditor that @eirannejad has added.
… and I’m unsure of how to fix things for their machine.
Here is the .rui file that has been produced from the Rhino 8 ScriptEditor in case it helps us debug things: Environmental.Analysis.rui (76.5 KB)
Any insight into what is goin on here would be much appreciated. And just let us know if there is something you would like us to test and I’ll try to mobilize the affected parties.
I downloaded a couple of icons from your github. If I import them directly into new buttons via the normal button editor they look fine. However, I downloaded the .rui you posted and all of those look fuzzy.
In the button editor, the preview is off:
And If I open the image editor in any of them, it’s blank.
That’s the way the editor reacts currently when it can’t properly read the image file - or if it’s a bitmap. So something is going wrong with how you are saving these things perhaps. I don’t know what your script is doing and probably wouldn’t know how to fix it anyway.
I did notice your .svg’s are pretty big size-wise - they come in at 450 x 450 squares when I import them directly in Rhino. I don’t know if that matters though, as they seem to open OK in the native button image editor.
Thanks for testing this @Helvetosaur . It’s always good to have more people who can recreate the issue and it will hopefully help us get to the bottom of it.
The SVGs were exported directly from Affinity Designer and I can export them with different dimensions if others at McNeel think this is the issue. I get the sense that Rhino has some way of converting the imported SVGs into different bitmap sizes since it looks like the .rui contains some byte code for bitmaps.
Let’s see what @eirannejad says. Maybe he knows what is happening here since he exposed this nice automated workflow for assigning the icons to the commands in the the Rhino 8 ScriptEditor, which is what generated the .rui I uploaded here.
I also realized that I am able to recreate the issue in Rhino 8.4.
… but I cannot recreate it in Rhino 7 or Rhino 8.3. So I think it is possible that this issue was created in Rhino 8.4. I am going to try re-exporting the .rui using the latest ScriptEditor from Rhino 8.4 and I’ll see if this addresses the issue.
I found that re-exporting a separate .rui for Rhino 8 using the latest Rhino 8.4 ScriptEditor seems to have addressed the issue on my end. Here is the .rui file that I found worked well in Rhino 8.4: Environmental Analysis.rui (133.7 KB)
Given all of this, I assume that the correct way to handle this situation is just to use different .rui files for Rhino 7 and Rhino 8. If @eirannejad can confirm that this is the case, I should have what I need to move forward.
Q: Do you generate the Rhino 7 plugin from the script editor as well? Q: Would you mind confirming the icon issue exits in Rhino 8.5 RC as well?
Rhino 8 has a SVG renderer so the plugins generated for Rhino 8 from ScriptEditor, will keep the svg icons and will build for the screen resolution. The .rui files for Rhino 8 defines icons as:
I will look into the issue with the icon generation from SVGs in Rhino >=8.4
For rhino 7 however these icons are rendered to the default resolution (3 bitmaps 16px / 24px / 32px per button). I can look into making them larger so they look better on high-res displays
RH-80821 RUI files for Rhino 7 to include higher res icons RH-80820 RUI files from ScriptEditor will have tags if dark icon is not specified
Sorry, it took me some time to install 8.5 RC to test things but I can confirm that the icon issue still exists in version 8.5:
And, just for clarification, this issue happens when I use an .rui file that is exported with the target of Rhino 7 in Rhino 8. As long as I stick to using .rui files exported for Rhino 8 with with Rhino 8 and .rui files exported for Rhino 7 with Rhino 7, everything works correctly. I was just surprised that the the .rui files that I exported for Rhino 7 were not working correctly in Rhino 8, which means that .rui files are not backwards compatible between 7 and 8.
For now, I’ll stick to using separate .rui files for Rhino 7 installations vs. Rhino 8 installations. Just let me know if there are any fixes pushed to Rhino 8 to make it backwards compatible with Rhino 7 .rui files.
Thanks for sharing, I’d like to know the process of how you make those icons.
I was trying to import my icon to the script editor but the icon cannot be displayed.