Hi there,
i’ve written a script that when you select a block the script recursively checks if the block is within another block then it keeps checking until it reaches the geometry level. I then apply a material to the layer within the block(s) by specifying the name of the material in “Material Name” and then check it’s texture size or manually input the values if it can’t find the texture size, i then use this to make sure the mapping is always proportional to the texture WxH and adjust the mapping with the sliders some more and preview the change before pressing “OK” finally in the eto form. So far the script has box mapping I will be implementing the cylindrical and sphere mapping. I was wondering if there was a way through python or another scripting language in rhino to access the “mapping widget”? It would be great if the widget could align with the geometry and be a uniform scale. I noticed with some geometries that the texture mapping had to be manually adjusted after running my script as there was some distortions in the texture so i had to rotate and move the mapping widget to the centre of the geometry. All geometries are polysurfaces in my rhino file.
attached is the script and a screen grab of how the mapping widget can look at times, most of the time it is positioned somewhere far away in the view port from the actual geometry and the rotation is almost always not aligned with the geomtry.
240214_Material on block with ui control.py (17.9 KB)
Hi - this looks like a great tool for UV mapping exports from architectural modelling software. I have tried running it but get errors on Rhino 8 :
Traceback (most recent call last):
File “file:///C:/temp/240214_Material%20on%20block%20with%20ui%20control.py”, line 402, in
File “file:///C:/temp/240214_Material%20on%20block%20with%20ui%20control.py”, line 392, in show_texture_adjustment_form
File “file:///C:/temp/240214_Material%20on%20block%20with%20ui%20control.py”, line 29, in init
TypeError: No overload for method ‘Label…ctor{}’ takes ‘0’ arguments()
Does this still work for you ?