Adding decals programmatically broken in Rhino 8

Hi @nathanletwory and @johnc,

i’ve tried to assign two decals using code written in R7 now with R8 SR4 and it failed. The list of decals remains empty. Can you provide some example code which shows how to do it properly ?

_
c.

Do you have a script that you can share?

Hi @clement,

I would also like to see the code that doesn’t work, so I can try and find out why it broke.

Thanks,

John

Hi @nathanletwory and @johnc,

i’ll try to provide some example script and file via pm, need to ask for approval first…

_
c.

I just realized that I did write some example code, it may have been actually for you. Is it something like this? https://jesterking.github.io/rhipy/create_decal.html

Hi @nathanletwory, yes i remember it, it is from this thread which still has the issues all open.

https://mcneel.myjetbrains.com/youtrack/issue/RH-67878
https://mcneel.myjetbrains.com/youtrack/issue/RH-71351
https://mcneel.myjetbrains.com/youtrack/issue/RH-64608

The example code is not working in R8 (and did only partially worked in R7), all it does in R8 is loading a texture in the texture panel. There is no decal assigned from it. Here is your script ready to test:

Nathan_DecalTest.py (1.1 KB)

In my original script for R7 i did a lot of workarounds to apply 2 decals, make it work multiple times and avoid adding the same texture to the texture panel if it was loaded already. I’ve just seen thats 400 lines of code. Therefore i’ve asked if there is maybe some example code to do it properly.

_
c.

Hi @nathanletwory and @johnc,

is there still hope for programmatically adding Decals in Rhino 8 ? I’ve noticed that the release target for one of the YT items listed above (RH-64608) has been changed. It’s release target history is now:

7.x > 8.x > 9.x

RH-64608 is about editing Decals programmatically. What i would like to be able to is to add Decals. It was possible with some workarounds in R7 to add 2 Decals, but in R8 Decals don’t work at all.

This is what RH-71351 is about. Will this be worked on for R8 ?

(background is, i’m adding Decals in one of my PlugIns which has been ported from R7 to R8. But the command using Decals is no more functional).

thanks,
c.

This one is for @johnc as it goes into the deep core of RDK.

Hi @Clement.

Sorry for the long delay getting back to you about this. The situation regarding decals is really complex. I just today finished working on a fix for the issue you’re having, but the fix will be going into Rhino 9 unless it’s absolutely critical for you. This is because it involves a lot of changes that are not particularly safe to make in the Rhino 8 code base at this stage.

So, unless you still desperately need this fix in 8, we would really prefer to put it in 9.

Regards,

John

Hi @johnc, we’re waiting for this fix now since 1 year. So if you could add this to Rhino 8 it would be appreciated since the client used the functionality in my PlugIn in Rhino 7 he expects this to work in Rhino 8 as well. They are not using unreleased versions of Rhino unfortunately.

thanks,
c.

Hi @clement

I have recently backported the necessary changes to Rhino 8. I hope it now does what you need. Please let me know if I’ve succeeded. The changes will appear in version 8.18.

Thanks

John

Thank you @johnc, i’ll let you know as soon as i get that update.

_
c.

@johnc, i’ve upgraded to SR 18 and found that adding decals works. Many thanks !

_
c.