Cube Republic

@cuberepublic.bsky.social

I'm Cube Republic, artist selling content in the 3D virtual world, Second Life.

I'm fucking livid, I have to get a new national ID card so I went to get my id photo taken at the local studio. They've completely edited them with chat GPT, made my skin all smooth and given me rosey cheaks, fucking numpties.

Been meaning to make some tutorial videos for @blender.org's Python API (or even a detailed walkthrough of how I used bpy to create my #SecondLife terrain models). In the meantime, a quick example of how to turn a mesh grid into a sine wave, in just two lines of code. More info in the alt text. #b3d

A screenshot of the "Layout" workspace in Blender 5.2.0, showing a mesh grid and how to create it (using Add -> Mesh -> Grid). Also shown are the "Add Grid" parameters, where the X and Y Subdivisions have each been changed to 100 and the Size has been set to 10 meters.

Note: You can increase or decrease the subdivisions in order to change how smooth the wave will be. Changing the mesh's size here will affect how many times the wave will repeat across the mesh (how many cycles, in other words).A screenshot of the "Scripting" workspace in Blender 5.2.0, showing the interactive Python Console, where the following two lines of code were just run:

for vertex in bpy.data.objects['Grid'].data.vertices:
    vertex.co.z = sin(vertex.co.x)

Note: You can also combine functions and/or use different coordinates (multiplying the sin of the x coordinates by the cos of the y coordinates, for example). Have fun and experiment!

Below the Console is a 3D Viewport where the mesh grid now resembles a sine wave; to the right is the Text Editor, displaying the following text and code examples:

# Don't forget to 'import bpy' and any other necessary modules (like math) if running scripts from Blender's Text Editor or when using Blender from the command line. If using its interactive Python Console, the bpy module is already available.

# Also, because of the Console's "Convenience Variables" for bpy's context and data hierarchies, the code to the left could also be written there as follows:

for vertex in D.objects['Grid'].data.vertices:
    vertex.co.z = sin(vertex.co.x)

# Again, keep in mind that the 'C' and 'D' variables are just shortcuts. If you want to use them in scripts outside of Blender's Python Console, you have to define them yourself.



# Extra Credit:

# An object is not the same as its mesh. A mesh technically lives in its own branch of the bpy.data hierarchy; each mesh can be linked to one or more objects. In this case, the 'Grid' object and the 'Grid' mesh happen to share the same name, but they don't necessarily have to.

# In the code example(s) shown here, the '.data' of the 'Grid' object refers to the mesh data that it's linked to (different object types have different kinds of data), and the vertices belong to the mesh. We could therefore also have written the code this way instead, addressing the mesh directly:

for vertex in bpy.data.meshes['Grid'].vertices:
    vertex.co.z = sin(vertex.co.x)
Erik Mondrian@rainstormsky.com · last yr.

Did some personal "art therapy" today with @blender.org and its #Python API, repositioning the vertices of a mesh grid using trigonometric functions like sine and cosine. The results are quite abstract, but I like how they turned out. They work pretty well as desktop backgrounds too. #b3d #VisualArt

An abstract image made in Blender, showing a curved plane that resembles part of a sine wave. There is also a checkerboard pattern of raised and lowered tiles, tinted purple, that alternate between light and shadow.

I couldn't take X anymore, it makes me rage which can't be healthy, so many edge lord racists and fascists, it really is a cess pool. So I deactivated my account and deleted my passwords - good ridans.

Lovely, colourful PBR Japanese Andromeda bushes (Pieris japonica, lily-of-the-valley bush, pieris) to brighten your landscaping. Available exclusively at February 2026 FaMESHed, and on the Marketplace thereafter. 7 colours across 4 designs — the perfect bush to brighten up landscaping! #Secondlife

BildBild