Is it possible to make execute path a little bit more flexible? Something like this
execute_script("<i>os.path.join(os.environ['ONEDRIVE'], </i>"Code/addons/addon.py"<i>)</i>")
Is it possible to make execute path a little bit more flexible? Something like this
execute_script("<i>os.path.join(os.environ['ONEDRIVE'], </i>"Code/addons/addon.py"<i>)</i>")
Hi, check the code. Try to remove double quotes:
execute_script(<i>os.path.join(os.environ['ONEDRIVE'], </i>"Code/addons/addon.py"<i>)</i>)
I forgot to change addon.py to actual name ā a whole hour wasted :spin: what a shame lol
execute_script(os.path.join(os.environ['ONEDRIVE'], "Code", "addons", "addon.py"))
edited slightly, to be sure that the path is correct, now it works perfectly!) thank you roaoao!
Hey roaroao, seems this add-on doesnāt with blender 2.8 version, isnāt it? When we can wait a properly version? :spin:
Hi, PME 1.14.15 works for me in 2.8. Maybe Iām missing something?
Iām going to release PME 1.15.0 with new features this week. So please let me know if you find Blender 2.8 related issues. Iāll try to fix them for upcoming version.
Btw, please keep in mind that 2.8 version is still in development. Any small change can break the addon.
Good morning roaoao,
sorry for the confusion, was something about the keymap configuration, not about the add-on it works in 2.8 for me too
HI,
Would like to have separate Pie menus for the different Node Editors. Tex, Comp, Material and if possible Animation Nodes. Material Node Editor working fine, however, it also shows in Tex, Comp, Ani Nodes. What is Generic Node for? Thanks
Should be something like this I think
if bpy.context.space_data.tree_type == āShaderNodeTreeā:
open_menu(āmenu_1ā)
elif bpy.context.space_data.tree_type == āCompositorNodeTreeā:
open_menu(āmenu_2ā)
elif bpy.context.space_data.tree_type == āTextureNodeTreeā:
open_menu(āmenu_3ā)
cant find the animation one, but I never use nodes
Use Node Editor
keymap with one of these poll methods:
return C.space_data.tree_type == 'ShaderNodeTree'
return C.space_data.tree_type == 'TextureNodeTree'
return C.space_data.tree_type == 'CompositorNodeTree'
return C.space_data.tree_type == 'an_AnimationNodeTree'
Way2Close and roaoao.
Thanks I give it a try. is elif sort for else if?
Yes lol, it didnt paste it right, the lines should be indented:
if bpy.context.space_data.tree_type == 'ShaderNodeTree':
open_menu("menu_1")
elif bpy.context.space_data.tree_type == 'CompositorNodeTree':
open_menu("menu_2")
elif bpy.context.space_data.tree_type == 'TextureNodeTree':
open_menu("menu_3")
Iāve been trying to follow along with the context sensitive pie menu video, but iām having trouble setting up a context sensitive menu.
Can anyone point me in the right direction?
Hi, thanks, Iāll update the video.
To create a context sensitive menu you need to use poll method. You can find an example here or here.
Hey roaoao,
Iām trying to set up a Modal for editing Wondermesh properties. How can I have regular mouse-movement control C.object.data.WBox.size_x, C.object.data.WBox.size_y and C.object.data.WBox.size_z at the same time, keeping their relative values (so if the values are x=2, y=3 and z=5 when entering the modal, moving my mouse will add or subtract 1 from each of these)?
On top of that, Iād still want to have three seperate hotkeys within the modal that let me tweak each value alone (say, q, w and e)
As a last request, Iād like to tweak another three values together, with the mousewheel.
Iād want to set this up similarly for all of the different Wondermesh primitives, so if I could detect the name and fire off a different modal based on whether itās WTube, Wbox_01 etc, thatād be great!
edit: additionally, Iāve been hoping to find a way to do this:
Use the mouse-path over a few pixels to determine between different commands. For instance, when I move my mouse a few pixels up, compare to closest world (or local) coordinate (x, y or z) and initiate a grab locked to this axis. Nvil/Voidworldās move/rotate/scale functioned like this, and it was much nicer than Blenderās MMB axis selector.
Hey, just checking, is it normal to have this:
module changed on disk: C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\pie_menu_editor_init_.py reloadingā¦
in the console on startup?
Will send you an example tomorrow.
These tools (nvilās move/rotate/scale) require a lot of code. Itās better to create a separate add-on for them. Canāt help you with it (good 3d math skills are required).
Hi, Iām not sure how/where Blender stores module states, but try to save user preferences and restart Blender.
@roaoa:
Iāve figured it out with the help of some friends, although Iām still not clear about the synthax required for some other stuff Iām attempting. Is there any more documentation coming?
Iāll also share my menus soon, although theyād need some cleaning up.
For instance: How can I get the āSmoothnessā control on the mousewheel to function in the following Modal:
{
āversionā: ā1.14.15ā,
āmenusā: [
[
āSubdivide / Unsubdivideā,
āMeshā,
āalt+Wā,
[
[
āOn Invokeā,
āINVOKEā,
āā,
ādelta = 0; bpy.ops.mesh.subdivide()ā
],
[
āSmoothnessā,
āPROPā,
āWHEELUPMOUSE;;;0.10000000149011612;ā,
āC.active_operator.smoothnessā
],
[
āDeltaā,
āPROPā,
āMOUSEMOVE;-10.0;10.0;;ā,
ādeltaā
],
[
āSubdivide / unsubdivideā,
āUPDATEā,
āā,
ābpy.ops.mesh.unsubdivide() if delta <0 else bpy.ops.mesh.subdivide(smoothness=0.0); delta = 0ā
],
[
āMake Normals Consistentā,
āFINISHā,
āā,
ābpy.ops.mesh.normals_make_consistent(inside=False)ā
]
],
āMODALā,
āmo?confirm=Trueā,
āPRESSā,
āā,
āā
]
]
}
Yes, but after PME 1.15.0 release.
Make sure that you checked this page and this video.
Iām using ctrl+mousewheel to control the smoothness in
. Note that to apply modified properties of the active operator (smoothness in this case) we need to call bpy.ops.ed.undo_redo(True) operator. Also note that the position of On Update slot is important.
But you want to control both tools (subdivide and unsubdivide) with mousewheel. Right?
Here is an example (json file - add_cone_modal.zip (543 Bytes) and video).
I donāt have Wondermesh add-on so Iāve used Add Cone tool.
I think Iāve found a bug:
When I set a pie to have a specific radius in itās settings, and then open another (non-PME) pie menu, it inherits the radius, rather than take it from Blenderās settings.
Moving the viewport a bit resets it, but not always!
Thereās also another problem Iāve been having where Debug Mode will get enabled, and every click I make in the PME interface will pop up the debug menu (where you add something to the current Pie). Only a full restart of Blender (so not just a new file) fixes this, and I havenāt been able to figure out when or why it happens!
edit: added link to GIF
https://i.imgur.com/eQqopVI.gifv
Another thing I canāt get to work:
https://i.imgur.com/EU9Zmb4.png
When I add that to a pie menu, it shows up as grayed out, both in edit and object mode
As for the smoothness problem, I tried adding undo redo, and it doesnāt seem to have worked:
{
āmenusā: [
[
āSubdivide / Unsubdivideā,
āMeshā,
āalt+Wā,
[
[
āSubdivideā,
āINVOKEā,
āā,
ābpy.ops.mesh.subdivide()ā
],
[
āDelta = 0ā,
āINVOKEā,
āā,
ādelta = 0ā
],
[
āUndo and Redoā,
āUPDATEā,
āā,
ābpy.ops.ed.undo_redo(TRUE)ā
],
[
āSubdivide / unsubdivideā,
āUPDATEā,
āā,
ābpy.ops.mesh.unsubdivide() if delta <0 else bpy.ops.mesh.subdivide(smoothness=0.0); delta = 0ā
],
[
āSmoothnessā,
āPROPā,
āWHEELUPMOUSE;;;0.10000000149011612;ā,
āC.active_operator.smoothnessā
],
[
āDeltaā,
āPROPā,
āMOUSEMOVE;-10.0;10.0;;ā,
ādeltaā
],
[
āMake Normals Consistentā,
āFINISHā,
āā,
ābpy.ops.mesh.normals_make_consistent(inside=False)ā
],
[
āOn Cancelā,
āCANCELā,
āā,
ābpy.ops.ed.undo()ā
]
],
āMODALā,
āmo?confirm=Trueā,
āPRESSā,
āā,
āā
]
],
āversionā: ā1.14.15ā
}