Artist Panel of Macros for Painting in 3d view

I have been trying to get my head around python several times,and finally have gotten some help from proxe and a few others on #blendercoders that answered questions.

I paint in blender pretty much exclusively, and I prefer the freedom that blender gives me as the whole package involves 3d assets, sculpting, compositing, painting in 2d and 3d, grease pencil as guides and camera view for guides, and all kinds of other little things.

Anyway, I have only missed certain things that you get out of the box in other painters, like rotate image while painting, flip horizontal/vertical, and a couple of other things I am still trying to figure out how to make. I did get a few of them set up and working, and I have done an overview on youtube of the addon as it is right now.

One note - after trying it out on the mac at work, I realized it wasn’t reloading the image after painting - and then by rotating the image and pressing rest rotation, then the reload image button worked. I am not sure why, but I think it got hung up at a context change maybe. It’s above my understanding actually, but do note the workaround there.

I hope to keep working on this, and I really hope that this is valuable to others here.

video

GIT page

I update the Github with version 5, has reorganized buttons and some panel labels.

Updated to ver.6, added a button for Images as Planes after watching a tutorial that showed how to relocate buttons in the ui - not how it worked, but it did turn out that since the options was available as a menu item, it could be placed directly in a button in my script.

You might want to add some polling to prevent errors.

This woudl be my first script, so that might be awhile until I can really learn more about that. Watching youtube videos and reading scripts like mad to try to get stuff into my head, but it is slow.

Polling is pretty simple. Your just adding certain conditions that have to be met before an operator can be used.


@classmethod def poll(cls, context):
        return context.active_object is not None and len(context.active_object.material_slots) > 0 and context.active_object.material_slots[0].material != None

This example says first you have to have an active object, second that object has to have at least one material slot, and lastly the first material slot has a material. Until all these conditions are met, the button for the operator will be grayed out.

There is actually a poll in your code already, but its commented out.

I appreciate the explanation - I will see about adding this in asap for each of the operators that need it. The Add Image PLane won’t since it is referencing the other addon and probably has it there.

Thanks!

No problem. :slight_smile: I really enjoy your work.

I hadn’t gotten the hang of the script yet, but I got sidetracked and did make a call menu for the canvas rotation operators.

I took the day off for some me time, and spending it on python… puzzles are fun :smiley: