Whenever I create a new material from a jpeg-image I drag onto an object in the rhino model, that image is by default set as the bitmap texture for the base color of a newly created material, named after the filename of the jpeg.
By default this bitmap has a mapping set to Mapping Channel 1, but I’d like to formulate a python script to change that quickly to WCS/OCS (box style) with a U and V value of 100.
Is there any guidance published on how to achieve this?
I’m not sure how to trigger a user script via a Drag and Drop event, so would adding an Eto button in a plug-in, or even running a script manually be OK?
The APIs are pretty thoroughly documented, so I’d look there to figure out how to get some kind of reference to the Texture of Btimap object. If you get that reference, depending on how much Hackishness is acceptable, have a look and see if the Mapping U/V and box style attributes (or methods) are on there, but undocumented.
Thank you Dale, but the script freezes instantly when I try to run it (on Mac). I don’t directly see what causes it and how to debug it. Is there something you know that’s preventing it from running? Rhino gets completely stuck in an endless loading loop and I have to force quit…
Do you know which part of the script is being executed when the freeze occurs?
Try opening a new empty model and running RunPythonScript with this file: Hello.py (26 Bytes)
Apple macOS Version 26.5.1 (Build 25F80) (Physical RAM: 24GB)
Mac Model Identifier: Mac17,9
Language: en-BE (MacOS default)
.NET 8.0.14
Metal GPU Family Apple 7
Metal GPU Family Common 3
Metal GPU Family Mac 2
Graphics processors
Apple M5 Pro
Color LCD (1800 x 1169 @ 120.00Hz)
ASUS VC239 (1920 x 1080 @ 60.00Hz)
GPU Vendor: Apple
USB devices
Realtek: USB 10/100 LAN
Generic: Mass Storage Device
Logitech: Wireless Receiver
YICHIP: 2.4G Receiver
USB C: USB C Video Adaptor
Rhino plugins that do not ship with Rhino
/Users/jas/Library/Application Support/McNeel/Rhinoceros/8.0/MacPlugIns/DatasmithRhino8.rhp “Datasmith Exporter” 5.7.4.0