Forum Moderators: Lobo3433 Forum Coordinators: LuxXeon
Blender F.A.Q (Last Updated: 2024 Nov 24 8:44 pm)
A really useful tutorial would be how to run little scripts in the Blender Python Scripting thingie, and what to do if it all goes pear-shaped... :blink:
Monterey/Mint21.x/Win10 - Blender3.x - PP11.3(cm) - Musescore3.6.2
Wir sind gewohnt, daß die Menschen verhöhnen was sie nicht verstehen
[it is clear that humans have contempt for that which they do not understand]
Well, there's this script developed by BlenderDiplom that removes all references to image textures which goes a bit like this:
# load a library containing blender-specific classes<br></br>
import bpy<br></br>
# create an empty list named 'img_names' list all textures
in the<br></br>
# .blend, store them in a list named 'textures'<br></br>
img_names = []<br></br>
textures = bpy.data.textures
# for each texture in this list, verify it's a picture<br></br>
# and if so, add it to the list 'img_names'<br></br>
for tex in textures:<br></br>
if tex.type == 'IMAGE':<br></br>
img_names.append(tex.image.name)
# list all pictures in the .blend, store them in a list
named 'imgs'<br></br>
imgs = bpy.data.images
# for each picture in this list, verifiy it appears in
'img_names'.<br></br>
# If not, delete it.<br></br>
for image in imgs:<br></br>
name = image.name<br></br>
if name not in img_names:<br></br>
image.user_clear()
However, this crashes, on this line:
img_names.append(tex.image.name)
giving the following error in console:
AttributeError: 'NoneType' object has no attribute 'name'
:blink:
Monterey/Mint21.x/Win10 - Blender3.x - PP11.3(cm) - Musescore3.6.2
Wir sind gewohnt, daß die Menschen verhöhnen was sie nicht verstehen
[it is clear that humans have contempt for that which they do not understand]
I know just enough to be dangerous, Hedd. :lol:
I do love Python... Bagginsbill more or less introduced the OOP bit to me with Matmatic. Matmatic (MATerials autoMATICally... doesn't have too much to do with mathematics, really) is a specialised flavour of Poser Python, which simply means there have been methods developed to solve problems for that environment, just like Blender has its own flavour - and methods - which you access with that first line of that script I posted: import bpy (import blender python).
But yeah, you're right... running scripts is definitely not the same as writing them.
Monterey/Mint21.x/Win10 - Blender3.x - PP11.3(cm) - Musescore3.6.2
Wir sind gewohnt, daß die Menschen verhöhnen was sie nicht verstehen
[it is clear that humans have contempt for that which they do not understand]
Hello everyone
I feel that all that was suggested would be a great idea for a sticky and tutorial on how to activate and add addons and where to find addons where we can contribute links and a sticky of links and places where those interested in learning how to do python scripting for Blender can gather information and learn how to do them. The tutoial for addons I can perhaps put together but it will have to be some time after my surgery which I will be going in for on 1/9/2014. And will be recouping for bit. I will be having rods and having spine fused. So I will be out of touch for at least several days. But all the suggestions in this thread I would really like to get into place as well as perhaps finding a way for this forum to also maybe help in starting to pick an Artist of the Month and such I have seen some really fantastic stuff being uploaded in the Galleries that were rendered and made in Blender and I think some of those need to recognized as much as other artist here at renderosity
Lobo3433
Blender Maya & 3D Forum Moderator
Renderosity Blender 3D Facebook Page
Wow, what a way to start off the new year, Lobo... good luck with that!! Take good care of yourself...
Monterey/Mint21.x/Win10 - Blender3.x - PP11.3(cm) - Musescore3.6.2
Wir sind gewohnt, daß die Menschen verhöhnen was sie nicht verstehen
[it is clear that humans have contempt for that which they do not understand]
This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.
was thinking it would be a good idea to have a sticky of useful addons and maybe a quick tut on setting them up in user preffs ?