I know this because I just spent a half hour dealing with this one: Why Do Data Types Matter in Python?īecause if you don’t use the right one, you will get errors. To understand why, here’s a tangent on data types. It looks god awful, but I swear it’s necessary. The tricky bit is the part where we put in the object location- blenderCipher.write(str(int()). ![]() Inside the loop, we want it to write the object name and toss in an ‘\n’ or two to make new lines. Then we start a for loop that will cycle through all the selected objects in the current scene. Then you tell it to open a notepad file, one that we can call blenderCipher for short. You tell the computer to import the Blender stuff ( import bpy) so it can do Blender things. The beginning of the code is pretty straightforward. #The second argument is set to ‘w’ for ‘write’īlenderCipher=open('C:\\Users\\Li\\Desktop\\Cipher 2.0.txt','w')īlenderCipher.write(str(int()) str(int()) str(int())) #Open a text file (the file won’t actually open on your screen) ![]() So you want to get a text file with the coordinates of all the objects in a Blender scene? Luckily, Python has some wonderful built-in functions that can do exactly that.
0 Comments
Leave a Reply. |