### AviUtl2 Installer Command-Line Options Source: https://docs.aviutl2.jp/usage These are the available command-line options for the AviUtl2 installer. Some options require administrator privileges or must be specified before the installation command. ```txt AviUtl2_setup.exe [option] (引数無し) : インストールウィザード -uninstall : アンインストールウィザード -I (インストールパス) : インストール実行 ※管理権限で実行する必要があります -U : アンインストール実行 ※管理権限で実行する必要があります -F : ファイルをアプリケーションに関連付け ※-Iの前に指定する必要があります -S : デスクトップにショートカットを作成 ※-Iの前に指定する必要があります -L : 言語ファイルをコピー ※-Iの前に指定する必要があります ``` -------------------------------- ### Get Application Uptime Source: https://docs.aviutl2.jp/lua Gets the elapsed time in seconds since the application started. It uses the performance counter for accurate measurement. ```lua sec = obj.getinfo("clock") ``` -------------------------------- ### Get Object's Start Frame Source: https://docs.aviutl2.jp/lua Retrieves the starting frame number of the object within the scene. ```lua obj.getvalue("frame_s") ``` -------------------------------- ### Text Formatting Examples Source: https://docs.aviutl2.jp/usage Demonstrates various text formatting controls available in AviUtl2. These include color, size, font, style, presets, display speed, wait times, clearing, positioning, spacing, scaling, rotation, ruby text, comments, and scripting. ```text <#ffffff> ``` ```text <#000000,ffffff> ``` ```text <#> ``` ```text <#red> ``` ```text ``` ```text ``` ```text ``` ```text ``` ```text <@メイリオ> ``` ```text <@メイリオ,3> ``` ```text <@メイリオ,6BI> ``` ```text <@> ``` ```text <@+B> ``` ```text <@-B> ``` ```text <$プリセット名> ``` ```text <$> ``` ```text ``` ```text ``` ```text ``` ```text ``` ```text ``` ```text ``` ```text ``` ```text ``` ```text ``` ```text ``` ```text ``` ```text

