How do I change material base color image settings with Python?

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.

Hi @Jaxx,

Have a look at the attached and let me know if you have any questions.

set_base_color_wcs_box.py (2.3 KB)

– Dale

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…

Hello Jaxx, can you repeat the freeze if you use texture bitmap from a folder that is not synced with iCloud or any other cloud service?

Also, what is your Rhino version?

Version 8 (8.34.26223.11002, 2026-08-11)

The freeze occurs when I launch the script even with no object with a material to it selected…

Thanks for all extra info. I still have not been able to repeat the freeze. Let’s try to find out why.

Could you send me these, please?

  1. The results of the Rhino _SystemInfo command
  2. A simple model you can repeat the freeze with

If you don’t want to upload them publicly here, you can use our upload page.

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)

Thank you. That hello.py script freezes too.

Also scripteditor command gets stuck on the “Python 3.9.10 Installing python runtime”

It is not file specific. It happens in a blank file too…

Rhino 8 SR35 2026-9-8 (Rhino 8, 8.35.26251.13002, Git hash:master @ 3645d710f50175d8ebcf404aded5b042a481c23e)
License type: Commercial, build 2026-09-08
License details: Cloud Zoo

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

Bluetooth devices
None

Third party kernel extensions
None

Third party plugins
/usr/lib/swift/libswiftCore.dylib
/usr/lib/swift/libswiftObjectiveC.dylib
/usr/lib/swift/libswiftCoreFoundation.dylib
/usr/lib/swift/libswiftDarwin.dylib
/usr/lib/swift/libswiftDispatch.dylib
/usr/lib/swift/libswiftIOKit.dylib
/usr/lib/swift/libswiftSystem.dylib
/usr/lib/swift/libswiftXPC.dylib
/usr/lib/swift/libswift_Builtin_float.dylib
/usr/lib/swift/libswift_Concurrency.dylib
/usr/lib/swift/libswift_DarwinFoundation1.dylib
/usr/lib/swift/libswift_StringProcessing.dylib
/usr/lib/swift/libswiftos.dylib
/usr/lib/swift/libswiftDistributed.dylib
/usr/lib/swift/libswiftObservation.dylib
/usr/lib/swift/libswiftSynchronization.dylib
/usr/lib/swift/libswiftAccelerate.dylib
/usr/lib/swift/libswiftCoreAudio.dylib
/usr/lib/swift/libswiftCoreMedia.dylib
/usr/lib/swift/libswiftMetal.dylib
/usr/lib/swift/libswiftOSLog.dylib
/usr/lib/swift/libswiftQuartzCore.dylib
/usr/lib/swift/libswiftUniformTypeIdentifiers.dylib
/usr/lib/swift/libswiftVideoToolbox.dylib
/usr/lib/swift/libswiftsimd.dylib
/usr/lib/swift/libswift_DarwinFoundation2.dylib
/usr/lib/swift/libswift_DarwinFoundation3.dylib
/usr/lib/swift/libswift_RegexParser.dylib
/usr/lib/swift/libswiftCoreMIDI.dylib
/usr/lib/swift/libswiftCoreImage.dylib
/usr/lib/swift/libswiftCompression.dylib
/usr/lib/swift/libswiftCoreLocation.dylib
/usr/lib/swift/libswiftAVFoundation.dylib
/usr/lib/swift/libswiftRegexBuilder.dylib
/usr/lib/swift/libswiftNaturalLanguage.dylib
/usr/lib/swift/libswiftMLCompute.dylib
/usr/lib/swift/libswiftSpatial.dylib
/usr/lib/swift/libswiftCoreGraphics.dylib
/usr/lib/swift/libswiftFoundation.dylib
/usr/lib/swift/libswiftSwiftOnoneSupport.dylib
/usr/lib/swift/libswiftsys_time.dylib
/usr/lib/usd/libusd_ms.dylib
/usr/lib/swift/libswift_errno.dylib
/usr/lib/swift/libswiftIntents.dylib
/usr/lib/swift/libswiftCoreMediaIO.dylib
/usr/lib/swift/libswiftCallKit.dylib
/usr/lib/swift/libswiftPassKit.dylib
/usr/lib/swift/libswiftAppleArchive.dylib
/usr/lib/updaters/libAppleTconUARPUpdater.dylib
/usr/lib/updaters/libT200Updater.dylib
/usr/lib/swift/libswiftDemangle.dylib
/usr/lib/swift/libswiftGLKit.dylib
/usr/lib/swift/libswiftMetalKit.dylib
/usr/lib/swift/libswiftModelIO.dylib
/usr/lib/swift/libswiftSceneKit.dylib
/usr/lib/swift/libswiftExtensionFoundation.dylib
/usr/lib/swift/libswiftGameplayKit.dylib
/usr/lib/swift/libswiftSpriteKit.dylib
/usr/lib/swift/libswiftMapKit.dylib
/Users/jas/Library/Application Support/McNeel/Rhinoceros/8.0/MacPlugIns/DatasmithRhino8.rhp/DatasmithFacadeCSharp.dylib
/Users/jas/Library/Application Support/McNeel/Rhinoceros/8.0/MacPlugIns/DatasmithRhino8.rhp/libtbbmalloc.2.dylib

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

Rhino plugins that ship with Rhino
/Applications/Rhino 8.app/Contents/Frameworks/RhMaterialEditor.framework “Renderer Development Kit” 8.35.26251.1002
/Applications/Rhino 8.app/Contents/Frameworks/RhCore.framework/Resources/ManagedPlugIns/Commands.rhp “Commands” 8.35.26251.13002
/Applications/Rhino 8.app/Contents/PlugIns/NamedSnapshots.rhp “Snapshots” 8.35.26251.1002
/Applications/Rhino 8.app/Contents/Frameworks/RhCore.framework/Resources/ManagedPlugIns/RDK_EtoUI.rhp “RDK_EtoUI” 8.35.26251.13002
/Applications/Rhino 8.app/Contents/Frameworks/RhCore.framework/Resources/ManagedPlugIns/MeshCommands.rhp “MeshCommands” 8.35.26251.13002
/Applications/Rhino 8.app/Contents/Frameworks/RhCore.framework/Resources/ManagedPlugIns/RhinoRenderCycles.rhp “Rhino Render” 8.35.26251.13002
/Applications/Rhino 8.app/Contents/Frameworks/RhCore.framework/Resources/ManagedPlugIns/RhinoCycles.rhp “RhinoCycles” 8.35.26251.13002
/Applications/Rhino 8.app/Contents/PlugIns/NamedPositions.rhp “Named Position” 8.35.26251.1002
/Applications/Rhino 8.app/Contents/PlugIns/SectionTools.rhp “SectionTools” 8.35.26251.1002
/Applications/Rhino 8.app/Contents/PlugIns/Displacement.rhp “Displacement” 8.35.26251.1002
/Applications/Rhino 8.app/Contents/PlugIns/PanelingTools.rhp “PanelingTools” 8.35.26251.1002
/Applications/Rhino 8.app/Contents/Frameworks/RhCore.framework/Resources/ManagedPlugIns/RhinoDLR_Python.rhp “IronPython” 8.35.26251.13002
/Applications/Rhino 8.app/Contents/Frameworks/RhCore.framework/Resources/ManagedPlugIns/GrasshopperPlugin.rhp “Grasshopper” 8.35.26251.13002
/Applications/Rhino 8.app/Contents/Frameworks/RhCore.framework/Resources/ManagedPlugIns/RhinoCodePlugin.rhp “RhinoCodePlugin” 8.35.26251.13002

Thanks Jaxx, I’ll find someone who can help you fix that issue!