0
$\begingroup$

I have an idea for an addon that I've already implemented successfully via python script. It's used for smoothly modulating sinusoids based on their frequency and amplitude. I want to create a UI that gives me the option to change certain values within the code. I need to create a button that will execute a long script of code, and input fields that will allow me to set the initial conditions of that script.

So my question is:

  1. how do I create an input field that will modify the conditions of the script that's going to execute?

  2. how do I create a button that will execute a script that does a bunch of different things at once?

$\endgroup$
2
  • $\begingroup$ Hi Please use a title that reflects the content of the question. It should be descriptive but succinct, unique and identifying, summarizing the issue so that users can at a glance understand what your post is about. Use the edit link below your post and avoid anything not strictly essential to the post. Remember, your title is the first thing potential visitors will see, and makes your question findable for future users. See "What is the problem with posting an image or link and asking “How do I do this?"" $\endgroup$ Commented Feb 14, 2023 at 6:09
  • $\begingroup$ you can also search for Jaynam in yt - who made some really usefull yt tutorials about creating add-ons $\endgroup$
    – Chris
    Commented Feb 14, 2023 at 12:29

1 Answer 1

1
$\begingroup$

You can find a lot of useful examples in the text editors Templates menu:

enter image description here

In the example ui_panel.py you will find out how to make buttons in panels in the UI, in operator_mesh_add.py you can see how to add properties to an operator so they can be changed in the Adjust Last Operation panel after operator is executed:

enter image description here

Don't underestimate the power of the documentation as well.

$\endgroup$
1
  • $\begingroup$ Thank you. Some of the tutorials I've found are outdated and the methods they use no longer work, which is frustrating. That being said, I didn't think about the templates, and I bet I could spend hours reading through them figuring this stuff out that way, so thank you. That's probably the best option. $\endgroup$
    – user116656
    Commented Feb 14, 2023 at 22:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .