Skip to content

armgit / raea

Public Imported from GitHub
0

Render Anything Engine: tell your AI what to make. Videos, motion graphics, 3D and games as React and TypeScript, rendered on your own GPU. Rust + Bevy, macOS, Linux and Windows.

22.7 KB
Raw Blame
// Generated by tools/gen.sh from Blender's own API (tools/dump.py). Don't edit: regenerate.
import type * as H from "../../types";
import type * as M from "../../mathutils";
import type * as R from "../rna";
import type * as E from "../enums";
import type * as P from "../py";

/** bpy_extras.object_utils */
export interface Api {
  readonly AddObjectHelper: AddObjectHelperClass;
  /**
   * Returns a new enumerator property definition.
   * @returns Opaque type used for registration.
   * @param items sequence of enum items formatted: ``[(identifier, name, description, icon, number), ...]``. The first three elements of the tuples are mandatory. :identifier: The identifier is used for Python access. An empty identifier means that the item is a separator :name: Name for the interface. :description: Used for documentation and tooltips. :icon: An icon string identifier or integer icon value (e.g. returned by :class:`bpy.types.UILayout.icon`) :number: Unique value used as the identifier for this item (stored in file data). Use when the identifier may need to change. If the *ENUM_FLAG* option is used, the values are bit-masks and should be powers of two. When an item only contains 4 items they define ``(identifier, name, description, number)``. Separators may be added using either None (nameless separator), or a regular item tuple with an empty identifier string, in which case the name, if non-empty, will be displayed in the UI above the separator line. For dynamic values a callback can be passed which returns a list in the same format as the static list. This function must take 2 arguments ``(self, context)``, **context may be None**. .. warning:: There is a known bug with using a callback, Python must keep a reference to the strings returned by the callback or Blender will misbehave or even crash.
   */
  EnumProperty(items: any, kw?: {
    /** Name used in the user interface. */
    name?: H.In<string>;
    /** Text used for the tooltip and api documentation. */
    description?: H.In<string>;
    /** Text used as context to disambiguate translations. */
    translation_context?: H.In<string>;
    /**
     * The default value for this enum, a string from the identifiers used in *items*, or integer matching an item number.
     * If the *ENUM_FLAG* option is used this must be a set of such string identifiers instead.
     * WARNING: Strings cannot be specified for dynamic enums
     * (i.e. if a callback function is given as *items* parameter).
     */
    default?: H.In<string | number | Set<string> | null>;
    /** Enumerator in :ref:`rna_enum_property_flag_enum_items`. */
    options?: H.In<Set<string>>;
    /** Enumerator in :ref:`rna_enum_property_override_flag_items`. */
    override?: H.In<Set<string>>;
    /** Enumerator of tags that are defined by parent class. */
    tags?: H.In<Set<string>>;
    /**
     * Function to be called when this value is modified,
     * This function must take 2 values (self, context) and return None.
     * *Warning* there are no safety checks to avoid infinite recursion.
     */
    update?: any;
    /**
     * Function to be called when this value is 'read', and the default,
     * system-defined storage is not used for this property.
     * This function must take 1 value (self) and return the value of the property.
     * .. note:: Defining this callback without a matching ``set`` one will make the property read-only (even if ``READ_ONLY`` option is not set).
     */
    get?: any;
    /**
     * Function to be called when this value is 'written', and the default,
     * system-defined storage is not used for this property.
     * This function must take 2 values (self, value) and return None.
     * .. note:: Defining this callback without a matching ``get`` one is invalid.
     */
    set?: any;
    /**
     * Function to be called when this value is 'read',
     * if some additional processing must be performed on the stored value.
     * This function must take three arguments (self, the stored value,
     * and a boolean indicating if the property is currently set),
     * and return the final, transformed value of the property.
     * .. note:: The callback is responsible to ensure that value limits of the property (min/max, length...) are respected. Otherwise a ValueError exception is raised.
     */
    get_transform?: any;
    /**
     * Function to be called when this value is 'written',
     * if some additional processing must be performed on the given value before storing it.
     * This function must take four arguments (self, the given value to store,
     * the currently stored value ('raw' value, without any ``get_transform`` applied to it),
     * and a boolean indicating if the property is currently set),
     * and return the final, transformed value of the property.
     * .. note:: The callback is responsible to ensure that value limits (min/max, length...) are respected. Otherwise a ValueError exception is raised.
     */
    set_transform?: any;
  }): H.Ptr<P.bpy_props._PropertyDeferred>;
  /**
   * Returns a new enumerator property definition.
   * @returns Opaque type used for registration.
   * @param items sequence of enum items formatted: ``[(identifier, name, description, icon, number), ...]``. The first three elements of the tuples are mandatory. :identifier: The identifier is used for Python access. An empty identifier means that the item is a separator :name: Name for the interface. :description: Used for documentation and tooltips. :icon: An icon string identifier or integer icon value (e.g. returned by :class:`bpy.types.UILayout.icon`) :number: Unique value used as the identifier for this item (stored in file data). Use when the identifier may need to change. If the *ENUM_FLAG* option is used, the values are bit-masks and should be powers of two. When an item only contains 4 items they define ``(identifier, name, description, number)``. Separators may be added using either None (nameless separator), or a regular item tuple with an empty identifier string, in which case the name, if non-empty, will be displayed in the UI above the separator line. For dynamic values a callback can be passed which returns a list in the same format as the static list. This function must take 2 arguments ``(self, context)``, **context may be None**. .. warning:: There is a known bug with using a callback, Python must keep a reference to the strings returned by the callback or Blender will misbehave or even crash.
   */
  EnumProperty(kw: {
    /**
     * sequence of enum items formatted:
     * ``[(identifier, name, description, icon, number), ...]``.
     * The first three elements of the tuples are mandatory.
     * :identifier: The identifier is used for Python access.
     * An empty identifier means that the item is a separator
     * :name: Name for the interface.
     * :description: Used for documentation and tooltips.
     * :icon: An icon string identifier or integer icon value
     * (e.g. returned by :class:`bpy.types.UILayout.icon`)
     * :number: Unique value used as the identifier for this item (stored in file data).
     * Use when the identifier may need to change. If the *ENUM_FLAG* option is used,
     * the values are bit-masks and should be powers of two.
     * When an item only contains 4 items they define ``(identifier, name, description, number)``.
     * Separators may be added using either None (nameless separator),
     * or a regular item tuple with an empty identifier string, in which case the name,
     * if non-empty, will be displayed in the UI above the separator line.
     * For dynamic values a callback can be passed which returns a list in
     * the same format as the static list.
     * This function must take 2 arguments ``(self, context)``, **context may be None**.
     * .. warning::
     * There is a known bug with using a callback,
     * Python must keep a reference to the strings returned by the callback or Blender
     * will misbehave or even crash.
     */
    items: any;
    /** Name used in the user interface. */
    name?: H.In<string>;
    /** Text used for the tooltip and api documentation. */
    description?: H.In<string>;
    /** Text used as context to disambiguate translations. */
    translation_context?: H.In<string>;
    /**
     * The default value for this enum, a string from the identifiers used in *items*, or integer matching an item number.
     * If the *ENUM_FLAG* option is used this must be a set of such string identifiers instead.
     * WARNING: Strings cannot be specified for dynamic enums
     * (i.e. if a callback function is given as *items* parameter).
     */
    default?: H.In<string | number | Set<string> | null>;
    /** Enumerator in :ref:`rna_enum_property_flag_enum_items`. */
    options?: H.In<Set<string>>;
    /** Enumerator in :ref:`rna_enum_property_override_flag_items`. */
    override?: H.In<Set<string>>;
    /** Enumerator of tags that are defined by parent class. */
    tags?: H.In<Set<string>>;
    /**
     * Function to be called when this value is modified,
     * This function must take 2 values (self, context) and return None.
     * *Warning* there are no safety checks to avoid infinite recursion.
     */
    update?: any;
    /**
     * Function to be called when this value is 'read', and the default,
     * system-defined storage is not used for this property.
     * This function must take 1 value (self) and return the value of the property.
     * .. note:: Defining this callback without a matching ``set`` one will make the property read-only (even if ``READ_ONLY`` option is not set).
     */
    get?: any;
    /**
     * Function to be called when this value is 'written', and the default,
     * system-defined storage is not used for this property.
     * This function must take 2 values (self, value) and return None.
     * .. note:: Defining this callback without a matching ``get`` one is invalid.
     */
    set?: any;
    /**
     * Function to be called when this value is 'read',
     * if some additional processing must be performed on the stored value.
     * This function must take three arguments (self, the stored value,
     * and a boolean indicating if the property is currently set),
     * and return the final, transformed value of the property.
     * .. note:: The callback is responsible to ensure that value limits of the property (min/max, length...) are respected. Otherwise a ValueError exception is raised.
     */
    get_transform?: any;
    /**
     * Function to be called when this value is 'written',
     * if some additional processing must be performed on the given value before storing it.
     * This function must take four arguments (self, the given value to store,
     * the currently stored value ('raw' value, without any ``get_transform`` applied to it),
     * and a boolean indicating if the property is currently set),
     * and return the final, transformed value of the property.
     * .. note:: The callback is responsible to ensure that value limits (min/max, length...) are respected. Otherwise a ValueError exception is raised.
     */
    set_transform?: any;
  }): H.Ptr<P.bpy_props._PropertyDeferred>;
  /**
   * Returns a new vector float property definition.
   * @returns Opaque type used for registration.
   */
  FloatVectorProperty(kw?: {
    /** Name used in the user interface. */
    name?: H.In<string>;
    /** Text used for the tooltip and api documentation. */
    description?: H.In<string>;
    /** Text used as context to disambiguate translations. */
    translation_context?: H.In<string>;
    /** Sequence of floats the length of *size*. */
    default?: H.In<readonly number[]>;
    /** Hard minimum, trying to assign a value below will silently assign this minimum instead. */
    min?: H.In<number>;
    /** Hard maximum, trying to assign a value above will silently assign this maximum instead. */
    max?: H.In<number>;
    /** Soft minimum (>= *min*), user won't be able to drag the widget below this value in the UI. */
    soft_min?: H.In<number>;
    /** Soft maximum (<= *max*), user won't be able to drag the widget above this value in the UI. */
    soft_max?: H.In<number>;
    /** Step of increment/decrement in UI, in [1, 100], defaults to 3 (WARNING: actual value is /100). */
    step?: H.In<number>;
    /** Maximum number of decimal digits to display, in [0, 6]. Fraction is automatically hidden for exact integer values of fields with unit 'NONE' or 'TIME' (frame count) and step divisible by 100. */
    precision?: H.In<number>;
    /** Enumerator in :ref:`rna_enum_property_flag_items`. */
    options?: H.In<Set<string>>;
    /** Enumerator in :ref:`rna_enum_property_override_flag_items`. */
    override?: H.In<Set<string>>;
    /** Enumerator of tags that are defined by parent class. */
    tags?: H.In<Set<string>>;
    /** Enumerator in :ref:`rna_enum_property_subtype_number_array_items`. */
    subtype?: H.In<string>;
    /** Enumerator in :ref:`rna_enum_property_unit_items`. */
    unit?: H.In<string>;
    /** Vector dimensions in [1, 32]. An int sequence can be used to define multi-dimension arrays. */
    size?: H.In<number | readonly number[]>;
    /**
     * Function to be called when this value is modified,
     * This function must take 2 values (self, context) and return None.
     * *Warning* there are no safety checks to avoid infinite recursion.
     */
    update?: any;
    /**
     * Function to be called when this value is 'read', and the default,
     * system-defined storage is not used for this property.
     * This function must take 1 value (self) and return the value of the property.
     * .. note:: Defining this callback without a matching ``set`` one will make the property read-only (even if ``READ_ONLY`` option is not set).
     */
    get?: any;
    /**
     * Function to be called when this value is 'written', and the default,
     * system-defined storage is not used for this property.
     * This function must take 2 values (self, value) and return None.
     * .. note:: Defining this callback without a matching ``get`` one is invalid.
     */
    set?: any;
    /**
     * Function to be called when this value is 'read',
     * if some additional processing must be performed on the stored value.
     * This function must take three arguments (self, the stored value,
     * and a boolean indicating if the property is currently set),
     * and return the final, transformed value of the property.
     * .. note:: The callback is responsible to ensure that value limits of the property (min/max, length...) are respected. Otherwise a ValueError exception is raised.
     */
    get_transform?: any;
    /**
     * Function to be called when this value is 'written',
     * if some additional processing must be performed on the given value before storing it.
     * This function must take four arguments (self, the given value to store,
     * the currently stored value ('raw' value, without any ``get_transform`` applied to it),
     * and a boolean indicating if the property is currently set),
     * and return the final, transformed value of the property.
     * .. note:: The callback is responsible to ensure that value limits (min/max, length...) are respected. Otherwise a ValueError exception is raised.
     */
    set_transform?: any;
  }): H.Ptr<P.bpy_props._PropertyDeferred>;
  /**
   * Return a matrix using the operator settings and view context.
   * @returns the matrix from the context and settings.
   * @param context The context to use.
   * @param operator The operator, checked for location and rotation properties.
   */
  add_object_align_init(context: R.Context, operator: R.Operator | null): H.Remote<M.Matrix>;
  /**
   * Return a matrix using the operator settings and view context.
   * @returns the matrix from the context and settings.
   * @param context The context to use.
   * @param operator The operator, checked for location and rotation properties.
   */
  add_object_align_init(kw: {
    /** The context to use. */
    context: R.Context;
    /** The operator, checked for location and rotation properties. */
    operator: R.Operator | null;
  }): H.Remote<M.Matrix>;
  /** = _Feature((3, 7, 0, 'beta', 1), None, 16777216) */
  readonly annotations: H.Ref<any>;
  /**
   * Return scale which should be applied on object
   * data to align it to grid scale.
   * @returns The grid scale.
   * @param context The context.
   */
  object_add_grid_scale(context: R.Context): H.Ref<number>;
  /**
   * Return scale which should be applied on object
   * data to align it to grid scale.
   * @returns The grid scale.
   * @param context The context.
   */
  object_add_grid_scale(kw: {
    /** The context. */
    context: R.Context;
  }): H.Ref<number>;
  /**
   * Scale an operator's distance values by the grid size.
   * @param operator The operator to scale.
   * @param context The context.
   */
  object_add_grid_scale_apply_operator(operator: R.Operator, context: R.Context): H.Ref<void>;
  /**
   * Scale an operator's distance values by the grid size.
   * @param operator The operator to scale.
   * @param context The context.
   */
  object_add_grid_scale_apply_operator(kw: {
    /** The operator to scale. */
    operator: R.Operator;
    /** The context. */
    context: R.Context;
  }): H.Ref<void>;
  /**
   * Add an object using the view context and preference to initialize the
   * location, rotation and layer.
   * @returns the newly created object in the scene.
   * @param context The context to use.
   * @param obdata Valid object data to be used for the new object or None.
   * @param operator The operator, checked for location and rotation properties.
   * @param name Optional name
   */
  object_data_add(context: R.Context, obdata: R.ID | null, operator?: R.Operator | null, name?: H.In<string | null>): H.Ptr<R.Object>;
  /**
   * Add an object using the view context and preference to initialize the
   * location, rotation and layer.
   * @returns the newly created object in the scene.
   * @param context The context to use.
   * @param obdata Valid object data to be used for the new object or None.
   * @param operator The operator, checked for location and rotation properties.
   * @param name Optional name
   */
  object_data_add(context: R.Context, obdata: R.ID | null, kw: {
    /** The operator, checked for location and rotation properties. */
    operator?: R.Operator | null;
    /** Optional name */
    name?: H.In<string | null>;
  }): H.Ptr<R.Object>;
  /**
   * Add an object using the view context and preference to initialize the
   * location, rotation and layer.
   * @returns the newly created object in the scene.
   * @param context The context to use.
   * @param obdata Valid object data to be used for the new object or None.
   * @param operator The operator, checked for location and rotation properties.
   * @param name Optional name
   */
  object_data_add(kw: {
    /** The context to use. */
    context: R.Context;
    /** Valid object data to be used for the new object or None. */
    obdata: R.ID | null;
    /** The operator, checked for location and rotation properties. */
    operator?: R.Operator | null;
    /** Optional name */
    name?: H.In<string | null>;
  }): H.Ptr<R.Object>;
  /**
   * Checks if the active shape key of the specified object is locked, and reports an error if so.
   *
   * If the object has no shape keys, there is nothing to lock, and the function returns False.
   * @returns True if the shape key was locked.
   * @param obj Object to check.
   * @param operator Currently running operator to report the error through. Use None to suppress emitting the message.
   */
  object_report_if_active_shape_key_is_locked(obj: R.Object, operator: R.Operator | null): H.Ref<boolean>;
  /**
   * Checks if the active shape key of the specified object is locked, and reports an error if so.
   *
   * If the object has no shape keys, there is nothing to lock, and the function returns False.
   * @returns True if the shape key was locked.
   * @param obj Object to check.
   * @param operator Currently running operator to report the error through. Use None to suppress emitting the message.
   */
  object_report_if_active_shape_key_is_locked(kw: {
    /** Object to check. */
    obj: R.Object;
    /** Currently running operator to report the error through. Use None to suppress emitting the message. */
    operator: R.Operator | null;
  }): H.Ref<boolean>;
  /**
   * Returns the camera space coords for a 3d point.
   * (also known as: normalized device coordinates - NDC).
   *
   * Where (0, 0) is the bottom left and (1, 1)
   * is the top right of the camera frame.
   * values outside 0-1 are also supported.
   * A negative 'z' value means the point is behind the camera.
   *
   * Takes shift-x/y, lens angle and sensor size into account
   * as well as perspective/ortho projections.
   * @returns a vector where X and Y map to the view plane and
   * Z is the depth on the view axis.
   * @param scene Scene to use for frame size.
   * @param obj Camera object.
   * @param coord World space location.
   */
  world_to_camera_view(scene: R.Scene, obj: R.Object, coord: H.In<M.VectorLike>): H.Remote<M.Vector>;
  /**
   * Returns the camera space coords for a 3d point.
   * (also known as: normalized device coordinates - NDC).
   *
   * Where (0, 0) is the bottom left and (1, 1)
   * is the top right of the camera frame.
   * values outside 0-1 are also supported.
   * A negative 'z' value means the point is behind the camera.
   *
   * Takes shift-x/y, lens angle and sensor size into account
   * as well as perspective/ortho projections.
   * @returns a vector where X and Y map to the view plane and
   * Z is the depth on the view axis.
   * @param scene Scene to use for frame size.
   * @param obj Camera object.
   * @param coord World space location.
   */
  world_to_camera_view(kw: {
    /** Scene to use for frame size. */
    scene: R.Scene;
    /** Camera object. */
    obj: R.Object;
    /** World space location. */
    coord: H.In<M.VectorLike>;
  }): H.Remote<M.Vector>;
}

/** bpy_extras.object_utils.AddObjectHelper */
export interface AddObjectHelper {
  /**
   * Update callback for the align property, resets rotation for world alignment.
   * @param context The context.
   */
  align_update_callback(context: R.Context): H.Ref<void>;
  /**
   * Update callback for the align property, resets rotation for world alignment.
   * @param context The context.
   */
  align_update_callback(kw: {
    /** The context. */
    context: R.Context;
  }): H.Ref<void>;
}
/** The class bpy_extras.object_utils.AddObjectHelper: called, a new one. */
export interface AddObjectHelperClass {
  (): H.Own<AddObjectHelper>;
  /**
   * Check the scene is not linked from a library.
   * @returns True when the scene is local (not linked from a library).
   * @param context The context.
   */
  poll(context: R.Context): H.Ref<boolean>;
  /**
   * Check the scene is not linked from a library.
   * @returns True when the scene is local (not linked from a library).
   * @param context The context.
   */
  poll(kw: {
    /** The context. */
    context: R.Context;
  }): H.Ref<boolean>;
}