you_can_call_me_houdini.api package

you_can_call_me_houdini.api.callback module

This module contains the Callback class definition.

class you_can_call_me_houdini.api.callback.Callback(name: str, callback_function: Callable, enabled: bool = True)[source]

Bases: object

Class to represent a named callback object which an associated callable.

The callable is executed by calling this object.

Parameters:
  • name – The callback name.

  • callback_function – The callable item to execute.

  • enabled – Whether the callback is enabled.

name: str
callback_function: Callable
enabled: bool = True

you_can_call_me_houdini.api.constants module

Package related constant values.

you_can_call_me_houdini.api.constants.CALLBACK_EVENT_TYPE = '__event_type__'

The name of the callback event type when added to the callback args.

you_can_call_me_houdini.api.constants.DRAG_DROP_ACCEPTED = 'drop_accepted'

Constant to set that an external drop has been accepted.

you_can_call_me_houdini.api.constants.KEYBOARD_EVENT_HANDLED = 'keyboard_event_handled'

Constant to set that a keyboard event has been handled.

you_can_call_me_houdini.api.constants.PASTED_ITEMS = 'pasted_items'

Constant to point to the list of pasted items.

you_can_call_me_houdini.api.event module

This module contains the base api implementations for events.

enum you_can_call_me_houdini.api.event.HoudiniEventEnum(value)[source]

Bases: Enum

Subclass for Houdini event enums.

The Enum and its members have the following methods:

log_message(function: Callable, callback_args: dict) None[source]

Log a callback call for the function and args.

Parameters:
  • function – The callback function.

  • callback_args – The callback args.

enum you_can_call_me_houdini.api.event.HoudiniNodeEventEnum(value)[source]

Bases: HoudiniEventEnum

Subclass for events dealing with Houdini nodes.

The event args must contain a ‘node’ key pointing to the hou.Node instance.

The Enum and its members have the following methods:

log_message(function: Callable, callback_args: dict) None[source]

Log a callback call for the function and args.

Parameters:
  • function – The callback function.

  • callback_args – The callback args.

class you_can_call_me_houdini.api.event.Event(name: str, enabled: bool = True, description: str | None = None, stats_post_report: dataclasses.InitVar[bool] = False)[source]

Bases: object

The base event class.

name: str
enabled: bool = True
description: str | None = None
stats: EventStats
stats_post_report: dataclasses.InitVar[bool] = False
post_run_callback() None[source]

Perform actions after the event has run.

class you_can_call_me_houdini.api.event.RunOnceEvent(name: str, enabled: bool = True, description: str | None = None, stats_post_report: dataclasses.InitVar[bool] = False)[source]

Bases: Event

Event subclass that will only be run a single time.

After the first run the event will be set as disabled.

post_run_callback() None[source]

Perform actions after the event has run.

This sets the enabled flag to False so the event will not run again.

you_can_call_me_houdini.api.logger module

Package logging related functions.

you_can_call_me_houdini.api.logger.init_config() None[source]

Load logger config from file.

you_can_call_me_houdini.api.manager module

you_can_call_me_houdini.api.stats module

This module contains classes related to event statistics.

class you_can_call_me_houdini.api.stats.EventStats(name: str, post_report: bool = False)[source]

Bases: object

This class is used to track event stats.

Parameters:
  • name – The event name to associate the stats with.

  • post_report – Whether to print the stats report after execution.

name: str
post_report: bool = False
run_count: int = 0
last_run_time: float = 0
last_started: float = 0
total_time: float = 0
print_report() None[source]

Print (log) a stats report for the last run.

reset() None[source]

Reset all counts.