• 3D
  • [SOLVED] How can I access the UV 1 of a CSGBox material with gdscript?

I have a CSGBox with a material using an ImageTexture. I want to be able to scale the box but have the texture remain the same size and repeat to fill the space. My idea was to multiply the UV 1 scale by the same number as the box's transform scale. My problem is that I can't figure out how to access the uv1 from code. How might I do this? Is there another way to scale the box without scaling the texture?

CSG is intended for prototyping, with no UV support I think you can use get_meshes()[1] and modify with MeshDataTool, still there are no way to push mesh back to CSGBox (Might be some way tricky with with engine level) Better and easy ways are using shader script, creating box from blender or generating mash with ImmediateGeometry, ArrayMesh, MeshDataTool or SurfaceTool

6 days later

SOLVED! I found what I was looking for on the page for SpatialMaterial. The property is "uv1_scale". So the code is just something like: var material = SpatialMaterial.new() material.uv1_scale = Vector3(num, num, num)