Animated textures in Blender is a thing! Immediately after finding that out, I set out to script a grid crawler texture in Processing. Because no one in their right mind would want to draw that by hand.
A Bit Of Everything has a post with the logic for a static grid, but somehow getting an animated version ate 3 hours of my life. All in all, it took about 12 tries. What I love about Processing is that even bad guesses can have pleasing results.
This thing below. That’s all I wanted. Animated grid lines. Wierdly satisfying, right?
The script is actually not that complicated. It can be done with three variables, a while loop, and a for loop.
The Processing Code
Couple things to note here. Setting the X or Y increment to a higher number will give you a more spaced apart grid. Also, you have to update the file path. Using the variable i will ensure that Processing doesn’t save over the same image over and over again.
int x = 0; int y = 0; int i = 0; void setup(){ size(700, 700); background(255); strokeWeight(1); stroke(0, 0, 0); } void draw() { while(y<701){ for (int x=0; x<701; x=x+50){ line(x, 0, x, y); line(0, y, x, y); save("C:\\Users\\Desktop\\Test" + str(i) + ".png"); i++; } y=y+50; } }
How to Add the Texture in Blender
The images need to be numbered sequentially for this to work. Start off by adding your object. Unwrap it and assign it a new material.Then go into the Node Editor and add an image texture.
In the image texture node, click Open. Navigate to the folder that contains the images you want to use, highlight them all, and click Open Image.
If all has gone well, you should now see a fifth box set to “Image Sequence.” Below that, you’ll see the number of frames you have loaded. And that’s it. Hit play. Watch it move.
XD you just motivated me to post more processing logics
LikeLiked by 1 person
YES, post all the Processing logic! 😀
LikeLike
This is a pretty neat idea. What a few lines of code can do. Thanks for sharing 🙂
LikeLiked by 1 person
One day I’d like to be able to do what y’all do with Raspberry Pis. That’s a great blog you’re running. Thanks for stopping by 🙂
LikeLiked by 1 person
gifGuide2Code, sorry for my minecrafty name. But can you continue the blender tutorials, I like them and I am a beginner/newbie at blender at the moment so I need tutorials. Thank you 😎😎
LikeLiked by 1 person
I’ve got BIG plans for more Blender tutorials! I’ve been on hiatus for a wedding/vacation, but I’ll be back in October. I’ll keep an eye out for your 3D models–I love seeing what other people are doing in Blender 😀
LikeLiked by 1 person
I usually just like making Minecraft animations. But your guides are still really helpful.
LikeLiked by 1 person
Great job! I agree. #11 was pretty cool!
LikeLiked by 1 person