How to get the filename of a blender in Python?
You can get the filename with bpy.path.basename(bpy.context.blend_data.filepath). This will return it as a string without the path attached. Use for Windows compatibility and some more info here. If you run Python script directly from a Unix Shell with a Blender as interpreter you may use one of below:
Why are textures not showing in Blender 2.8?
As a consequence of this (and perhaps also as a result of some missing backwards compatibility features in Blender 2.8), image-based materials created in older versions of blender get replaced with plain, solid-color materials with no textures when opened in Blender 2.8.
What’s the material system in Blender 2.8?
Thanks! Blender 2.8 uses an entirely different materials system from previous versions.
Can you submit a patch [ developer.blender.org ]?
@jim man (jimman2003) great can you submit the patch here: https://developer.blender.org/differential/diff/create/ Hoang Duy Tran (hoangduytran) created T89887: Documentation: Unicode characters for playing head doesn’t seem to work on the web-browser.
Can you pick a file from Blender filebrowser?
Sure, you could just give users a simple string input and let them copy/paste into it but how much cooler would it be to let them pick a file from the filebrowser? Luckily Blender provides a handy class that does almost everything for us. Importhelper is a mix-in class found in the bpy_extras submodule.
How to get the file name in Python?
I’m looking for an efficient way to get the current .blend file name, in a python script. I know how to get its path, with bpy.path.abspath (‘//’), but it returns only the current path, without the file name. I’m sure it’s possible, but I can’t find out how. It’s in bpy.data.filepath.
Where is the importhelper class in Blender in Python?
Importhelper is a mix-in class found in the bpy_extras submodule. It includes an invoke () function that calls the filebrowser and a few helper functions used in Blender’s importer addons. To use it all we have to do is extend it in our operator.