dynamics not working in gimp-drawable-edit-stroke-item - Printable Version +- Gimp-Forum.net (https://www.gimp-forum.net) +-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP) +--- Forum: Extending the GIMP (https://www.gimp-forum.net/Forum-Extending-the-GIMP) +---- Forum: Scripting questions (https://www.gimp-forum.net/Forum-Scripting-questions) +---- Thread: dynamics not working in gimp-drawable-edit-stroke-item (/Thread-dynamics-not-working-in-gimp-drawable-edit-stroke-item) |
dynamics not working in gimp-drawable-edit-stroke-item - jonker - 02-28-2024 I want to draw perpendicular lines to a path within a selection. This can be done in gimp by selecting the right brush with the correct settings and then stroking a path with the the paintbrush or pencil. When I try to use the same settings in python-fu the stroked portion simply stays vertical. I have noted that during the manual stroke selection there is an "Emulate brush dynamics" option which is selected. I cannot find a similar setting in the python-fu api. There might be some other issues in the script since this is my second python-fu script: Code: #!/usr/bin/env python RE: dynamics not working in gimp-drawable-edit-stroke-item - Ofnuts - 02-29-2024 The doc in the PDB browser doesn't mention dynamics in the context settings that affect the call. I have a script that does something like this (ofn-brush-strokes-on-path), and it computes and sets the brush angle before each stroke. RE: dynamics not working in gimp-drawable-edit-stroke-item - jonker - 02-29-2024 Thank you for the response. I thought dynamics might work since that is the default. Oh well. I rewrote the code calling ofn-brush-strokes-on-path. It is working now, except for the undo groups. It seems like I cannot use the undo groups now that I am calling ofn-brush-strokes-on-path. It won't even let me start and stop the undo before or after the call. Any suggestions on that would be appreciated. Code: #!/usr/bin/env python RE: dynamics not working in gimp-drawable-edit-stroke-item - Ofnuts - 03-01-2024 Hmm. As far as I know you can nest undo group (ie, yours, and mine nested in it). What do you means by " It won't even let me start and stop the undo before or after the call"? RE: dynamics not working in gimp-drawable-edit-stroke-item - jonker - 03-01-2024 If I uncomment the undo_group_start and undo_group_end then the script silently does nothing. Wondering if nesting was a problem, I setup an undo_group_start and then before calling the ofn_brush_strokes_on_path I ran an undo_group_end. This removed the nesting question. The silent quitting remained. The only way to get the script to work is if I avoid working with the undo group. With the undo_group commands commented out, as shown above, the script runs fine. Right now I am wondering if there is some sort of problem with included files or something like that. RE: dynamics not working in gimp-drawable-edit-stroke-item - Ofnuts - 03-01-2024 In your code I see image.undo_group_start() but you image variable is called img so that should be img.undo_group_start() (and of course img.undo_group_end()) You can also add a try/except block in your code to catch all errors and report them with a gimp.message(). RE: dynamics not working in gimp-drawable-edit-stroke-item - jonker - 03-01-2024 Of course! I should have seen that. Thank you it is working fine nested now. Thank you so much for your help. |