1
$\begingroup$

To store a user setting, I managed to access a StringProperty in my addon popup window like this: enter image description here

But i want to add an overwrite warning as same as the blender file save window: enter image description here

Is there a way to do this? I have been searched the API for some hours, and found that blender has a "check_existing" BoolProperty in "bpy.ops.wm.save_as_mainfile()" to paint the box red. But no more sentenses were found about changing text box color in blender's python scripts.

More than approciate for telling me the way to do that! :)

$\endgroup$

1 Answer 1

1
$\begingroup$

use layout.alert = True

learn more https://docs.blender.org/api/current/bpy.types.UILayout.html#bpy.types.UILayout.alert

$\endgroup$
1
  • $\begingroup$ It works! Additionally, for others who would have watched this question, "row.alert = True" should before the sentenses like "row.prop(self, 'some_str')" or it wont works. $\endgroup$
    – Trantor
    Commented May 13 at 8:33

You must log in to answer this question.

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