And ig I gotta do this one as well. This is the other skill I wanted to practice. Scripting in whatever language I choose that day ig.
Today is Python.
To be honest, I get ChatGPT to write a lot of code. I’ll go in and comment it, I can read it most of the time to see what it’s doing.
I think I still gotta think like a programmer? Have to prompt ChatGPT well enough to do what I say? Maybe even have to prompt it to generate “clean” code that uses function calls for repeated tasks rather than just throwing all that shit down thousands of lines of code?
Anyways, here’s the script I used today:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
import bpy
Remove everything first (optional)
bpy.ops.object.select_all(action=’SELECT’)
bpy.ops.object.delete()
Create a base cube
bpy.ops.mesh.primitive_cube_add(size=2, location=(0, 0, 0))
base = bpy.context.active_object
base.name = “BaseCube”
creates the east cube
bpy.ops.mesh.primitive_cube_add(size=2, location=(1, 0, 0))
shaft_east = bpy.context.active_object
shaft_east.name = “Shaft_East”
defines the modifier to be added to object ‘base’, named ‘East union’
bool_mod = base.modifiers.new(name=”East_Union”, type=’BOOLEAN’)
UNION type boolean
bool_mod.operation = ‘UNION’
UNION object is the shaft_east
bool_mod.object = shaft_east
bpy.context.view_layer.objects.active = base
applies the modifier
bpy.ops.object.modifier_apply(modifier=bool_mod.name)