Thanks @lsscpp for your kind answer
my path was also trial & error since the age of 11 ( in the 80’s ) and be sure self-teaching is the best way of learning ( though not the fastest ). So keep up walking your path
My current problem is not language ( it is never btw ) but blender API. Even if y feel python is a strange non-typed & non-formal language i’m okay with it’s structure, but the blender API is really awfullty documented ( needing much work and rethought ) and i struggle finding info/examples on the blender internals ( the name of the variables & classes used in blender ).
As an example of almost perfect doc i’d mention unity3D API doc wich is IMHO as much impressive and wide as unity by itself. You can code lots of things in few minutes with U3D as the API doc is just perfect. With blender it is another story
I saw many examples of addons registering/uregistering things even if noone knows what it is for, making new UI windows etc… but none for what i want to do
What i want is pretty simple ( simplicity is the supreme sophistication ):
Add a button under the… wait; lemme do a quick image composition
Here it is: the button under the UV layers list, called ‘select this UV for all selection’.
I see what has to do this button on click:
- get the selected UV for the active obj in UVname
- forall O in selected obj
- if exists O.UVname
select O.UVname
- endif
- endfor
This is pretty simple and is a real MUST HAVE complement for multi-object edition ( i guess devs forgot to add this mandatory feature ) as when you have to select UV for 100 objects before unwrapping them all in one texture, you understand that stupidly waste time with select/click is deeply counter-productive
So my problem is to find the UV panel of the ‘data’ panel of the properties window, and add a button at the bottom thet do what i need when clicked.
Of course i could edit the source. This would be the quick dirty wayforbidding share.
What i’d like is a lil piece of python that could be easily loaded by anyone, run and be operative without writing code…
In blender inside-examples the code ‘Layout demo’ gives me some clue and adds a panel in one tab of the properties.
The tab i want to add my button to is the ‘data’ one.
But how to access the UV panel ?
Here’s the lil piece of code for existing UI reference i got :
class LayoutDemoPanel(bpy.types.Panel):
"""Creates a Panel in the scene context of the properties editor"""
bl_label = "Layout Demo"
bl_idname = "SCENE_PT_layout"
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "data"
..........
Any idea ?
Thanks a lot and happy blending !