``` ```text ``` ```text ``` ```text ``` ```text ``` ```text ``` ```text ``` ```text ``` ```text ``` ```text ``` ```text ``` ```text ``` ```text 制御文字せいぎょもじ ``` ```text 行間拡張ぎょうかんかくちょう ``` ```text 字間調整<#ff8888>じかんちょうせい<#> ``` ```text ``` ```text ``` ```text ``` ```text ``` -------------------------------- ### Get Camera Parameters Source: https://docs.aviutl2.jp/lua Retrieves the current camera parameters as a table. The table structure is identical to what is used with `obj.setoption("camera_param")`. ```lua local cam = obj.getoption("camera_param") ``` -------------------------------- ### Get Grid (BPM) Information Source: https://docs.aviutl2.jp/lua Retrieves tempo, beat, and offset information related to the grid or BPM settings. This is useful for time-based synchronization in audio or visual projects. ```lua tempo, beat, offset = obj.getinfo("bpm") ``` -------------------------------- ### Trackbar Movement Script (Linear Interpolation) Source: https://docs.aviutl2.jp/lua/examples This script moves a trackbar's value linearly from a start point to an end point. It ignores intermediate points and can be configured for acceleration/deceleration and initial values. ```aulua index, ratio = math.modf(obj.getpoint("index")) st = obj.getpoint(index) ed = obj.getpoint(index + 1) return st + (ed - st) * ratio ``` -------------------------------- ### Get Base Opacity Source: https://docs.aviutl2.jp/lua Retrieves the base opacity of the object, ranging from 0.0 (transparent) to 1.0 (opaque). ```lua obj.getvalue("alpha") ``` -------------------------------- ### Get Audio Data from File or Buffer Source: https://docs.aviutl2.jp/lua Retrieves audio data from a specified file or the current audio buffer. Supports different data types like PCM, spectrum, and Fourier transforms. The buffer can be provided or returned by the function. ```lua n = obj.getaudio(buf, "audiobuffer", "spectrum", 32) ``` ```lua n, rate = obj.getaudio(buf, "c:\\test.wav", "pcm", 1000) ``` ```lua n, rate, buf = obj.getaudio(nil, "c:\\test.wav", "pcm.r", 1000) ``` -------------------------------- ### Get Script Folder Path Source: https://docs.aviutl2.jp/lua Retrieves the absolute path to the script folder. This is useful for accessing other script-related files. ```lua obj.getinfo("script_path") ``` -------------------------------- ### Get Scene Change Display Ratio Source: https://docs.aviutl2.jp/lua Retrieves the display ratio during a scene change, ranging from 0.0 to 1.0. This is only applicable during scene changes. ```lua obj.getvalue("scenechange") ``` -------------------------------- ### Get Text Image Layout Size Source: https://docs.aviutl2.jp/lua Retrieves the pixel dimensions (width and height) of text when loaded as an image. Can also return center coordinates (cx, cy) if alignment is specified. Uses the same parameters as loading text. ```lua w, h = obj.load("text.layout", "この文字を画像として読み込んだ時のサイズ") ``` ```lua w, h, cx, cy = obj.load("text.layout", "中心座標付き", 0, 0, 0) ``` -------------------------------- ### Get Movie File Information Source: https://docs.aviutl2.jp/lua Retrieves information about a movie file, including frame count, frame rate (rate), and frame rate (scale), without updating the current object. Returns all zeros on failure. ```lua obj.load("movie.info", "c:\\test.avi") ``` -------------------------------- ### Get Anchor Point Coordinates (Trackbars) Source: https://docs.aviutl2.jp/lua/examples This script retrieves coordinates from multiple trackbars (X, Y, Z) grouped together, allowing for animated anchor points. ```aulua --track@x:X,-100000,100000,0 --track@y:Y,-100000,100000,0 --track@z:Z,-100000,100000,0 --trackgroup@x,y,z:Group num = obj.setanchor("x,y,z", 0, "xyz", "line") for i = 0, num - 1 do x = obj.getvalue("track.x", 0, i) y = obj.getvalue("track.y", 0, i) z = obj.getvalue("track.z", 0, i) end ``` -------------------------------- ### Trackbar Movement Script (Multiple Parameters) Source: https://docs.aviutl2.jp/lua/examples This script demonstrates retrieving multiple parameter values from a trackbar, allowing for more complex control. ```aulua param1, param2 = obj.getpoint("param") ``` -------------------------------- ### Define Folder Selection Item Source: https://docs.aviutl2.jp/lua Enable a folder selection item at the beginning of a script file. ```aulua --folder@path:フォルダ ``` -------------------------------- ### Get Base Scale Z Source: https://docs.aviutl2.jp/lua Retrieves the base Z-axis scaling factor of the object. ```lua obj.getvalue("sz") ``` -------------------------------- ### Set and Print Global Variable Source: https://docs.aviutl2.jp/lua Demonstrates how to set a global variable and print its value using Lua in AviUtl. ```aulua global.test = 123 print(global.test) ``` -------------------------------- ### Get Base Position X Source: https://docs.aviutl2.jp/lua Retrieves the base X-coordinate of the object's position. ```lua obj.getvalue("x") ``` -------------------------------- ### obj.getinfo Source: https://docs.aviutl2.jp/lua Retrieves various environment information. ```APIDOC ## obj.getinfo(name,...) ### Description Retrieves various environment information. ### Parameters * `name`: The name of the information to retrieve. #### Script Folder Path ```aulua obj.getinfo("script_path") ``` * Returns: Path to the script folder. #### Checking if Filter Object is Being Processed ```aulua obj.getinfo("filter") ``` * Returns: `true`: Currently processing filter object. #### Checking if Video is Being Output ```aulua obj.getinfo("saving") ``` * Returns: `true`: Outputting / `false`: Not outputting. #### Getting Maximum Image Size ```aulua max_x, max_y = obj.getinfo("image_max") ``` * Returns: Maximum image size (width, height). #### Getting Grid (BPM) Information ```aulua tempo, beat, offset = obj.getinfo("bpm") ``` * Returns: Tempo, time signature, reference time. #### Getting Elapsed Time Since Application Start ```aulua sec = obj.getinfo("clock") ``` * Returns: Elapsed time since application start (seconds). (Measured with performance counter). #### Getting Script Processing Time ```aulua msec = obj.getinfo("script_time") ``` * Returns: Elapsed time since script execution start (milliseconds). (Measured with performance counter). #### Getting Version Information ```aulua version = obj.getinfo("version") ``` * Returns: Main application version number. ``` -------------------------------- ### Get Base Rotation Z Angle Source: https://docs.aviutl2.jp/lua Retrieves the base Z-axis rotation angle of the object. ```lua obj.getvalue("rz") ``` -------------------------------- ### Define File Selection Item Source: https://docs.aviutl2.jp/lua Enable a file selection item at the beginning of a script file. ```aulua --file@path:画像ファイル obj.load("image", path) ``` -------------------------------- ### Get Object Section Number Source: https://docs.aviutl2.jp/lua Returns the number of sections (intermediate points + 1) for the object. ```lua obj.getoption("section_num") ``` -------------------------------- ### Enable Billboard Behavior Source: https://docs.aviutl2.jp/lua Configures the object to face the camera. Options include not facing, facing only horizontally, only vertically, or fully facing. ```lua obj.setoption("billboard", 3) ``` -------------------------------- ### Get Trackbar Mode Source: https://docs.aviutl2.jp/lua Retrieves the movement mode of a specified trackbar. Returns 0 if there is no movement. ```lua --track@vx:X speed,-10,10,0 obj.getoption("track_mode", "vx") ``` -------------------------------- ### obj.pixeloption Source: https://docs.aviutl2.jp/lua Sets options for `obj.getpixel()`, `obj.putpixel()`, and `obj.copypixel()`. These settings need to be specified for each script call. ```APIDOC ## obj.pixeloption(name, value) ### Description Sets options for the processing of `obj.getpixel()`, `obj.putpixel()`, and `obj.copypixel()`. This needs to be specified for each script call. * `name`: Option name. * `value`: Option value. #### Specifying Pixel Information Type `obj.pixeloption("type", value)` * `value`: `"col"` / `"rgb"` / `"yc"` #### Specifying Pixel Information Read Destination `obj.pixeloption("get", value)` * `value`: `"object"`: object / `"framebuffer"`: framebuffer #### Specifying Pixel Information Write Destination `obj.pixeloption("put", value)` * `value`: `"object"`: object / `"framebuffer"`: framebuffer #### Specifying Blend Type for Writing `obj.pixeloption("blend", value)` * `value`: No argument = replace / 0 = normal / 1 = add / 2 = subtract / 3 = multiply ``` -------------------------------- ### Load Image File Source: https://docs.aviutl2.jp/lua Loads an image from a specified file. Returns true on success and false on failure. ```lua obj.load("image", "c:\\test.bmp") ``` -------------------------------- ### Get Base Zoom Value Source: https://docs.aviutl2.jp/lua Retrieves the base zoom value, which is equivalent to scaling. Note that this differs from `obj.zoom`. ```lua obj.getvalue("zoom") ``` -------------------------------- ### Get AviUtl Version Source: https://docs.aviutl2.jp/lua Retrieves the version number of the main AviUtl application. Useful for compatibility checks or feature detection. ```lua version = obj.getinfo("version") ``` -------------------------------- ### Define Font Setting Item Source: https://docs.aviutl2.jp/lua Enable a font setting item at the beginning of a script file. ```aulua --font@font:フォント名,MS UI Gothic obj.setfont(font, 50, deco, col1, col2) ``` -------------------------------- ### obj.getpixel Source: https://docs.aviutl2.jp/lua Retrieves pixel information from the current object. Can be used to get pixel color, RGB values, or the dimensions of the object. ```APIDOC ## obj.getpixel([x, y[, type]]) ### Description Retrieves pixel information from the current object. Calling without arguments returns the number of pixels in the object. Note: `getpixel()` returns values from cached data to reduce VRAM access. In some situations, the cache may not be updated, and incorrect values may be returned (e.g., with draw or pixel-related drawing functions). You can actively discard the cache by processing `obj.pixeloption("get", xxx)`. * `x, y`: The coordinates of the pixel to retrieve. * `type`: The type of pixel information (`"col"`, `"rgb"`, or `"yc"`). If omitted, it defaults to the type specified by `obj.pixeloption("type")` (usually `"col"`). * Return Value: * If `type` is `"col"`: Color information (0x000000 to 0xffffff) and opacity (0.0 = transparent / 1.0 = opaque). ```aulua col, a = obj.getpixel(0, 0, "col") ``` * If `type` is `"rgb"`: RGBA information for each 8-bit channel (0 to 255). ```aulua r, g, b, a = obj.getpixel(0, 0, "rgb") ``` * If `type` is `"yc"`: YCbCr old internal format. ```aulua y, cb, cr, a = obj.getpixel(0, 0, "yc") ``` * If called without arguments: The width and height in pixels. ```aulua w, h = obj.getpixel() ``` ``` -------------------------------- ### Define Color Setting Item Source: https://docs.aviutl2.jp/lua Enable a color setting item. If nil is specified as the default value, transparency selection will be possible. ```aulua --color@col:図形色,0xffffff obj.load("figure", "四角形", col, 100) ``` -------------------------------- ### obj.getoption Source: https://docs.aviutl2.jp/lua Retrieves various options for the current object. This method can be used to query settings like track bar modes, script names, GUI visibility, camera status, and camera parameters. ```APIDOC ## obj.getoption(name, ...) ### Description Retrieves various options for the current object. ### Parameters * `name` (string): The name of the option to retrieve. * `...` (optional): Additional arguments depending on the option name. #### Supported Options: * **`"track_mode"`**: Gets the movement mode of a track bar. * `value` (string or number): The variable name or number of the track bar. * Returns: String representing the movement mode, or 0 if no movement. * **`"section_num"`**: Gets the number of sections (intervals) for the object. * Returns: Number of sections (number of intermediate points + 1). * **`"script_name"`**: Gets the script name. * `value` (optional, number): Relative position of the filter effect (0=self, negative=above, positive=below). * `skip` (optional, boolean): Whether to skip disabled filter effects (`true` to skip, `false` to not skip). * Returns: Script name (empty string if not a script). * **`"gui"`**: Checks the visibility status of the GUI. * Returns: `true` if visible, `false` if hidden. * **`"camera_mode"`**: Gets the camera control status. * Returns: 0 if not a camera control target, non-zero if it is. * **`"camera_param"`**: Retrieves the camera parameters. * Returns: A table containing camera parameters (similar to `obj.setoption("camera_param")`). ``` -------------------------------- ### Get Camera Mode Status Source: https://docs.aviutl2.jp/lua Checks if the object is currently under camera control. Returns a boolean value indicating the status. ```lua obj.getoption("camera_mode") ``` -------------------------------- ### Get Script Execution Time Source: https://docs.aviutl2.jp/lua Measures the elapsed time in milliseconds since the script execution began. This is helpful for performance profiling. ```lua msec = obj.getinfo("script_time") ``` -------------------------------- ### Load Text as Image Source: https://docs.aviutl2.jp/lua Loads text as an image. Supports color, size, and font control characters. Speed and time parameters can control the number of characters displayed. Returns true on success, false on failure. ```lua obj.load("text", "この文字が画像として読み込まれます") ``` -------------------------------- ### Get Trackbar Value Source: https://docs.aviutl2.jp/lua Retrieves the value of a trackbar at a specific time and section. Supports named trackbars and standard numbered ones. ```lua obj.getvalue("track.vx") ``` -------------------------------- ### Get Script Name Relative to Current Source: https://docs.aviutl2.jp/lua Retrieves the name of the script. Can filter by relative position (above/below) and skip disabled filters. ```lua if obj.getoption("script_name") == obj.getoption("script_name", -1) then -- Code to execute if the script name matches the one above it end ``` -------------------------------- ### obj.module Source: https://docs.aviutl2.jp/lua Retrieves functions from a script module (.mod2). ```APIDOC ## obj.module(name) ### Description Retrieves functions from a script module (.mod2). ### Parameters * `name`: Module name (base filename of the script module). * Returns: Function table of the script module. Example: ```aulua local func = obj.module("ScriptModule") local total = func.sum(1, 2, 3) ``` ``` -------------------------------- ### Get Maximum Image Size Source: https://docs.aviutl2.jp/lua Retrieves the maximum dimensions (width and height) supported for images. This can be useful for pre-allocating buffers or setting constraints. ```lua max_x, max_y = obj.getinfo("image_max") ``` -------------------------------- ### Define Figure Setting Item Source: https://docs.aviutl2.jp/lua Enable a figure setting item at the beginning of a script file. ```aulua --figure@fig:先端図形,三角形 obj.load("figure", fig, col, 100) ``` -------------------------------- ### Load Temporary Buffer Source: https://docs.aviutl2.jp/lua Loads content from a temporary buffer created using obj.copybuffer() or obj.setoption(). Optionally specify a region (x, y, w, h). Returns true on success, false on failure. ```lua load("tempbuffer", 0, 0, 200, 200) ``` -------------------------------- ### Get Layer 7 Object Position X Source: https://docs.aviutl2.jp/lua Retrieves the base X-coordinate of an object on Layer 7. This syntax can be used for any layer and property. ```lua obj.getvalue("layer7.x") ``` -------------------------------- ### Check GUI Visibility Source: https://docs.aviutl2.jp/lua Determines if the GUI is currently displayed. The GUI is hidden during video output. ```lua obj.getoption("gui") ``` -------------------------------- ### Define Setting Group Source: https://docs.aviutl2.jp/lua Group subsequent settings. The default display state can be specified. An unspecified '--group' defines the end of a group. ```aulua --group:座標 ``` -------------------------------- ### Get Object Setting Value Source: https://docs.aviutl2.jp/lua Retrieves the current setting value of an object's effect or item. Supports specifying time and section for value retrieval. ```aulua font = obj.getvalue("テキスト", "フォント") range = obj.getvalue("ぼかし:1", "範囲") ``` -------------------------------- ### Get Generic Data Pointer Source: https://docs.aviutl2.jp/lua Retrieves a pointer to a generic data area, typically used for script modules or DLLs. Requires a registered name for the data area. ```lua obj.data(name) ``` -------------------------------- ### obj.setoption Source: https://docs.aviutl2.jp/lua Sets various options for the current object. These settings need to be specified for each script call. Options include culling, billboard behavior, blend modes, draw targets (virtual or frame buffer), focus mode, camera parameters, and sampler modes. ```APIDOC ## obj.setoption(name, value, [option]) ### Description Sets various options for the current object. These settings need to be specified for each script call. ### Parameters * `name` (string): The name of the option to set. * `value`: The value of the option. * `option` (optional): An additional parameter for some options, like blend mode or draw target size. #### Supported Options: * **`"culling"`**: Controls backface culling. * `value`: 0 = Display, 1 = Hide * **`"billboard"`**: Makes the object face the camera. * `value`: 0 = Don't face, 1 = Horizontal only, 2 = Vertical only, 3 = Face fully * **`"blend"`**: Sets the compositing mode. * `value` (string): Blend mode name (e.g., "none", "add", "sub", "mul", "screen", "overlay", "light", "dark", "brightness", "chroma", "shadow", "light_dark", "diff"). * `value` (string, for virtual buffer): "alpha_add", "alpha_max", "alpha_sub", "alpha_add2", "rgba_add". * `option` (optional): For virtual buffer specific modes, color information is averaged and alpha is added/max/sub/added. * **`"drawtarget"`**: Changes the drawing destination. * `value`: "tempbuffer" or "framebuffer". * `option` (optional, for "tempbuffer"): `w` (width), `h` (height) for the virtual buffer size. * **`"draw_state"`**: Modifies the status of whether the frame buffer has been drawn to within the script. * `flag` (boolean): `true` = Drawn, `false` = Not drawn. * **`"focus_mode"`**: Sets the object's focus frame mode. * `value` (string): "fixed_size" (fixed size frame), "no_resize" (no resize frame). * **`"camera_param"`**: Sets camera parameters. * `cam` (table): Table containing camera parameters like position (`.x`, `.y`, `.z`), target (`.tx`, `.ty`, `.tz`), rotation (`.rz`), up vector (`.ux`, `.uy`, `.uz`), and distance (`.d`). * **`"sampler"`**: Changes the sampler mode for drawing. * `value` (string): "clip" (transparent outside region, default for obj.draw()), "clamp" (outermost color outside region, default for obj.drawpoly()), "loop" (repeats), "mirror" (mirrors and repeats), "dot" (no interpolation, transparent outside region). ``` -------------------------------- ### obj.load() Source: https://docs.aviutl2.jp/lua Loads various types of media into the current object. The type can be omitted for automatic detection. Previously loaded images will be discarded. ```APIDOC ## obj.load([type],...) ### Description Loads media into the current object. If `type` is omitted, it will be automatically determined. Previously loaded images will be discarded. ### Method `obj.load(type, ...)` ### Parameters * `type` (string) - Optional - The type of media to load. If omitted, it will be automatically detected. #### Video File `obj.load("movie", file[, time])` `obj.load("movie.frame", file[, frame])` Loads an image from a video file at a specified time or frame. * `file` (string) - The path to the video file. * `time` (number) - The time in seconds to capture the image (defaults to the object's current time). * `frame` (number) - The frame number to capture. * Returns: (number) The total duration of the video in seconds. Returns 0 on failure. #### Video File Information `obj.load("movie.info", file)` Retrieves information about a video file without updating the current object. * `file` (string) - The path to the video file. * Returns: (number, number, number) The total number of frames, frame rate (rate), and frame rate (scale). Returns 0 for all on failure. #### Image File `obj.load("image", file)` Loads an image file. * `file` (string) - The path to the image file. * Returns: (boolean) `true` on success, `false` on failure. #### Text `obj.load("text", text[, speed, time, align])` Loads text. Supports control characters for color, size, and font. `speed` and `time` can be used to control the number of characters displayed per unit of time. Cannot be used with text objects. * `text` (string) - The text to load. * `speed` (number) - The number of characters to display per second for the `time` parameter. * `time` (number) - The elapsed time for the `speed` parameter. * `align` (number) - Text alignment type. Specifies horizontal and vertical alignment. * Horizontal (0-8): Left/Center/Right aligned, Top/Middle/Bottom position. * Vertical (9-17): Top/Middle/Bottom aligned, Right/Center/Left position. * Returns: (boolean) `true` on success, `false` on failure. #### Text Layout `obj.load("text.layout", text[, speed, time, align])` Also accepts `"textlayout"` as a type. Gets the image size of text that would be loaded by `obj.load("text")`. Arguments are the same. Does not update the current object information, only returns the size. * Returns: (number, number) The width and height in pixels. If alignment is specified, returns center coordinates as well (width, height, cx, cy). #### Figure `obj.load("figure", name[, color, size, line, round])` Loads a figure. * `name` (string) - The name of the figure or an SVG file name. * `color` (number) - The color in 0x000000 to 0xffffff format. * `size` (number) - The size of the figure. * `line` (number) - The line width of the figure. * `round` (boolean) - Whether to round the corners (`true`) or not (`false`, default). * Returns: (boolean) `true` on success, `false` on failure. #### Frame Buffer `obj.load("framebuffer"[, x, y, w, h][, alpha])` Loads from a frame buffer. * `x, y, w, h` (number) - The range to capture from the frame buffer (defaults to the entire buffer). * `alpha` (boolean) - Whether to preserve the alpha channel (`true`) or not (`false`, default). * Returns: (boolean) `true` on success, `false` on failure. #### Virtual Buffer `obj.load("tempbuffer"[, x, y, w, h])` Loads from a virtual buffer. Virtual buffers can be created using `obj.copybuffer()` and `obj.setoption()`. * `x, y, w, h` (number) - The range to capture from the virtual buffer (defaults to the entire buffer). * Returns: (boolean) `true` on success, `false` on failure. #### Object on Layer `obj.load("layer", no[, effect])` Loads an object from a specified layer. May not work correctly if individual objects or effects have their own drawing processes. * `no` (number) - The layer number (1-based). * `effect` (boolean) - Whether to execute additional effects (`true`) or not (`false`, default). * Returns: (boolean) `true` on success, `false` on failure. #### Previous Object `obj.load("before")` Loads the immediately preceding object. Can only be used when loading another object before a custom object. * Returns: (boolean) `true` on success, `false` on failure. ### Request Example ```aulua obj.load("movie", "c:\\test.avi") obj.load("image", "c:\\test.bmp") obj.load("text", "This text will be loaded as an image") w, h = obj.load("text.layout", "Size of this text when loaded as an image") w, h, cx, cy = obj.load("text.layout", "With center coordinates", 0, 0, 0) obj.load("figure", "Circle", 0xffffff, 100, true) ``` ``` -------------------------------- ### Get Pixel Color Information Source: https://docs.aviutl2.jp/lua Retrieves pixel information (color, RGB, or YCbCr) at specified coordinates. Can also return object dimensions when called without arguments. ```aulua col, a = obj.getpixel(0, 0, "col") ``` ```aulua r, g, b, a = obj.getpixel(0, 0, "rgb") ``` ```aulua y, cb, cr, a = obj.getpixel(0, 0, "yc") ``` ```aulua w, h = obj.getpixel() ``` -------------------------------- ### Get Base Aspect Ratio Source: https://docs.aviutl2.jp/lua Retrieves the base aspect ratio of the object. Positive values indicate horizontal shrinking, negative values indicate vertical shrinking. ```lua obj.getvalue("aspect") ``` -------------------------------- ### Register a Single Script in a File Source: https://docs.aviutl2.jp/lua/examples Defines a single animation effect, custom object, or scene within a script file. ```aulua --track0:速度,-10,10,10 obj.ox = obj.ox + obj.track0 * obj.time ``` -------------------------------- ### Set Multiple Anchor Points with Different Properties Source: https://docs.aviutl2.jp/lua/examples This script sets two different anchor points ('pos1' and 'pos2') with distinct loop/line modes and colors. ```aulua --value@pos1:座標1,{} --value@pos2:座標2,{} obj.setanchor("pos1", 4, "loop", "color", RGB(0, 255, 255)) obj.setanchor("pos2", 2, "line", "color", RGB(0, 255, 0)) ``` -------------------------------- ### Get Anchor Point Coordinates (Array) Source: https://docs.aviutl2.jp/lua/examples This script retrieves coordinates from a 'pos' array variable, suitable for 3D coordinates (XYZ per point). The 'pos' array can be initialized with default values. ```aulua --value@pos:座標,{} num = 3 obj.setanchor("pos", num, "loop") for i = 0, num - 1 do x = pos[i * 2 + 1] y = pos[i * 2 + 2] end ``` -------------------------------- ### Define Label for Object Addition Menu Source: https://docs.aviutl2.jp/lua Set the initial value of the label in the object addition menu hierarchy. ```aulua --label:加工 ``` -------------------------------- ### Specify Script Type Source: https://docs.aviutl2.jp/lua Specify the script type (luaJIT or lua). Defaults to luaJIT if not specified. ```aulua --script:lua ``` -------------------------------- ### Configure Pixel Operations Source: https://docs.aviutl2.jp/lua Sets options for getpixel(), putpixel(), and copypixel() functions. Options include pixel data type, read/write targets, and blend modes. ```aulua obj.pixeloption("type", "col") ``` ```aulua obj.pixeloption("get", "object") ``` ```aulua obj.pixeloption("put", "object") ``` ```aulua obj.pixeloption("blend", 1) ``` -------------------------------- ### Load Movie Frame from File Source: https://docs.aviutl2.jp/lua Loads an image from a specified time in a movie file. Returns the total duration of the movie in seconds. Use 'movie.frame' to specify frame number. ```lua obj.load("movie", "c:\\test.avi") ``` ```lua obj.load("movie.frame", "c:\\test.avi", 100) ``` -------------------------------- ### Execute Pixel Shader Source: https://docs.aviutl2.jp/lua Executes a registered pixel shader on a target buffer using specified resources, constants, blend mode, and sampler settings. Resources can include other buffers or a random number buffer. ```lua obj.pixelshader(name, target, {resource, ...}[, {constant, ...}, blend, sampler]) ``` -------------------------------- ### Enable Filter Object Support Source: https://docs.aviutl2.jp/lua Enable filter object support for script files. Filter objects have frame buffer data and specific restrictions on object modification. ```aulua --filter ``` -------------------------------- ### obj.drawpoly({table}[,alpha]) Source: https://docs.aviutl2.jp/lua Draws using a table of arguments for `obj.drawpoly()`. This is faster than calling `obj.drawpoly()` multiple times. ```APIDOC ## obj.drawpoly({table}[,alpha]) ### Description Allows specifying arguments for multiple `obj.drawpoly()` calls within a table. This method is faster than calling `obj.drawpoly()` multiple times. ### Parameters - `table` (table): A table containing the drawing parameters. Supported formats include: - `{x0,y0,z0,x1,y1,z1,x2,y2,z2,x3,y3,z3,u0,v0,u1,v1,u2,v2,u3,v3}` - `{x0,y0,z0,x1,y1,z1,x2,y2,z2,x3,y3,z3,u0,v0,u1,v1,u2,v2,u3,v3,vx0,vy0,vz0,vx1,vy1,vz1,vx2,vy2,vz2,vx3,vy3,vz3}` (includes normal vectors) - `{x0,y0,z0,x1,y1,z1,x2,y2,z2,x3,y3,z3,r0,g0,b0,a0,r1,g1,b1,a1,r2,g2,b2,a2,r3,g3,b3,a3}` (includes vertex colors) - `{x0,y0,z0,x1,y1,z1,x2,y2,z2,x3,y3,z3,r0,g0,b0,a0,r1,g1,b1,a1,r2,g2,b2,a2,r3,g3,b3,a3,vx0,vy0,vz0,vx1,vy1,vz1,vx2,vy2,vz2,vx3,vy3,vz3}` (includes colors and normal vectors) - `alpha` (number, optional): Opacity (0.0 = transparent / 1.0 = opaque). ### Notes - Different table formats cannot be mixed within a single call. - `vx,vy,vz` represent normal vectors. - `r,g,b,a` represent drawing colors (premultiplied alpha, 0.0 to 1.0). Object images are not used when colors are specified. ### Example ```aulua vertex = {} table.insert(vertex, { x0, y0, 0, x1, y1, 0, x2, y2, 0, x3, y3, 0, u0, v0, u1, v1, u2, v2, u3, v3 }) table.insert(vertex, { x0, y0, 100, x1, y1, 100, x2, y2, 100, x3, y3, 100, u0, v0, u1, v1, u2, v2, u3, v3 }) obj.drawpoly(vertex) ``` ``` -------------------------------- ### obj.setanchor Source: https://docs.aviutl2.jp/lua Displays anchor points and reflects their settings and positions in variables. It's crucial to call this function in the correct order and number of times for accurate reflection. ```APIDOC ## obj.setanchor(name, num[, option, ...]) ### Description Displays anchor points. This function reflects the anchor point display settings and updates variables if the anchor has moved when called. Incorrect calling order or frequency may lead to improper reflection. * `name`: Specifies the variable name where coordinates defined in `--value` and `--dialog` are stored. Specify the variable name as a string. If "track" is specified, it refers to the values of the start, end, and intermediate points of the trackbar defined by `--track0`. If variable names are listed as comma-separated items, it refers to the values of each trackbar defined by `--track@xxx` for start, end, and intermediate points. Specifying a table variable name directly will only display the lines without anchor display or movement. * `num`: Specifies the number of anchor points. For `name="track"`, specify 0. The number of anchor points corresponds to the number of start, end, and intermediate points. * `option`: Various options can be listed. * `"line"`: Connects anchor points with lines. * `"loop"`: Connects anchor points in a loop. * `"star"`: Connects anchor points to the center of the object. * `"arm"`: Connects anchor points to the center of the object. * `"mesh", horizontal_count, vertical_count`: Connects anchor points in a mesh pattern. Specify the grid point counts in subsequent arguments. * `"color", color`: Changes the color (RGB) of the lines for the above options. Specify the color (0x000000 to 0xffffff) in the subsequent argument. * `"rgba", color`: Changes the color (RGBA) of the lines for the above options. Specify the color including alpha (0x00000000 to 0xffffffff) in the subsequent argument. * `"inout"`: Displays the lines for the above options as two separate IN and OUT points (anchor points will be halved). * `"xyz"`: Controls anchor points in 3D coordinates. (Default is 2D coordinates). * `"screen"`: Controls in screen coordinates. (Default is object coordinates). Note: When used with camera control + shadow, the shadow part in the preview may be slightly offset. * Return Value: The number of anchor points obtained. ### Example ```aulua obj.setanchor("pos", 3) n = obj.setanchor("track", 0, "line") ``` ``` -------------------------------- ### Specify Script Information Source: https://docs.aviutl2.jp/lua Set script information, such as version and author. ```aulua --information:テストスクリプト ver2.00 by Kenkun ```