Skip to content

hkb_editor.gui.dialogs.apply_template_dialog

apply_template_dialog

Bases: DpgItem

Render a template's arguments as a form and run it.

One input widget is created per template argument; the widget type comes from the argument's annotation. The dialog stays open after a successful run so the template can be applied again.

Parameters:

Name Type Description Default
behavior HavokBehavior

Behavior to modify.

required
template_file str

Path to the template module.

required
callback callable

Called as callback(tag, new_objects, user_data) after a run.

None
tag int or str

Explicit tag; auto-generated if None.

None
user_data any

Passed through to callback.

None

Raises:

Type Description
ValueError

If a template argument has a type no widget can handle.

pin_objects property

pin_objects: bool

Whether the caller should pin the created objects.

show_message

show_message(
    msg: str = None, color: RGBA = style.red
) -> None

Show or hide the notification label. Pass msg=None to hide.

Ko-fi donations