Your script works well now.
I made a small script, this week-end, to draw a shape.
It's just an idea to draw and save your shapes.
In fact, i use the numpad as arrows to draw a path. The line goes from the position crosshair with a custom amplitude for X and Y.
You just have to place the position crosshair and clic in the Rule Parameter. Just hit numbers on the numpad and the line will draw.
The number are for directions. 8, 2, 4, 6 for up, down, left, right and 1, 3, 7, 9 for down left, down right, up left and up right.
Just hit backspace to remove the last number and erase the last line.
Each time, you do an action the script read this sequence of number to draw the shape.
By doing this we have a number sequence we can store in a .txt file to save shapes. We can save the values of the script with it to get exactly the same shape.
I think a .txt file with a shape per line like this example :
The script just have to split the line in a table and read all elements.
Stores the names in a Dropdown menu and when the user selects one, load the sequence and set all the values to get the shape.
The X and Y values work as a scale. Same value give you the same movement amplitude. Different values give you a squashed or stretched shape.
I add a scale value for easy rescaling of the shape.
I add a kind of symmetry to get more possibilities but it needs to be improved. I will see how. I have some ideas.
I take some parts of your script to manage the line thickness, color, fade and the line type of the shape.
You can use this script in your tool if your want or take some parts. It's up to you. All people can do too, just share it to make the script bigger.
I just have some issues, i didn't know how to solve them maybe you know (If it's the case tell me how. I will learn more about shape scripting in Fusion.).
- I want the start position of the line to be the position crosshair. I works well on a squared image (1000x1000 for example) but if i have a non square image the position is shifted in Y axis. So the position crosshair doesn't correspond of the start point anymore.
- The rotation (angle parameter) center it's not the position crosshair but the coordinates zero of the frame (bottom left corner).
- When i call the addshape function to add the symmetry shapes it close the previous shape even if i didn't call the function to let the user manage it.
Hope this helps.
You do not have the required permissions to view the files attached to this post.
Last edited by Spacelanders
on Wed Sep 28, 2016 2:40 pm, edited 1 time in total.