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…
EDIT: This is a problem on my end with Rhino 8, the script provided by Dale works succesfully (tested on Rhino 9 WIP)
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
@Jaxx I tested this locally on 8.35 in my Macbook and can not replicate the lock with or without internet access when setting up python.
Would you mind deleting the ~/.rhinocode/py39-rh8 directory, launch Rhino, and open script editor. See if you can run RhinoCodeLogs after. If not, please zip up the logs under ~/.rhinocode/logs and DM me so I can take a look and maybe see what locks up Rhino.
There are no new logs being created when I run RhinoCodeLogs
If I read the timestamps correctly (It is 10:15 am atm, and the latest in this report seems from 08:09:05, which is also strange because my mac was in standby and no rhino window opened )
Info 09/18/2026 08:08:17 [RhinoCode] Storage Site Registered: Local Drive (mcneel.eto.file) Info 09/18/2026 08:08:17 [RhinoCode] Storage Site Registered: Rhino Files (mcneel.rhinoFiles.file) Info 09/18/2026 08:08:17 [RhinoCode] Storage Site Registered: Web (mcneel.console.http) Info 09/18/2026 08:08:17 [RhinoCode] Rhino3D Initialized on macOS - NETCoreApp Info 09/18/2026 08:08:17 [RhinoCode] Platform Registered: Rhinoceros 3D @ 8.35.26251.13002 (mcneel.rhino3d.rhino) Info 09/18/2026 08:08:17 [RhinoCode] Storage Site Registered: Rhino3D Project (mcneel.rhino3d.project) Info 09/18/2026 08:08:17 [RhinoCode] Operating System: Unix 26.5.1 Info 09/18/2026 08:08:17 [RhinoCode] RhinoCode server starting on /var/folders/rq/7bxfckn17vn296c6058b1nq80000gn/T/CoreFxPipe_rhinocode_remotepipe_12544 Info 09/18/2026 08:08:17 [RhinoCode] Language Registered: Plain Text 1.0 (rhinocode.builtin.text) Info 09/18/2026 08:08:17 [RhinoCode] Language Registered: JSON 1.0 (rhinocode.builtin.json) Info 09/18/2026 08:08:17 [RhinoCode] Language Registered: Yaml 1.0 (rhinocode.builtin.yaml) Info 09/18/2026 08:08:17 [RhinoCode] Language Registered: Git DotFile 1.0 (rhinocode.builtin.gitDotFile) Info 09/18/2026 08:08:17 [RhinoCode] Language Loader Registered: mcneel.pythonnet.python@3.* Info 09/18/2026 08:08:17 [RhinoCode] Language Loader Registered: mcneel.ironpython.python@2.* Info 09/18/2026 08:08:17 [RhinoCode] Language Loader Registered: mcneel.roslyn.csharp@9.* Info 09/18/2026 08:08:17 [RhinoCode] Language Loader Registered: mcneel.gh1.grasshopper@1.* Info 09/18/2026 08:08:17 [RhinoCode] Language Loader Registered: mcneel.markdig.markdown@0.* Info 09/18/2026 08:09:03 [RhinoCode] Language Registered: Python 3.9.10 (mcneel.pythonnet.python) Info 09/18/2026 08:09:03 [RhinoCode] Using existing runtime: IronPython 2.7.12/3 (arm64) Info 09/18/2026 08:09:03 [RhinoCode] Loading IronPython 2.7.12/3 runtime Info 09/18/2026 08:09:03 [RhinoCode] Parsing configs schema "``https://files.mcneel.com/schemas/rhinocode/editor.schema.v1.json``" in /Users/jas/.rhinocode/editor.json Info 09/18/2026 08:09:03 [RhinoCode] Added IronPython 2.7.12 (mcneel.ironpython.python) search path: /Users/jas/Library/Application Support/McNeel/Rhinoceros/8.0/scripts Info 09/18/2026 08:09:03 [RhinoCode] Language Registered: IronPython 2.7.12 (mcneel.ironpython.python) Info 09/18/2026 08:09:03 [RhinoCode] Language Registered: C# 9.0 (mcneel.roslyn.csharp) Info 09/18/2026 08:09:03 [RhinoCode] Language Registered: Grasshopper 1.0 (mcneel.gh1.grasshopper) Info 09/18/2026 08:09:03 [RhinoCode] Language Registered: Markdown 0.30.4 (mcneel.markdig.markdown) Info 09/18/2026 08:09:04 [RhinoCode] Initializing CPython 3.9.10/43 runtime Info 09/18/2026 08:09:04 [RhinoCode] Configuring runtime@py39-rh8 for the first time on Arm64 Info 09/18/2026 08:09:04 [RhinoCode] Deploying CPython 3.9.10/43 runtime Info 09/18/2026 08:09:04 [RhinoCode] Clearing exiting runtime Info 09/18/2026 08:09:04 [RhinoCode] Successfully uninstalled existing runtime at /Users/jas/.rhinocode/py39-rh8 Info 09/18/2026 08:09:05 [RhinoCode] Marking python binary as executable: /Users/jas/.rhinocode/py39-rh8/python3.9 Info 09/18/2026 08:09:05 [RhinoCode] Running process: /bin/bash -c "/bin/chmod +x /Users/jas/.rhinocode/py39-rh8/python3.9"
Which version of python would you recommend to install that should work with Rhino without problems? I have the latest version of python currently installed; Python 3.14.7