Hey guys,
I get the feeling I’m forgetting or missing something obvious…
I was wondering if there is a way to force Blender not to use the diffuse/specular settings of each object’s material when drawing objects in the viewport. I’ve been keeping a flat gray orphan material in each project, so that when I need to look at the wires of a darkly-colored object in solid view, I can switch out my too-dark-to-see-them material for that, then switch it back before rendering.
I am hoping to learn what you guys do to get around this issue, or that maybe there is a setting somewhere that forces OpenGL view to use a single material, or just brightens everything up so I can see the verts and wires on my dark-material objects.
As an alternative, would it be possible (and just how hard would it be?) to write a python script for a button or hotkey to toggle the 3d-view user-preferences between drawing wires/verts/ as black/white? I figure that would be a lot easier than toggling between real-materials and proxy-materials via scripting.
…and then go in User Prefs > Input > 3D View > Mesh > Edit button if not already editable > Add New > expand the new one and where it says ‘none’ write ‘mesh.toggle_vert_color’ > click where it says ‘A’ and press your key that will toggle vert colors
Hey! You did it! I must admit, seeing how much syntax I’d have to have learned in order to do this myself makes me even more grateful that you’ve been so generous! Then again, now I’m curious to learn more about what I can do to change my Blender experience…
As this is my first time working with a from-scratch script, I’m afraid I’ve got a question!
I added “import bpy” as the first line, which let it run. Then I saved it as mesh_toggle_vert_color.py in Blender2.5/Scripts/Addons (wrong place?)
With it open in the text editor, I chose to Register it, (wrong again?)
Now I think I just need to know how to make it Run itself when Blender loads to completely automate everything?
Could anyone could clue me in? I have been and will keep looking for this info on my own, but knowing me, it’s more likely someone will reply before I figure it out.
edit:
to be clear, it works until I close blender, but when I restart, I must open it and run it to make the shortcut key work.
edit:
I’ve added a bl_addon_info block in the script, which added it to the Add-Ons menu, however I can’t check the box to enable it. Still in the dark here, but trying!
You are now my personal Python hero! I figured out the register/unregister, but didn’t know -what- to register, as in, what argument(s) to pass. Thank you sooo much! I do enjoy scripting/programming, and Python doesn’t look all that unfriendly now that I’ve seen a few nuts and bolts at work. I added code to affect the ‘wire’ color as well, since that essentially solves the original problem I had seeing them on dark objects. I shall investigate what else I can do with scripting to improve my workflow… Hmmmmm…
Considering others have likely wanted a similar function at some time or another, IMHO, you should consider sharing this in its own thread, or submitting something similar to the big repository?
Thanks again for sharing your work, and for the hand-holding and baby-steps!
I admit I have run into this before. It would be nice for it to be automatic in some way, but that doesn’t seem to be possible. With the workaround we did above it covers most of the cases, i.e. if a mesh is zebra-textured you can toggle as you edit different parts of the mesh. Another option would be to have an option to turn on/off materials in the 3d view, but is not good when working on meshes that depend on their textures. Have you any other suggestions?
I personally don’t often find that I need to edit a mesh while viewing its texture, but I can see why these solutions won’t solve this problem in every situation. Not to sound unhappy with this script (!), but forcing a ‘global overide’ material in the viewports is a feature I’d love to have regardless of it solving this visibility issue. Something like the Override Material option in the ‘Layers’ pulldown of Render Properties does for rendering. It would, in effect, solve half of this accessibility issue, while your wire/vert display-color toggle solves the other half. At least as far as solid-view goes, since it couldn’t help in situations where you absolutely must see or otherwise use/have the texture while editing the model. Blender’s display architecture might not even allow a better solution to the problem in textured-view mode.
And by the way, your script has already made its way into my workflow, and is super awesome!