全言語ドキュメントへ scene.set / scene.get とグローバル関数を追記
このコミットが含まれているのは:
8ファイル変更
+508
-24
検索条件に一致するファイルはありません
@@ -150,6 +150,25 @@
|
||||
scene.width : الدقة الأفقية (بكسل) للمشهد (المشروع) [للقراءة فقط]
|
||||
scene.height : الدقة الرأسية (بكسل) للمشهد (المشروع) [للقراءة فقط]
|
||||
|
||||
scene.set(name, value)
|
||||
يخزّن قيمة في منطقة مشتركة على مستوى المشهد.
|
||||
يمكن قراءة القيمة عبر scene.get(name) من جميع تأثيرات نصوص Lua
|
||||
في المشهد نفسه، عبر العناصر والإطارات.
|
||||
name : اسم القيمة (نص)
|
||||
value : القيمة المراد تخزينها (رقم أو نص أو قيمة منطقية). تمرير nil
|
||||
يحذفها.
|
||||
* القيم غير الأرقام والنصوص والقيم المنطقية (الجداول والدوال وغيرها)
|
||||
لا يتم تخزينها.
|
||||
* تُقتطع الأسماء وقيم النصوص بعد 4095 بايت بترميز UTF-8.
|
||||
مثال: scene.set("shared_x", obj.x)
|
||||
scene.get(name)
|
||||
يسترجع قيمة مخزّنة عبر scene.set(). يعيد nil للأسماء غير المعيّنة.
|
||||
مثال: local x = scene.get("shared_x") or 0
|
||||
* القيم مستقلة لكل مشهد وتبقى في الذاكرة حتى إغلاق YMM4
|
||||
(لا تُحفظ في ملف المشروع).
|
||||
* ترتيب التقييم بين العناصر غير مضمون، لذا تجنّب التصاميم التي تعتمد على
|
||||
ترتيب الكتابة والقراءة داخل الإطار نفسه.
|
||||
|
||||
|
||||
- جدول obj - المتغيرات -
|
||||
|
||||
@@ -602,6 +621,49 @@
|
||||
anim.bezier(t, p0, p1, p2, p3): Evaluates cubic bezier curve at `t` (0.0~1.0)
|
||||
|
||||
|
||||
- الدوال العامة المتوافقة مع AviUtl -
|
||||
|
||||
يمكن استدعاء الدوال التالية مباشرة في النطاق العام.
|
||||
تعيد نتائج متطابقة على جميع محركات التنفيذ (MoonSharp / الأصلي).
|
||||
|
||||
RGB(r, g, b)
|
||||
RGB(col)
|
||||
RGB(r1, g1, b1, r2, g2, b2)
|
||||
تحوّل بين قيمة اللون (0x000000-0xffffff) ومكوّناتها الأحمر والأخضر
|
||||
والأزرق (0-255 لكل منها). بثلاث وسائط تركّب قيمة لون واحدة، وبوسيطة
|
||||
واحدة تفكّكها إلى r وg وb. بست وسائط تعيد لونًا يتغيّر خطيًا من اللون
|
||||
الأول إلى الثاني وفق الزمن المنقضي للكائن
|
||||
(obj.time / obj.totaltime).
|
||||
مثال: col = RGB(64, 192, 255) -- 0x40C0FF
|
||||
مثال: r, g, b = RGB(0x0080FF) -- 0, 128, 255
|
||||
مثال: col = RGB(64,192,255, 128,64,0) -- اللون الأول ← الثاني
|
||||
|
||||
HSV(h, s, v)
|
||||
HSV(col)
|
||||
HSV(h1, s1, v1, h2, s2, v2)
|
||||
تحوّل بين قيمة اللون (0x000000-0xffffff) وتدرّج اللون (0-360)
|
||||
والتشبع (0-100) والقيمة (0-100). تعمل الوسائط مثل RGB().
|
||||
مثال: col = HSV(60, 100, 100) -- 0xFFFF00
|
||||
مثال: h, s, v = HSV(0x0080FF) -- 210, 100, 100
|
||||
|
||||
OR(a, b) / AND(a, b) / XOR(a, b)
|
||||
تنفّذ عمليات على مستوى البتات (أو / و / أو حصرية) على أعداد صحيحة
|
||||
بطول 32 بت. تُقتطع الكسور حتى 0.5 بالضبط عند التحويل إلى عدد صحيح
|
||||
(2.50 ← 2، 2.51 ← 3).
|
||||
مثال: result = OR(8, 3) -- 11
|
||||
|
||||
SHIFT(a, shift)
|
||||
تنفّذ إزاحة حسابية. القيمة الموجبة تزيح لليسار والسالبة تزيح لليمين.
|
||||
مثال: result = SHIFT(5, 3) -- 40
|
||||
مثال: result = SHIFT(91, -2) -- 22
|
||||
|
||||
debug_print(text)
|
||||
ترسل النص المحدد إلى OutputDebugString(). للتصحيح.
|
||||
يمكن عرض الرسائل بأداة مراقبة تصحيح مثل DebugView. عند حدوث خطأ في
|
||||
تنفيذ النص البرمجي تُرسل رسالة الخطأ تلقائيًا أيضًا.
|
||||
مثال: debug_print(string.format("x = %d", obj.x))
|
||||
|
||||
|
||||
- المكتبات القياسية المتاحة -
|
||||
|
||||
مكتبة math:
|
||||
@@ -758,14 +820,12 @@
|
||||
× تحميل الوحدات عبر require، والوصول العشوائي إلى الملفات مثل
|
||||
io / dofile (تحميل الصور / الفيديو عبر obj.load مدعوم مع التحقق
|
||||
من الترويسة).
|
||||
× obj.setanchor، scene.set / scene.get وما شابه.
|
||||
× obj.setanchor وما شابه.
|
||||
|
||||
|
||||
- الميزات غير المدعومة / القيود -
|
||||
|
||||
× obj.rand1()، obj.mes()، obj.setanchor() وما شابه من AviUtl2 غير مدعومة.
|
||||
× الدوال مثل scene.set() و scene.get() في جدول scene الخاص بـ AviUtl2 غير مدعومة.
|
||||
(يمكن قراءة scene.width و scene.height فقط)
|
||||
× الوصول العشوائي إلى الملفات من النصوص (require, dofile, io وما شابه) غير مدعوم.
|
||||
فقط obj.load("image"/"movie") يحمّل الملفات المؤكَّد أنها وسائط أصلية عبر
|
||||
التحقق من الترويسة الأولى.
|
||||
|
||||
@@ -157,6 +157,24 @@
|
||||
scene.cx : Half of the scene's horizontal resolution (= scene.width / 2) [ReadOnly]
|
||||
scene.cy : Half of the scene's vertical resolution (= scene.height / 2) [ReadOnly]
|
||||
|
||||
scene.set(name, value)
|
||||
Stores a value in a shared area scoped to the scene.
|
||||
The value can be read back with scene.get(name) from every Lua script
|
||||
effect in the same scene, across items and frames.
|
||||
name : Name of the value (string)
|
||||
value : Value to store (number, string, or boolean). Passing nil removes it.
|
||||
* Values other than numbers, strings, and booleans (tables, functions,
|
||||
etc.) are not stored.
|
||||
* Names and string values are truncated beyond 4095 bytes in UTF-8.
|
||||
Example: scene.set("shared_x", obj.x)
|
||||
scene.get(name)
|
||||
Retrieves a value stored with scene.set(). Returns nil for unset names.
|
||||
Example: local x = scene.get("shared_x") or 0
|
||||
* Values are independent per scene and kept in memory until YMM4 exits
|
||||
(they are not saved into the project file).
|
||||
* The evaluation order between items is not guaranteed, so avoid designs that
|
||||
depend on write/read ordering within the same frame.
|
||||
|
||||
|
||||
- obj Table - Variables -
|
||||
|
||||
@@ -623,6 +641,52 @@
|
||||
anim.bezier(t, p0, p1, p2, p3): Evaluates cubic bezier curve at `t` (0.0~1.0)
|
||||
|
||||
|
||||
- AviUtl-Compatible Global Functions -
|
||||
|
||||
The following functions can be called directly in the global scope.
|
||||
They return identical results on every execution engine (MoonSharp / native).
|
||||
|
||||
RGB(r, g, b)
|
||||
RGB(col)
|
||||
RGB(r1, g1, b1, r2, g2, b2)
|
||||
Converts between a color value (0x000000-0xffffff) and its red, green,
|
||||
and blue components (0-255 each). With 3 arguments it composes a single
|
||||
color value, and with 1 argument it decomposes into r, g, b. With 6
|
||||
arguments it returns a color that changes linearly from the first color
|
||||
to the second according to the object's elapsed time
|
||||
(obj.time / obj.totaltime).
|
||||
Example: col = RGB(64, 192, 255) -- 0x40C0FF
|
||||
Example: r, g, b = RGB(0x0080FF) -- 0, 128, 255
|
||||
Example: col = RGB(64,192,255, 128,64,0) -- start color -> end color
|
||||
|
||||
HSV(h, s, v)
|
||||
HSV(col)
|
||||
HSV(h1, s1, v1, h2, s2, v2)
|
||||
Converts between a color value (0x000000-0xffffff) and hue (0-360),
|
||||
saturation (0-100), and value (0-100). The arguments work like RGB().
|
||||
Example: col = HSV(60, 100, 100) -- 0xFFFF00
|
||||
Example: h, s, v = HSV(0x0080FF) -- 210, 100, 100
|
||||
|
||||
OR(a, b) / AND(a, b) / XOR(a, b)
|
||||
Performs bitwise operations (or / and / exclusive or) on 32-bit
|
||||
integers. Fractions up to exactly 0.5 are truncated when converting to
|
||||
integers (2.50 -> 2, 2.51 -> 3).
|
||||
Example: result = OR(8, 3) -- 11
|
||||
|
||||
SHIFT(a, shift)
|
||||
Performs an arithmetic shift. A positive shift shifts left and a
|
||||
negative shift shifts right.
|
||||
Example: result = SHIFT(5, 3) -- 40
|
||||
Example: result = SHIFT(91, -2) -- 22
|
||||
|
||||
debug_print(text)
|
||||
Sends the given string to OutputDebugString(). For debugging.
|
||||
Messages can be viewed with a debug monitor tool such as DebugView.
|
||||
When a script execution error occurs, the error message is also sent
|
||||
automatically.
|
||||
Example: debug_print(string.format("x = %d", obj.x))
|
||||
|
||||
|
||||
- Available Standard Libraries -
|
||||
|
||||
math library:
|
||||
@@ -784,14 +848,12 @@
|
||||
x Module loading via require, and arbitrary file access such as io /
|
||||
dofile (image / video loading via obj.load is supported with header
|
||||
validation).
|
||||
x obj.setanchor, scene.set / scene.get, etc.
|
||||
x obj.setanchor, etc.
|
||||
|
||||
|
||||
- Unsupported Features / Limitations -
|
||||
|
||||
x obj.rand1(), obj.mes(), obj.setanchor(), etc. from AviUtl2 are not supported.
|
||||
x Functions such as scene.set() and scene.get() in the AviUtl2 scene table are not supported.
|
||||
(Only scene.width and scene.height can be read)
|
||||
x Arbitrary file access from scripts (require, dofile, io, etc.) is not supported.
|
||||
Only obj.load("image"/"movie") loads files confirmed to be genuine media by
|
||||
leading-header validation.
|
||||
|
||||
@@ -155,6 +155,26 @@
|
||||
scene.width : Resolución horizontal (píxeles) de la escena (proyecto) [Solo lectura]
|
||||
scene.height : Resolución vertical (píxeles) de la escena (proyecto) [Solo lectura]
|
||||
|
||||
scene.set(name, value)
|
||||
Guarda un valor en un área compartida a nivel de escena.
|
||||
El valor puede leerse con scene.get(name) desde todos los efectos de
|
||||
script Lua de la misma escena, a través de elementos y fotogramas.
|
||||
name : Nombre del valor (cadena)
|
||||
value : Valor a guardar (número, cadena o booleano). Pasar nil lo elimina.
|
||||
* Los valores que no sean números, cadenas o booleanos (tablas,
|
||||
funciones, etc.) no se guardan.
|
||||
* Los nombres y los valores de cadena se truncan más allá de 4095
|
||||
bytes en UTF-8.
|
||||
Ejemplo: scene.set("shared_x", obj.x)
|
||||
scene.get(name)
|
||||
Obtiene un valor guardado con scene.set(). Devuelve nil para nombres
|
||||
no establecidos.
|
||||
Ejemplo: local x = scene.get("shared_x") or 0
|
||||
* Los valores son independientes por escena y se mantienen en memoria hasta
|
||||
que YMM4 se cierra (no se guardan en el archivo del proyecto).
|
||||
* El orden de evaluación entre elementos no está garantizado; evite diseños
|
||||
que dependan del orden de escritura/lectura dentro del mismo fotograma.
|
||||
|
||||
|
||||
- Tabla obj - Variables -
|
||||
|
||||
@@ -627,6 +647,54 @@
|
||||
anim.bezier(t, p0, p1, p2, p3): Evaluates cubic bezier curve at `t` (0.0~1.0)
|
||||
|
||||
|
||||
- Funciones globales compatibles con AviUtl -
|
||||
|
||||
Las siguientes funciones pueden llamarse directamente en el ámbito global.
|
||||
Devuelven resultados idénticos en todos los motores de ejecución
|
||||
(MoonSharp / nativo).
|
||||
|
||||
RGB(r, g, b)
|
||||
RGB(col)
|
||||
RGB(r1, g1, b1, r2, g2, b2)
|
||||
Convierte entre un valor de color (0x000000-0xffffff) y sus
|
||||
componentes rojo, verde y azul (0-255 cada uno). Con 3 argumentos
|
||||
compone un único valor de color y con 1 argumento lo descompone en
|
||||
r, g, b. Con 6 argumentos devuelve un color que cambia linealmente
|
||||
del primer color al segundo según el tiempo transcurrido del objeto
|
||||
(obj.time / obj.totaltime).
|
||||
Ejemplo: col = RGB(64, 192, 255) -- 0x40C0FF
|
||||
Ejemplo: r, g, b = RGB(0x0080FF) -- 0, 128, 255
|
||||
Ejemplo: col = RGB(64,192,255, 128,64,0) -- color inicial -> final
|
||||
|
||||
HSV(h, s, v)
|
||||
HSV(col)
|
||||
HSV(h1, s1, v1, h2, s2, v2)
|
||||
Convierte entre un valor de color (0x000000-0xffffff) y tono (0-360),
|
||||
saturación (0-100) y valor (0-100). Los argumentos funcionan como
|
||||
en RGB().
|
||||
Ejemplo: col = HSV(60, 100, 100) -- 0xFFFF00
|
||||
Ejemplo: h, s, v = HSV(0x0080FF) -- 210, 100, 100
|
||||
|
||||
OR(a, b) / AND(a, b) / XOR(a, b)
|
||||
Realiza operaciones bit a bit (or / and / or exclusivo) sobre enteros
|
||||
de 32 bits. Las fracciones hasta exactamente 0.5 se truncan al
|
||||
convertir a entero (2.50 -> 2, 2.51 -> 3).
|
||||
Ejemplo: result = OR(8, 3) -- 11
|
||||
|
||||
SHIFT(a, shift)
|
||||
Realiza un desplazamiento aritmético. Un shift positivo desplaza a la
|
||||
izquierda y uno negativo a la derecha.
|
||||
Ejemplo: result = SHIFT(5, 3) -- 40
|
||||
Ejemplo: result = SHIFT(91, -2) -- 22
|
||||
|
||||
debug_print(text)
|
||||
Envía la cadena indicada a OutputDebugString(). Para depuración.
|
||||
Los mensajes pueden verse con una herramienta de monitorización como
|
||||
DebugView. Cuando ocurre un error de ejecución del script, el mensaje
|
||||
de error también se envía automáticamente.
|
||||
Ejemplo: debug_print(string.format("x = %d", obj.x))
|
||||
|
||||
|
||||
- Bibliotecas estándar disponibles -
|
||||
|
||||
Biblioteca math:
|
||||
@@ -792,14 +860,12 @@
|
||||
x Carga de módulos mediante require y acceso arbitrario a archivos como
|
||||
io / dofile (la carga de imagen / vídeo con obj.load sí se admite con
|
||||
validación de cabecera).
|
||||
x obj.setanchor, scene.set / scene.get, etc.
|
||||
x obj.setanchor, etc.
|
||||
|
||||
|
||||
- Funciones no admitidas / Limitaciones -
|
||||
|
||||
x obj.rand1(), obj.mes(), obj.setanchor(), etc. de AviUtl2 no son compatibles.
|
||||
x Las funciones como scene.set() y scene.get() de la tabla scene de AviUtl2 no son compatibles.
|
||||
(Solo se pueden leer scene.width y scene.height)
|
||||
x El acceso arbitrario a archivos desde scripts (require, dofile, io, etc.) no es compatible.
|
||||
Solo obj.load("image"/"movie") carga archivos confirmados como medios genuinos
|
||||
mediante validación de la cabecera inicial.
|
||||
|
||||
@@ -156,6 +156,26 @@
|
||||
scene.width : Resolusi horizontal (piksel) adegan (proyek) [Hanya Baca]
|
||||
scene.height : Resolusi vertikal (piksel) adegan (proyek) [Hanya Baca]
|
||||
|
||||
scene.set(name, value)
|
||||
Menyimpan nilai ke area bersama yang dibatasi per adegan.
|
||||
Nilai dapat dibaca kembali dengan scene.get(name) dari semua efek
|
||||
skrip Lua dalam adegan yang sama, lintas item dan frame.
|
||||
name : Nama nilai (string)
|
||||
value : Nilai yang disimpan (angka, string, atau boolean). Mengirim
|
||||
nil akan menghapusnya.
|
||||
* Nilai selain angka, string, dan boolean (tabel, fungsi, dll.)
|
||||
tidak disimpan.
|
||||
* Nama dan nilai string dipotong setelah 4095 byte dalam UTF-8.
|
||||
Contoh: scene.set("shared_x", obj.x)
|
||||
scene.get(name)
|
||||
Mengambil nilai yang disimpan dengan scene.set(). Mengembalikan nil
|
||||
untuk nama yang belum diatur.
|
||||
Contoh: local x = scene.get("shared_x") or 0
|
||||
* Nilai bersifat independen per adegan dan disimpan di memori sampai YMM4
|
||||
ditutup (tidak disimpan ke berkas proyek).
|
||||
* Urutan evaluasi antar item tidak dijamin, jadi hindari desain yang
|
||||
bergantung pada urutan tulis/baca dalam frame yang sama.
|
||||
|
||||
|
||||
- Tabel obj - Variabel -
|
||||
|
||||
@@ -623,6 +643,53 @@
|
||||
anim.bezier(t, p0, p1, p2, p3): Evaluates cubic bezier curve at `t` (0.0~1.0)
|
||||
|
||||
|
||||
- Fungsi Global yang Kompatibel dengan AviUtl -
|
||||
|
||||
Fungsi-fungsi berikut dapat dipanggil langsung di lingkup global.
|
||||
Semuanya mengembalikan hasil identik di setiap mesin eksekusi
|
||||
(MoonSharp / native).
|
||||
|
||||
RGB(r, g, b)
|
||||
RGB(col)
|
||||
RGB(r1, g1, b1, r2, g2, b2)
|
||||
Mengonversi antara nilai warna (0x000000-0xffffff) dan komponen
|
||||
merah, hijau, biru (masing-masing 0-255). Dengan 3 argumen menyusun
|
||||
satu nilai warna, dan dengan 1 argumen menguraikannya menjadi
|
||||
r, g, b. Dengan 6 argumen mengembalikan warna yang berubah linear
|
||||
dari warna pertama ke warna kedua sesuai waktu objek
|
||||
(obj.time / obj.totaltime).
|
||||
Contoh: col = RGB(64, 192, 255) -- 0x40C0FF
|
||||
Contoh: r, g, b = RGB(0x0080FF) -- 0, 128, 255
|
||||
Contoh: col = RGB(64,192,255, 128,64,0) -- warna awal -> akhir
|
||||
|
||||
HSV(h, s, v)
|
||||
HSV(col)
|
||||
HSV(h1, s1, v1, h2, s2, v2)
|
||||
Mengonversi antara nilai warna (0x000000-0xffffff) dan hue (0-360),
|
||||
saturasi (0-100), serta value (0-100). Argumen bekerja seperti RGB().
|
||||
Contoh: col = HSV(60, 100, 100) -- 0xFFFF00
|
||||
Contoh: h, s, v = HSV(0x0080FF) -- 210, 100, 100
|
||||
|
||||
OR(a, b) / AND(a, b) / XOR(a, b)
|
||||
Melakukan operasi bitwise (or / and / exclusive or) pada bilangan
|
||||
bulat 32-bit. Pecahan hingga tepat 0.5 dibulatkan ke bawah saat
|
||||
dikonversi ke bilangan bulat (2.50 -> 2, 2.51 -> 3).
|
||||
Contoh: result = OR(8, 3) -- 11
|
||||
|
||||
SHIFT(a, shift)
|
||||
Melakukan pergeseran aritmetika. Shift positif menggeser ke kiri dan
|
||||
shift negatif menggeser ke kanan.
|
||||
Contoh: result = SHIFT(5, 3) -- 40
|
||||
Contoh: result = SHIFT(91, -2) -- 22
|
||||
|
||||
debug_print(text)
|
||||
Mengirim string yang ditentukan ke OutputDebugString(). Untuk
|
||||
debugging. Pesan dapat dilihat dengan alat pemantau debug seperti
|
||||
DebugView. Saat terjadi kesalahan eksekusi skrip, pesan kesalahan
|
||||
juga dikirim secara otomatis.
|
||||
Contoh: debug_print(string.format("x = %d", obj.x))
|
||||
|
||||
|
||||
- Pustaka Standar yang Tersedia -
|
||||
|
||||
Pustaka math:
|
||||
@@ -785,14 +852,12 @@
|
||||
x Pemuatan modul melalui require, dan akses berkas sembarang seperti
|
||||
io / dofile (pemuatan gambar / video via obj.load didukung dengan
|
||||
validasi header).
|
||||
x obj.setanchor, scene.set / scene.get, dll.
|
||||
x obj.setanchor, dll.
|
||||
|
||||
|
||||
- Fitur yang Tidak Didukung / Batasan -
|
||||
|
||||
x obj.rand1(), obj.mes(), obj.setanchor(), dll. dari AviUtl2 tidak didukung.
|
||||
x Fungsi seperti scene.set() dan scene.get() dalam tabel scene AviUtl2 tidak didukung.
|
||||
(Hanya scene.width dan scene.height yang dapat dibaca)
|
||||
x Akses berkas sembarang dari skrip (require, dofile, io, dll.) tidak didukung.
|
||||
Hanya obj.load("image"/"movie") yang memuat berkas yang dipastikan sebagai
|
||||
media asli melalui validasi header awal.
|
||||
|
||||
@@ -151,6 +151,23 @@
|
||||
scene.cx : シーンの横解像度の半分 (= scene.width / 2) [ReadOnly]
|
||||
scene.cy : シーンの縦解像度の半分 (= scene.height / 2) [ReadOnly]
|
||||
|
||||
scene.set(name, value)
|
||||
シーン単位の共有領域へ値を保存します。
|
||||
同じシーン内のすべての Lua スクリプトエフェクトから、アイテムや
|
||||
フレームをまたいで scene.get(name) で参照できます。
|
||||
name : 値の名前(文字列)
|
||||
value : 保存する値(数値・文字列・真偽値)。nil を渡すと削除します。
|
||||
※ 数値・文字列・真偽値以外(テーブル・関数など)は保存されません。
|
||||
※ 名前と文字列値は UTF-8 換算で 4095 バイトを超える部分を切り捨てます。
|
||||
例:scene.set("shared_x", obj.x)
|
||||
scene.get(name)
|
||||
scene.set() で保存した値を取得します。未設定の名前は nil を返します。
|
||||
例:local x = scene.get("shared_x") or 0
|
||||
※ 値はシーンごとに独立しており、YMM4 を終了するまでメモリ上に保持されます
|
||||
(プロジェクトファイルには保存されません)。
|
||||
※ アイテム間の評価順序は保証されないため、同一フレーム内での書き込みと
|
||||
読み取りの順序に依存する作りは避けてください。
|
||||
|
||||
|
||||
- obj テーブル - 変数 -
|
||||
|
||||
@@ -607,6 +624,50 @@
|
||||
anim.bezier(t, p0, p1, p2, p3): t (0.0~1.0) における3次ベジェ曲線の値を計算
|
||||
|
||||
|
||||
- AviUtl 互換のグローバル関数 -
|
||||
|
||||
以下の関数はグローバルスコープで直接呼び出せます。
|
||||
すべての実行エンジン(MoonSharp / ネイティブ)で同一の結果を返します。
|
||||
|
||||
RGB(r, g, b)
|
||||
RGB(col)
|
||||
RGB(r1, g1, b1, r2, g2, b2)
|
||||
色情報(0x000000~0xffffff)と赤・緑・青(各0~255)を相互変換します。
|
||||
引数 3 つで 1 つの色情報へ合成し、引数 1 つで r, g, b の 3 値へ
|
||||
分解します。引数 6 つでは、オブジェクトの時間経過
|
||||
(obj.time / obj.totaltime)に応じて一色目から二色目へ直線的に
|
||||
変化する色情報を返します。
|
||||
例:col = RGB(64, 192, 255) -- 0x40C0FF
|
||||
例:r, g, b = RGB(0x0080FF) -- 0, 128, 255
|
||||
例:col = RGB(64,192,255, 128,64,0) -- 開始色→終了色
|
||||
|
||||
HSV(h, s, v)
|
||||
HSV(col)
|
||||
HSV(h1, s1, v1, h2, s2, v2)
|
||||
色情報(0x000000~0xffffff)と色相(0~360)・彩度(0~100)・
|
||||
明度(0~100)を相互変換します。引数の意味は RGB() と同様です。
|
||||
例:col = HSV(60, 100, 100) -- 0xFFFF00
|
||||
例:h, s, v = HSV(0x0080FF) -- 210, 100, 100
|
||||
|
||||
OR(a, b) / AND(a, b) / XOR(a, b)
|
||||
32bit 整数としてビット演算(論理和・論理積・排他的論理和)をします。
|
||||
小数は 0.5 ちょうどまでを切り捨てて整数化します(2.50→2、2.51→3)。
|
||||
例:result = OR(8, 3) -- 11
|
||||
|
||||
SHIFT(a, shift)
|
||||
算術シフトをします。shift が正の数だと左シフト、負の数だと
|
||||
右シフトになります。
|
||||
例:result = SHIFT(5, 3) -- 40
|
||||
例:result = SHIFT(91, -2) -- 22
|
||||
|
||||
debug_print(text)
|
||||
指定の文字列を OutputDebugString() へ送ります。デバッグ用です。
|
||||
メッセージは DebugView などのデバッグモニタツールで確認できます。
|
||||
また、スクリプトの実行エラーが発生したときにはエラーメッセージが
|
||||
自動で送られます。
|
||||
例:debug_print(string.format("x = %d", obj.x))
|
||||
|
||||
|
||||
- 利用可能な標準ライブラリ -
|
||||
|
||||
math ライブラリ:
|
||||
@@ -764,14 +825,12 @@
|
||||
これらを呼び出すスクリプトは意図どおりには動作しません。
|
||||
×require によるモジュール読み込み、io / dofile などの任意ファイル
|
||||
アクセス(obj.load の画像 / 動画はヘッダー検証付きで対応)。
|
||||
×obj.setanchor、scene.set / scene.get 等。
|
||||
×obj.setanchor 等。
|
||||
|
||||
|
||||
- 非対応・制限事項 -
|
||||
|
||||
×AviUtl2 の obj.rand1(), obj.mes(), obj.setanchor() 等には対応していません。
|
||||
×AviUtl2 の scene テーブルの scene.set(), scene.get() 等の関数には対応していません。
|
||||
(scene.width と scene.height の読み取りのみ対応)
|
||||
×スクリプトからの任意ファイルアクセス(require, dofile, io 等)には対応して
|
||||
いません。obj.load("image"/"movie") のみ、先頭ヘッダー検証で真正なメディアと
|
||||
確認できたファイルを読み込みます。
|
||||
|
||||
@@ -148,6 +148,24 @@
|
||||
scene.width : 씬(프로젝트)의 가로 해상도(픽셀) [읽기 전용]
|
||||
scene.height : 씬(프로젝트)의 세로 해상도(픽셀) [읽기 전용]
|
||||
|
||||
scene.set(name, value)
|
||||
씬 단위의 공유 영역에 값을 저장합니다.
|
||||
같은 씬 안의 모든 Lua 스크립트 이펙트에서 아이템과 프레임을 넘어
|
||||
scene.get(name)으로 참조할 수 있습니다.
|
||||
name : 값의 이름(문자열)
|
||||
value : 저장할 값(숫자·문자열·불리언). nil을 전달하면 삭제됩니다.
|
||||
※ 숫자·문자열·불리언 이외(테이블·함수 등)는 저장되지 않습니다.
|
||||
※ 이름과 문자열 값은 UTF-8 기준 4095바이트를 넘는 부분이 잘립니다.
|
||||
예: scene.set("shared_x", obj.x)
|
||||
scene.get(name)
|
||||
scene.set()으로 저장한 값을 가져옵니다. 설정되지 않은 이름은 nil을
|
||||
반환합니다.
|
||||
예: local x = scene.get("shared_x") or 0
|
||||
※ 값은 씬마다 독립적이며 YMM4를 종료할 때까지 메모리에 유지됩니다
|
||||
(프로젝트 파일에는 저장되지 않습니다).
|
||||
※ 아이템 간 평가 순서는 보장되지 않으므로, 같은 프레임 안에서 쓰기와
|
||||
읽기 순서에 의존하는 구조는 피하십시오.
|
||||
|
||||
|
||||
- obj 테이블 - 변수 -
|
||||
|
||||
@@ -599,6 +617,50 @@
|
||||
anim.bezier(t, p0, p1, p2, p3): t(0.0~1.0)에서의 3차 베지어 곡선 값을 계산
|
||||
|
||||
|
||||
- AviUtl 호환 전역 함수 -
|
||||
|
||||
다음 함수는 전역 스코프에서 직접 호출할 수 있습니다.
|
||||
모든 실행 엔진(MoonSharp / 네이티브)에서 동일한 결과를 반환합니다.
|
||||
|
||||
RGB(r, g, b)
|
||||
RGB(col)
|
||||
RGB(r1, g1, b1, r2, g2, b2)
|
||||
색 정보(0x000000~0xffffff)와 빨강·초록·파랑(각 0~255)을 상호
|
||||
변환합니다. 인수 3개는 하나의 색 정보로 합성하고, 인수 1개는
|
||||
r, g, b 세 값으로 분해합니다. 인수 6개는 오브젝트의 시간 경과
|
||||
(obj.time / obj.totaltime)에 따라 첫 번째 색에서 두 번째 색으로
|
||||
선형 변화하는 색 정보를 반환합니다.
|
||||
예: col = RGB(64, 192, 255) -- 0x40C0FF
|
||||
예: r, g, b = RGB(0x0080FF) -- 0, 128, 255
|
||||
예: col = RGB(64,192,255, 128,64,0) -- 시작 색 → 종료 색
|
||||
|
||||
HSV(h, s, v)
|
||||
HSV(col)
|
||||
HSV(h1, s1, v1, h2, s2, v2)
|
||||
색 정보(0x000000~0xffffff)와 색상(0~360)·채도(0~100)·
|
||||
명도(0~100)를 상호 변환합니다. 인수의 의미는 RGB()와 같습니다.
|
||||
예: col = HSV(60, 100, 100) -- 0xFFFF00
|
||||
예: h, s, v = HSV(0x0080FF) -- 210, 100, 100
|
||||
|
||||
OR(a, b) / AND(a, b) / XOR(a, b)
|
||||
32bit 정수로 비트 연산(논리합·논리곱·배타적 논리합)을 합니다.
|
||||
소수는 정확히 0.5까지 내림하여 정수화합니다(2.50→2, 2.51→3).
|
||||
예: result = OR(8, 3) -- 11
|
||||
|
||||
SHIFT(a, shift)
|
||||
산술 시프트를 합니다. shift가 양수면 왼쪽, 음수면 오른쪽으로
|
||||
시프트합니다.
|
||||
예: result = SHIFT(5, 3) -- 40
|
||||
예: result = SHIFT(91, -2) -- 22
|
||||
|
||||
debug_print(text)
|
||||
지정한 문자열을 OutputDebugString()으로 보냅니다. 디버그용입니다.
|
||||
메시지는 DebugView 등의 디버그 모니터 도구로 확인할 수 있습니다.
|
||||
또한 스크립트 실행 오류가 발생하면 오류 메시지가 자동으로
|
||||
전송됩니다.
|
||||
예: debug_print(string.format("x = %d", obj.x))
|
||||
|
||||
|
||||
- 사용 가능한 표준 라이브러리 -
|
||||
|
||||
math 라이브러리:
|
||||
@@ -756,14 +818,12 @@
|
||||
이를 호출하는 스크립트는 의도대로 동작하지 않습니다.
|
||||
× require에 의한 모듈 로드 및 io / dofile 등의 임의 파일 접근
|
||||
(obj.load의 이미지 / 동영상 로드는 헤더 검증과 함께 지원).
|
||||
× obj.setanchor, scene.set / scene.get 등.
|
||||
× obj.setanchor 등.
|
||||
|
||||
|
||||
- 미지원·제한 사항 -
|
||||
|
||||
× AviUtl2의 obj.rand1(), obj.mes(), obj.setanchor() 등은 지원하지 않습니다.
|
||||
× AviUtl2의 scene 테이블의 scene.set(), scene.get() 등의 함수는 지원하지 않습니다.
|
||||
(scene.width와 scene.height의 읽기만 지원)
|
||||
× 스크립트에서의 임의 파일 접근(require, dofile, io 등)은 지원하지 않습니다.
|
||||
obj.load("image"/"movie")만 선두 헤더 검증으로 진짜 미디어로 확인된 파일을
|
||||
읽습니다.
|
||||
|
||||
@@ -147,6 +147,23 @@
|
||||
scene.width : 场景(项目)的水平分辨率(像素)[只读]
|
||||
scene.height : 场景(项目)的垂直分辨率(像素)[只读]
|
||||
|
||||
scene.set(name, value)
|
||||
将值保存到以场景为单位的共享区域。
|
||||
同一场景内的所有 Lua 脚本效果都可以跨项目、跨帧通过
|
||||
scene.get(name) 读取该值。
|
||||
name : 值的名称(字符串)
|
||||
value : 要保存的值(数值、字符串、布尔值)。传入 nil 时删除。
|
||||
* 数值、字符串、布尔值以外的类型(表、函数等)不会被保存。
|
||||
* 名称和字符串值按 UTF-8 计算超过 4095 字节的部分将被截断。
|
||||
例:scene.set("shared_x", obj.x)
|
||||
scene.get(name)
|
||||
获取通过 scene.set() 保存的值。未设置的名称返回 nil。
|
||||
例:local x = scene.get("shared_x") or 0
|
||||
* 值按场景相互独立,在 YMM4 退出前一直保留在内存中
|
||||
(不会保存到项目文件)。
|
||||
* 项目之间的求值顺序没有保证,请避免依赖同一帧内写入与读取顺序的
|
||||
设计。
|
||||
|
||||
|
||||
- obj 表 - 变量 -
|
||||
|
||||
@@ -585,6 +602,47 @@
|
||||
anim.bezier(t, p0, p1, p2, p3): 计算 t(0.0~1.0) 时的三次贝塞尔曲线值
|
||||
|
||||
|
||||
- AviUtl 兼容的全局函数 -
|
||||
|
||||
以下函数可在全局作用域中直接调用。
|
||||
在所有执行引擎(MoonSharp / 原生)上返回完全相同的结果。
|
||||
|
||||
RGB(r, g, b)
|
||||
RGB(col)
|
||||
RGB(r1, g1, b1, r2, g2, b2)
|
||||
在颜色信息(0x000000~0xffffff)与红、绿、蓝(各 0~255)之间相互
|
||||
转换。3 个参数时合成为一个颜色信息,1 个参数时分解为 r, g, b 三个值。
|
||||
6 个参数时,返回随对象时间经过(obj.time / obj.totaltime)从第一种
|
||||
颜色向第二种颜色线性变化的颜色信息。
|
||||
例:col = RGB(64, 192, 255) -- 0x40C0FF
|
||||
例:r, g, b = RGB(0x0080FF) -- 0, 128, 255
|
||||
例:col = RGB(64,192,255, 128,64,0) -- 起始色→结束色
|
||||
|
||||
HSV(h, s, v)
|
||||
HSV(col)
|
||||
HSV(h1, s1, v1, h2, s2, v2)
|
||||
在颜色信息(0x000000~0xffffff)与色相(0~360)、饱和度(0~100)、
|
||||
明度(0~100)之间相互转换。参数含义与 RGB() 相同。
|
||||
例:col = HSV(60, 100, 100) -- 0xFFFF00
|
||||
例:h, s, v = HSV(0x0080FF) -- 210, 100, 100
|
||||
|
||||
OR(a, b) / AND(a, b) / XOR(a, b)
|
||||
以 32bit 整数进行位运算(或、与、异或)。
|
||||
小数转换为整数时,恰好 0.5 及以下会被舍去(2.50→2、2.51→3)。
|
||||
例:result = OR(8, 3) -- 11
|
||||
|
||||
SHIFT(a, shift)
|
||||
进行算术移位。shift 为正数时左移,为负数时右移。
|
||||
例:result = SHIFT(5, 3) -- 40
|
||||
例:result = SHIFT(91, -2) -- 22
|
||||
|
||||
debug_print(text)
|
||||
将指定字符串发送到 OutputDebugString()。用于调试。
|
||||
可通过 DebugView 等调试监视工具查看消息。
|
||||
此外,脚本发生执行错误时会自动发送错误消息。
|
||||
例:debug_print(string.format("x = %d", obj.x))
|
||||
|
||||
|
||||
- 可用标准库 -
|
||||
|
||||
math 库:
|
||||
@@ -734,14 +792,12 @@
|
||||
调用它们的脚本不会按预期运行。
|
||||
× 通过 require 加载模块,以及 io / dofile 等任意文件访问
|
||||
(obj.load 的图像 / 视频加载已带文件头校验支持)。
|
||||
× obj.setanchor、scene.set / scene.get 等。
|
||||
× obj.setanchor 等。
|
||||
|
||||
|
||||
- 不支持项目·限制事项 -
|
||||
|
||||
× 不支持 AviUtl2 的 obj.rand1()、obj.mes()、obj.setanchor() 等。
|
||||
× 不支持 AviUtl2 scene 表中的 scene.set()、scene.get() 等函数。
|
||||
(仅支持读取 scene.width 和 scene.height)
|
||||
× 不支持脚本进行任意文件访问(require、dofile、io 等)。
|
||||
仅 obj.load("image"/"movie") 会加载经文件头校验确认为真正媒体的文件。
|
||||
× 修改 obj.z 会反映到绘制中(包含在 ReadBack 中),
|
||||
|
||||
@@ -147,6 +147,23 @@
|
||||
scene.width : 場景(專案)的水平解析度(像素)[唯讀]
|
||||
scene.height : 場景(專案)的垂直解析度(像素)[唯讀]
|
||||
|
||||
scene.set(name, value)
|
||||
將值儲存到以場景為單位的共享區域。
|
||||
同一場景內的所有 Lua 腳本效果都可以跨項目、跨影格透過
|
||||
scene.get(name) 讀取該值。
|
||||
name : 值的名稱(字串)
|
||||
value : 要儲存的值(數值、字串、布林值)。傳入 nil 時刪除。
|
||||
* 數值、字串、布林值以外的型別(表、函式等)不會被儲存。
|
||||
* 名稱和字串值按 UTF-8 計算超過 4095 位元組的部分將被截斷。
|
||||
例:scene.set("shared_x", obj.x)
|
||||
scene.get(name)
|
||||
取得透過 scene.set() 儲存的值。未設定的名稱回傳 nil。
|
||||
例:local x = scene.get("shared_x") or 0
|
||||
* 值按場景相互獨立,在 YMM4 結束前一直保留在記憶體中
|
||||
(不會儲存到專案檔)。
|
||||
* 項目之間的求值順序沒有保證,請避免依賴同一影格內寫入與讀取順序的
|
||||
設計。
|
||||
|
||||
|
||||
- obj 表 - 變數 -
|
||||
|
||||
@@ -586,6 +603,47 @@
|
||||
anim.bezier(t, p0, p1, p2, p3): 計算 t(0.0~1.0) 時的三次貝茲曲線值
|
||||
|
||||
|
||||
- AviUtl 相容的全域函式 -
|
||||
|
||||
以下函式可在全域範圍中直接呼叫。
|
||||
在所有執行引擎(MoonSharp / 原生)上回傳完全相同的結果。
|
||||
|
||||
RGB(r, g, b)
|
||||
RGB(col)
|
||||
RGB(r1, g1, b1, r2, g2, b2)
|
||||
在顏色資訊(0x000000~0xffffff)與紅、綠、藍(各 0~255)之間相互
|
||||
轉換。3 個引數時合成為一個顏色資訊,1 個引數時分解為 r, g, b 三個值。
|
||||
6 個引數時,回傳隨物件時間經過(obj.time / obj.totaltime)從第一種
|
||||
顏色向第二種顏色線性變化的顏色資訊。
|
||||
例:col = RGB(64, 192, 255) -- 0x40C0FF
|
||||
例:r, g, b = RGB(0x0080FF) -- 0, 128, 255
|
||||
例:col = RGB(64,192,255, 128,64,0) -- 起始色→結束色
|
||||
|
||||
HSV(h, s, v)
|
||||
HSV(col)
|
||||
HSV(h1, s1, v1, h2, s2, v2)
|
||||
在顏色資訊(0x000000~0xffffff)與色相(0~360)、飽和度(0~100)、
|
||||
明度(0~100)之間相互轉換。引數含義與 RGB() 相同。
|
||||
例:col = HSV(60, 100, 100) -- 0xFFFF00
|
||||
例:h, s, v = HSV(0x0080FF) -- 210, 100, 100
|
||||
|
||||
OR(a, b) / AND(a, b) / XOR(a, b)
|
||||
以 32bit 整數進行位元運算(或、與、互斥或)。
|
||||
小數轉換為整數時,恰好 0.5 及以下會被捨去(2.50→2、2.51→3)。
|
||||
例:result = OR(8, 3) -- 11
|
||||
|
||||
SHIFT(a, shift)
|
||||
進行算術移位。shift 為正數時左移,為負數時右移。
|
||||
例:result = SHIFT(5, 3) -- 40
|
||||
例:result = SHIFT(91, -2) -- 22
|
||||
|
||||
debug_print(text)
|
||||
將指定字串傳送到 OutputDebugString()。用於除錯。
|
||||
可透過 DebugView 等除錯監視工具查看訊息。
|
||||
此外,腳本發生執行錯誤時會自動傳送錯誤訊息。
|
||||
例:debug_print(string.format("x = %d", obj.x))
|
||||
|
||||
|
||||
- 可用標準函式庫 -
|
||||
|
||||
math 函式庫:
|
||||
@@ -735,14 +793,12 @@
|
||||
呼叫它們的腳本不會如預期運作。
|
||||
× 透過 require 載入模組,以及 io / dofile 等任意檔案存取
|
||||
(obj.load 的影像 / 影片載入已附檔頭驗證支援)。
|
||||
× obj.setanchor、scene.set / scene.get 等。
|
||||
× obj.setanchor 等。
|
||||
|
||||
|
||||
- 不支援項目·限制事項 -
|
||||
|
||||
× 不支援 AviUtl2 的 obj.rand1()、obj.mes()、obj.setanchor() 等。
|
||||
× 不支援 AviUtl2 scene 表中的 scene.set()、scene.get() 等函式。
|
||||
(僅支援讀取 scene.width 和 scene.height)
|
||||
× 不支援腳本進行任意檔案存取(require、dofile、io 等)。
|
||||
僅 obj.load("image"/"movie") 會載入經檔頭驗證確認為真正媒體的檔案。
|
||||
× 修改 obj.z 會反映至繪製中(包含在 ReadBack 中),
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする