add something
- move all annotation to vt types - add 2 options when saving virtools file accoridng to the change of BMap interface changes.
This commit is contained in:
parent
5c34bbad38
commit
ca7e047c09
@ -12,6 +12,21 @@ class BBP_OT_export_virtools(bpy.types.Operator, UTIL_file_browser.ExportVirtool
|
|||||||
bl_label = "Export Virtools File"
|
bl_label = "Export Virtools File"
|
||||||
bl_options = {'PRESET'}
|
bl_options = {'PRESET'}
|
||||||
|
|
||||||
|
texture_save_opt: bpy.props.EnumProperty(
|
||||||
|
name = "Global Texture Save Options",
|
||||||
|
description = "Decide how texture saved if texture is specified as Use Global as its Save Options.",
|
||||||
|
items = UTIL_virtools_types.EnumPropHelper.generate_items(
|
||||||
|
UTIL_virtools_types.CK_TEXTURE_SAVEOPTIONS,
|
||||||
|
UTIL_virtools_types.g_Annotation_CK_TEXTURE_SAVEOPTIONS
|
||||||
|
),
|
||||||
|
default = UTIL_virtools_types.EnumPropHelper.to_selection(UTIL_virtools_types.CK_TEXTURE_SAVEOPTIONS.CKTEXTURE_EXTERNAL)
|
||||||
|
)
|
||||||
|
|
||||||
|
use_compress: bpy.props.BoolProperty(
|
||||||
|
name="Use Compress",
|
||||||
|
default = True,
|
||||||
|
)
|
||||||
|
|
||||||
compress_level: bpy.props.IntProperty(
|
compress_level: bpy.props.IntProperty(
|
||||||
name = "Compress Level",
|
name = "Compress Level",
|
||||||
description = "The ZLib compress level used by Virtools Engine when saving composition.",
|
description = "The ZLib compress level used by Virtools Engine when saving composition.",
|
||||||
@ -41,6 +56,8 @@ class BBP_OT_export_virtools(bpy.types.Operator, UTIL_file_browser.ExportVirtool
|
|||||||
_export_virtools(
|
_export_virtools(
|
||||||
self.general_get_filename(),
|
self.general_get_filename(),
|
||||||
self.general_get_vt_encodings(),
|
self.general_get_vt_encodings(),
|
||||||
|
UTIL_virtools_types.EnumPropHelper.get_selection(UTIL_virtools_types.CK_TEXTURE_SAVEOPTIONS, self.texture_save_opt),
|
||||||
|
self.use_compress,
|
||||||
self.compress_level,
|
self.compress_level,
|
||||||
objls
|
objls
|
||||||
)
|
)
|
||||||
@ -55,14 +72,26 @@ class BBP_OT_export_virtools(bpy.types.Operator, UTIL_file_browser.ExportVirtool
|
|||||||
layout.separator()
|
layout.separator()
|
||||||
layout.label(text = 'Virtools Params')
|
layout.label(text = 'Virtools Params')
|
||||||
self.draw_virtools_params(layout)
|
self.draw_virtools_params(layout)
|
||||||
layout.prop(self, 'compress_level')
|
layout.label(text = 'Global Texture Save Option')
|
||||||
|
layout.prop(self, 'texture_save_opt', text = '')
|
||||||
|
layout.prop(self, 'use_compress')
|
||||||
|
if self.use_compress:
|
||||||
|
layout.prop(self, 'compress_level')
|
||||||
|
|
||||||
_TObj3dPair = tuple[bpy.types.Object, bmap.BM3dObject]
|
_TObj3dPair = tuple[bpy.types.Object, bmap.BM3dObject]
|
||||||
_TMeshPair = tuple[bpy.types.Object, bpy.types.Mesh, bmap.BMMesh]
|
_TMeshPair = tuple[bpy.types.Object, bpy.types.Mesh, bmap.BMMesh]
|
||||||
_TMaterialPair = tuple[bpy.types.Material, bmap.BMMaterial]
|
_TMaterialPair = tuple[bpy.types.Material, bmap.BMMaterial]
|
||||||
_TTexturePair = tuple[bpy.types.Image, bmap.BMTexture]
|
_TTexturePair = tuple[bpy.types.Image, bmap.BMTexture]
|
||||||
|
|
||||||
def _export_virtools(file_name_: str, encodings_: tuple[str], compress_level_: int, export_objects: tuple[bpy.types.Object, ...]) -> None:
|
def _export_virtools(
|
||||||
|
file_name_: str,
|
||||||
|
encodings_: tuple[str],
|
||||||
|
texture_save_opt_: UTIL_virtools_types.CK_TEXTURE_SAVEOPTIONS,
|
||||||
|
use_compress_: bool,
|
||||||
|
compress_level_: int,
|
||||||
|
export_objects: tuple[bpy.types.Object, ...]
|
||||||
|
) -> None:
|
||||||
|
|
||||||
# create temp folder
|
# create temp folder
|
||||||
with tempfile.TemporaryDirectory() as vt_temp_folder:
|
with tempfile.TemporaryDirectory() as vt_temp_folder:
|
||||||
print(f'Virtools Engine Temp: {vt_temp_folder}')
|
print(f'Virtools Engine Temp: {vt_temp_folder}')
|
||||||
@ -93,7 +122,7 @@ def _export_virtools(file_name_: str, encodings_: tuple[str], compress_level_: i
|
|||||||
|
|
||||||
# save document
|
# save document
|
||||||
_save_virtools_document(
|
_save_virtools_document(
|
||||||
writer, progress, file_name_, compress_level_)
|
writer, progress, file_name_, texture_save_opt_, use_compress_, compress_level_)
|
||||||
|
|
||||||
def _prepare_virtools_3dobjects(
|
def _prepare_virtools_3dobjects(
|
||||||
writer: bmap.BMFileWriter,
|
writer: bmap.BMFileWriter,
|
||||||
@ -423,11 +452,13 @@ def _save_virtools_document(
|
|||||||
writer: bmap.BMFileWriter,
|
writer: bmap.BMFileWriter,
|
||||||
progress: ProgressReport,
|
progress: ProgressReport,
|
||||||
file_name: str,
|
file_name: str,
|
||||||
|
texture_save_opt: UTIL_virtools_types.CK_TEXTURE_SAVEOPTIONS,
|
||||||
|
use_compress: bool,
|
||||||
compress_level: int
|
compress_level: int
|
||||||
) -> None:
|
) -> None:
|
||||||
|
|
||||||
progress.enter_substeps(1, "Saving Document")
|
progress.enter_substeps(1, "Saving Document")
|
||||||
writer.save(file_name, compress_level)
|
writer.save(file_name, texture_save_opt, use_compress, compress_level)
|
||||||
progress.step()
|
progress.step()
|
||||||
progress.leave_substeps()
|
progress.leave_substeps()
|
||||||
|
|
||||||
|
@ -3,74 +3,6 @@ import typing, enum
|
|||||||
from . import UTIL_virtools_types, UTIL_functions
|
from . import UTIL_virtools_types, UTIL_functions
|
||||||
from . import PROP_virtools_texture
|
from . import PROP_virtools_texture
|
||||||
|
|
||||||
#region Enums Annotations
|
|
||||||
|
|
||||||
g_Annotation_VXTEXTURE_BLENDMODE: dict[int, UTIL_virtools_types.EnumAnnotation] = {
|
|
||||||
UTIL_virtools_types.VXTEXTURE_BLENDMODE.VXTEXTUREBLEND_DECAL.value: UTIL_virtools_types.EnumAnnotation("Decal", "Texture replace any material information "),
|
|
||||||
UTIL_virtools_types.VXTEXTURE_BLENDMODE.VXTEXTUREBLEND_MODULATE.value: UTIL_virtools_types.EnumAnnotation("Modulate", "Texture and material are combine. Alpha information of the texture replace material alpha component. "),
|
|
||||||
UTIL_virtools_types.VXTEXTURE_BLENDMODE.VXTEXTUREBLEND_DECALALPHA.value: UTIL_virtools_types.EnumAnnotation("Decal Alpha", "Alpha information in the texture specify how material and texture are combined. Alpha information of the texture replace material alpha component. "),
|
|
||||||
UTIL_virtools_types.VXTEXTURE_BLENDMODE.VXTEXTUREBLEND_MODULATEALPHA.value: UTIL_virtools_types.EnumAnnotation("Modulate Alpha", "Alpha information in the texture specify how material and texture are combined "),
|
|
||||||
UTIL_virtools_types.VXTEXTURE_BLENDMODE.VXTEXTUREBLEND_DECALMASK.value: UTIL_virtools_types.EnumAnnotation("Decal Mask", ""),
|
|
||||||
UTIL_virtools_types.VXTEXTURE_BLENDMODE.VXTEXTUREBLEND_MODULATEMASK.value: UTIL_virtools_types.EnumAnnotation("Modulate Mask", ""),
|
|
||||||
UTIL_virtools_types.VXTEXTURE_BLENDMODE.VXTEXTUREBLEND_COPY.value: UTIL_virtools_types.EnumAnnotation("Copy", "Equivalent to DECAL "),
|
|
||||||
UTIL_virtools_types.VXTEXTURE_BLENDMODE.VXTEXTUREBLEND_ADD.value: UTIL_virtools_types.EnumAnnotation("Add", ""),
|
|
||||||
UTIL_virtools_types.VXTEXTURE_BLENDMODE.VXTEXTUREBLEND_DOTPRODUCT3.value: UTIL_virtools_types.EnumAnnotation("Dot Product 3", "Perform a Dot Product 3 between texture (normal map) and a referential vector given in VXRENDERSTATE_TEXTUREFACTOR. "),
|
|
||||||
UTIL_virtools_types.VXTEXTURE_BLENDMODE.VXTEXTUREBLEND_MAX.value: UTIL_virtools_types.EnumAnnotation("Max", ""),
|
|
||||||
}
|
|
||||||
g_Annotation_VXTEXTURE_FILTERMODE: dict[int, UTIL_virtools_types.EnumAnnotation] = {
|
|
||||||
UTIL_virtools_types.VXTEXTURE_FILTERMODE.VXTEXTUREFILTER_NEAREST.value: UTIL_virtools_types.EnumAnnotation("Nearest", "No Filter "),
|
|
||||||
UTIL_virtools_types.VXTEXTURE_FILTERMODE.VXTEXTUREFILTER_LINEAR.value: UTIL_virtools_types.EnumAnnotation("Linear", "Bilinear Interpolation "),
|
|
||||||
UTIL_virtools_types.VXTEXTURE_FILTERMODE.VXTEXTUREFILTER_MIPNEAREST.value: UTIL_virtools_types.EnumAnnotation("Mip Nearest", "Mip mapping "),
|
|
||||||
UTIL_virtools_types.VXTEXTURE_FILTERMODE.VXTEXTUREFILTER_MIPLINEAR.value: UTIL_virtools_types.EnumAnnotation("Mip Linear", "Mip Mapping with Bilinear interpolation "),
|
|
||||||
UTIL_virtools_types.VXTEXTURE_FILTERMODE.VXTEXTUREFILTER_LINEARMIPNEAREST.value: UTIL_virtools_types.EnumAnnotation("Linear Mip Nearest", "Mip Mapping with Bilinear interpolation between mipmap levels. "),
|
|
||||||
UTIL_virtools_types.VXTEXTURE_FILTERMODE.VXTEXTUREFILTER_LINEARMIPLINEAR.value: UTIL_virtools_types.EnumAnnotation("Linear Mip Linear", "Trilinear Filtering "),
|
|
||||||
UTIL_virtools_types.VXTEXTURE_FILTERMODE.VXTEXTUREFILTER_ANISOTROPIC.value: UTIL_virtools_types.EnumAnnotation("Anisotropic", "Anisotropic filtering "),
|
|
||||||
}
|
|
||||||
g_Annotation_VXBLEND_MODE: dict[int, UTIL_virtools_types.EnumAnnotation] = {
|
|
||||||
UTIL_virtools_types.VXBLEND_MODE.VXBLEND_ZERO.value: UTIL_virtools_types.EnumAnnotation("Zero", "Blend factor is (0, 0, 0, 0). "),
|
|
||||||
UTIL_virtools_types.VXBLEND_MODE.VXBLEND_ONE.value: UTIL_virtools_types.EnumAnnotation("One", "Blend factor is (1, 1, 1, 1). "),
|
|
||||||
UTIL_virtools_types.VXBLEND_MODE.VXBLEND_SRCCOLOR.value: UTIL_virtools_types.EnumAnnotation("Src Color", "Blend factor is (Rs, Gs, Bs, As). "),
|
|
||||||
UTIL_virtools_types.VXBLEND_MODE.VXBLEND_INVSRCCOLOR.value: UTIL_virtools_types.EnumAnnotation("Inv Src Color", "Blend factor is (1-Rs, 1-Gs, 1-Bs, 1-As). "),
|
|
||||||
UTIL_virtools_types.VXBLEND_MODE.VXBLEND_SRCALPHA.value: UTIL_virtools_types.EnumAnnotation("Src Alpha", "Blend factor is (As, As, As, As). "),
|
|
||||||
UTIL_virtools_types.VXBLEND_MODE.VXBLEND_INVSRCALPHA.value: UTIL_virtools_types.EnumAnnotation("Inv Src Alpha", "Blend factor is (1-As, 1-As, 1-As, 1-As). "),
|
|
||||||
UTIL_virtools_types.VXBLEND_MODE.VXBLEND_DESTALPHA.value: UTIL_virtools_types.EnumAnnotation("Dest Alpha", "Blend factor is (Ad, Ad, Ad, Ad). "),
|
|
||||||
UTIL_virtools_types.VXBLEND_MODE.VXBLEND_INVDESTALPHA.value: UTIL_virtools_types.EnumAnnotation("Inv Dest Alpha", "Blend factor is (1-Ad, 1-Ad, 1-Ad, 1-Ad). "),
|
|
||||||
UTIL_virtools_types.VXBLEND_MODE.VXBLEND_DESTCOLOR.value: UTIL_virtools_types.EnumAnnotation("Dest Color", "Blend factor is (Rd, Gd, Bd, Ad). "),
|
|
||||||
UTIL_virtools_types.VXBLEND_MODE.VXBLEND_INVDESTCOLOR.value: UTIL_virtools_types.EnumAnnotation("Inv Dest Color", "Blend factor is (1-Rd, 1-Gd, 1-Bd, 1-Ad). "),
|
|
||||||
UTIL_virtools_types.VXBLEND_MODE.VXBLEND_SRCALPHASAT.value: UTIL_virtools_types.EnumAnnotation("Src Alpha Sat", "Blend factor is (f, f, f, 1); f = min(As, 1-Ad). "),
|
|
||||||
#UTIL_virtools_types.VXBLEND_MODE.VXBLEND_BOTHSRCALPHA.value: UTIL_virtools_types.EnumAnnotation("Both Src Alpha", "Source blend factor is (As, As, As, As) and destination blend factor is (1-As, 1-As, 1-As, 1-As) "),
|
|
||||||
#UTIL_virtools_types.VXBLEND_MODE.VXBLEND_BOTHINVSRCALPHA.value: UTIL_virtools_types.EnumAnnotation("Both Inv Src Alpha", "Source blend factor is (1-As, 1-As, 1-As, 1-As) and destination blend factor is (As, As, As, As) "),
|
|
||||||
}
|
|
||||||
g_Annotation_VXTEXTURE_ADDRESSMODE: dict[int, UTIL_virtools_types.EnumAnnotation] = {
|
|
||||||
UTIL_virtools_types.VXTEXTURE_ADDRESSMODE.VXTEXTURE_ADDRESSWRAP.value: UTIL_virtools_types.EnumAnnotation("Wrap", "Default mesh wrap mode is used (see CKMesh::SetWrapMode) "),
|
|
||||||
UTIL_virtools_types.VXTEXTURE_ADDRESSMODE.VXTEXTURE_ADDRESSMIRROR.value: UTIL_virtools_types.EnumAnnotation("Mirror", "Texture coordinates outside the range [0..1] are flipped evenly. "),
|
|
||||||
UTIL_virtools_types.VXTEXTURE_ADDRESSMODE.VXTEXTURE_ADDRESSCLAMP.value: UTIL_virtools_types.EnumAnnotation("Clamp", "Texture coordinates greater than 1.0 are set to 1.0, and values less than 0.0 are set to 0.0. "),
|
|
||||||
UTIL_virtools_types.VXTEXTURE_ADDRESSMODE.VXTEXTURE_ADDRESSBORDER.value: UTIL_virtools_types.EnumAnnotation("Border", "When texture coordinates are greater than 1.0 or less than 0.0 texture is set to a color defined in CKMaterial::SetTextureBorderColor. "),
|
|
||||||
UTIL_virtools_types.VXTEXTURE_ADDRESSMODE.VXTEXTURE_ADDRESSMIRRORONCE.value: UTIL_virtools_types.EnumAnnotation("Mirror Once", " "),
|
|
||||||
}
|
|
||||||
g_Annotation_VXFILL_MODE: dict[int, UTIL_virtools_types.EnumAnnotation] = {
|
|
||||||
UTIL_virtools_types.VXFILL_MODE.VXFILL_POINT.value: UTIL_virtools_types.EnumAnnotation("Point", "Vertices rendering "),
|
|
||||||
UTIL_virtools_types.VXFILL_MODE.VXFILL_WIREFRAME.value: UTIL_virtools_types.EnumAnnotation("Wireframe", "Edges rendering "),
|
|
||||||
UTIL_virtools_types.VXFILL_MODE.VXFILL_SOLID.value: UTIL_virtools_types.EnumAnnotation("Solid", "Face rendering "),
|
|
||||||
}
|
|
||||||
g_Annotation_VXSHADE_MODE: dict[int, UTIL_virtools_types.EnumAnnotation] = {
|
|
||||||
UTIL_virtools_types.VXSHADE_MODE.VXSHADE_FLAT.value: UTIL_virtools_types.EnumAnnotation("Flat", "Flat Shading "),
|
|
||||||
UTIL_virtools_types.VXSHADE_MODE.VXSHADE_GOURAUD.value: UTIL_virtools_types.EnumAnnotation("Gouraud", "Gouraud Shading "),
|
|
||||||
UTIL_virtools_types.VXSHADE_MODE.VXSHADE_PHONG.value: UTIL_virtools_types.EnumAnnotation("Phong", "Phong Shading (Not yet supported by most implementation) "),
|
|
||||||
}
|
|
||||||
g_Annotation_VXCMPFUNC: dict[int, UTIL_virtools_types.EnumAnnotation] = {
|
|
||||||
UTIL_virtools_types.VXCMPFUNC.VXCMP_NEVER.value: UTIL_virtools_types.EnumAnnotation("Never", "Always fail the test. "),
|
|
||||||
UTIL_virtools_types.VXCMPFUNC.VXCMP_LESS.value: UTIL_virtools_types.EnumAnnotation("Less", "Accept if value if less than current value. "),
|
|
||||||
UTIL_virtools_types.VXCMPFUNC.VXCMP_EQUAL.value: UTIL_virtools_types.EnumAnnotation("Equal", "Accept if value if equal than current value. "),
|
|
||||||
UTIL_virtools_types.VXCMPFUNC.VXCMP_LESSEQUAL.value: UTIL_virtools_types.EnumAnnotation("Less Equal", "Accept if value if less or equal than current value. "),
|
|
||||||
UTIL_virtools_types.VXCMPFUNC.VXCMP_GREATER.value: UTIL_virtools_types.EnumAnnotation("Greater", "Accept if value if greater than current value. "),
|
|
||||||
UTIL_virtools_types.VXCMPFUNC.VXCMP_NOTEQUAL.value: UTIL_virtools_types.EnumAnnotation("Not Equal", "Accept if value if different than current value. "),
|
|
||||||
UTIL_virtools_types.VXCMPFUNC.VXCMP_GREATEREQUAL.value: UTIL_virtools_types.EnumAnnotation("Greater Equal", "Accept if value if greater or equal current value. "),
|
|
||||||
UTIL_virtools_types.VXCMPFUNC.VXCMP_ALWAYS.value: UTIL_virtools_types.EnumAnnotation("Always", "Always accept the test. "),
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
class RawVirtoolsMaterial():
|
class RawVirtoolsMaterial():
|
||||||
|
|
||||||
# Instance Member Declarations
|
# Instance Member Declarations
|
||||||
@ -250,7 +182,7 @@ class BBP_PG_virtools_material(bpy.types.PropertyGroup):
|
|||||||
description = "Texture blend mode",
|
description = "Texture blend mode",
|
||||||
items = UTIL_virtools_types.EnumPropHelper.generate_items(
|
items = UTIL_virtools_types.EnumPropHelper.generate_items(
|
||||||
UTIL_virtools_types.VXTEXTURE_BLENDMODE,
|
UTIL_virtools_types.VXTEXTURE_BLENDMODE,
|
||||||
g_Annotation_VXTEXTURE_BLENDMODE
|
UTIL_virtools_types.g_Annotation_VXTEXTURE_BLENDMODE
|
||||||
),
|
),
|
||||||
default = UTIL_virtools_types.EnumPropHelper.to_selection(RawVirtoolsMaterial.cDefaultTextureBlendMode)
|
default = UTIL_virtools_types.EnumPropHelper.to_selection(RawVirtoolsMaterial.cDefaultTextureBlendMode)
|
||||||
)
|
)
|
||||||
@ -260,7 +192,7 @@ class BBP_PG_virtools_material(bpy.types.PropertyGroup):
|
|||||||
description = "Texture filter mode when the texture is minified",
|
description = "Texture filter mode when the texture is minified",
|
||||||
items = UTIL_virtools_types.EnumPropHelper.generate_items(
|
items = UTIL_virtools_types.EnumPropHelper.generate_items(
|
||||||
UTIL_virtools_types.VXTEXTURE_FILTERMODE,
|
UTIL_virtools_types.VXTEXTURE_FILTERMODE,
|
||||||
g_Annotation_VXTEXTURE_FILTERMODE
|
UTIL_virtools_types.g_Annotation_VXTEXTURE_FILTERMODE
|
||||||
),
|
),
|
||||||
default = UTIL_virtools_types.EnumPropHelper.to_selection(RawVirtoolsMaterial.cDefaultTextureMinMode)
|
default = UTIL_virtools_types.EnumPropHelper.to_selection(RawVirtoolsMaterial.cDefaultTextureMinMode)
|
||||||
)
|
)
|
||||||
@ -270,7 +202,7 @@ class BBP_PG_virtools_material(bpy.types.PropertyGroup):
|
|||||||
description = "Texture filter mode when the texture is magnified",
|
description = "Texture filter mode when the texture is magnified",
|
||||||
items = UTIL_virtools_types.EnumPropHelper.generate_items(
|
items = UTIL_virtools_types.EnumPropHelper.generate_items(
|
||||||
UTIL_virtools_types.VXTEXTURE_FILTERMODE,
|
UTIL_virtools_types.VXTEXTURE_FILTERMODE,
|
||||||
g_Annotation_VXTEXTURE_FILTERMODE
|
UTIL_virtools_types.g_Annotation_VXTEXTURE_FILTERMODE
|
||||||
),
|
),
|
||||||
default = UTIL_virtools_types.EnumPropHelper.to_selection(RawVirtoolsMaterial.cDefaultTextureMagMode)
|
default = UTIL_virtools_types.EnumPropHelper.to_selection(RawVirtoolsMaterial.cDefaultTextureMagMode)
|
||||||
)
|
)
|
||||||
@ -280,7 +212,7 @@ class BBP_PG_virtools_material(bpy.types.PropertyGroup):
|
|||||||
description = "The address mode controls how the texture coordinates outside the range 0..1",
|
description = "The address mode controls how the texture coordinates outside the range 0..1",
|
||||||
items = UTIL_virtools_types.EnumPropHelper.generate_items(
|
items = UTIL_virtools_types.EnumPropHelper.generate_items(
|
||||||
UTIL_virtools_types.VXTEXTURE_ADDRESSMODE,
|
UTIL_virtools_types.VXTEXTURE_ADDRESSMODE,
|
||||||
g_Annotation_VXTEXTURE_ADDRESSMODE
|
UTIL_virtools_types.g_Annotation_VXTEXTURE_ADDRESSMODE
|
||||||
),
|
),
|
||||||
default = UTIL_virtools_types.EnumPropHelper.to_selection(RawVirtoolsMaterial.cDefaultTextureAddressMode)
|
default = UTIL_virtools_types.EnumPropHelper.to_selection(RawVirtoolsMaterial.cDefaultTextureAddressMode)
|
||||||
)
|
)
|
||||||
@ -290,7 +222,7 @@ class BBP_PG_virtools_material(bpy.types.PropertyGroup):
|
|||||||
description = "Source blend factor",
|
description = "Source blend factor",
|
||||||
items = UTIL_virtools_types.EnumPropHelper.generate_items(
|
items = UTIL_virtools_types.EnumPropHelper.generate_items(
|
||||||
UTIL_virtools_types.VXBLEND_MODE,
|
UTIL_virtools_types.VXBLEND_MODE,
|
||||||
g_Annotation_VXBLEND_MODE
|
UTIL_virtools_types.g_Annotation_VXBLEND_MODE
|
||||||
),
|
),
|
||||||
default = UTIL_virtools_types.EnumPropHelper.to_selection(RawVirtoolsMaterial.cDefaultSourceBlend)
|
default = UTIL_virtools_types.EnumPropHelper.to_selection(RawVirtoolsMaterial.cDefaultSourceBlend)
|
||||||
)
|
)
|
||||||
@ -300,7 +232,7 @@ class BBP_PG_virtools_material(bpy.types.PropertyGroup):
|
|||||||
description = "Destination blend factor",
|
description = "Destination blend factor",
|
||||||
items = UTIL_virtools_types.EnumPropHelper.generate_items(
|
items = UTIL_virtools_types.EnumPropHelper.generate_items(
|
||||||
UTIL_virtools_types.VXBLEND_MODE,
|
UTIL_virtools_types.VXBLEND_MODE,
|
||||||
g_Annotation_VXBLEND_MODE
|
UTIL_virtools_types.g_Annotation_VXBLEND_MODE
|
||||||
),
|
),
|
||||||
default = UTIL_virtools_types.EnumPropHelper.to_selection(RawVirtoolsMaterial.cDefaultDestBlend)
|
default = UTIL_virtools_types.EnumPropHelper.to_selection(RawVirtoolsMaterial.cDefaultDestBlend)
|
||||||
)
|
)
|
||||||
@ -310,7 +242,7 @@ class BBP_PG_virtools_material(bpy.types.PropertyGroup):
|
|||||||
description = "Fill mode",
|
description = "Fill mode",
|
||||||
items = UTIL_virtools_types.EnumPropHelper.generate_items(
|
items = UTIL_virtools_types.EnumPropHelper.generate_items(
|
||||||
UTIL_virtools_types.VXFILL_MODE,
|
UTIL_virtools_types.VXFILL_MODE,
|
||||||
g_Annotation_VXFILL_MODE
|
UTIL_virtools_types.g_Annotation_VXFILL_MODE
|
||||||
),
|
),
|
||||||
default = UTIL_virtools_types.EnumPropHelper.to_selection(RawVirtoolsMaterial.cDefaultFillMode)
|
default = UTIL_virtools_types.EnumPropHelper.to_selection(RawVirtoolsMaterial.cDefaultFillMode)
|
||||||
)
|
)
|
||||||
@ -320,7 +252,7 @@ class BBP_PG_virtools_material(bpy.types.PropertyGroup):
|
|||||||
description = "Shade mode",
|
description = "Shade mode",
|
||||||
items = UTIL_virtools_types.EnumPropHelper.generate_items(
|
items = UTIL_virtools_types.EnumPropHelper.generate_items(
|
||||||
UTIL_virtools_types.VXSHADE_MODE,
|
UTIL_virtools_types.VXSHADE_MODE,
|
||||||
g_Annotation_VXSHADE_MODE
|
UTIL_virtools_types.g_Annotation_VXSHADE_MODE
|
||||||
),
|
),
|
||||||
default = UTIL_virtools_types.EnumPropHelper.to_selection(RawVirtoolsMaterial.cDefaultShadeMode)
|
default = UTIL_virtools_types.EnumPropHelper.to_selection(RawVirtoolsMaterial.cDefaultShadeMode)
|
||||||
)
|
)
|
||||||
@ -364,7 +296,7 @@ class BBP_PG_virtools_material(bpy.types.PropertyGroup):
|
|||||||
description = "Alpha comparision function",
|
description = "Alpha comparision function",
|
||||||
items = UTIL_virtools_types.EnumPropHelper.generate_items(
|
items = UTIL_virtools_types.EnumPropHelper.generate_items(
|
||||||
UTIL_virtools_types.VXCMPFUNC,
|
UTIL_virtools_types.VXCMPFUNC,
|
||||||
g_Annotation_VXCMPFUNC
|
UTIL_virtools_types.g_Annotation_VXCMPFUNC
|
||||||
),
|
),
|
||||||
default = UTIL_virtools_types.EnumPropHelper.to_selection(RawVirtoolsMaterial.cDefaultAlphaFunc)
|
default = UTIL_virtools_types.EnumPropHelper.to_selection(RawVirtoolsMaterial.cDefaultAlphaFunc)
|
||||||
)
|
)
|
||||||
@ -374,7 +306,7 @@ class BBP_PG_virtools_material(bpy.types.PropertyGroup):
|
|||||||
description = "Z Comparison function",
|
description = "Z Comparison function",
|
||||||
items = UTIL_virtools_types.EnumPropHelper.generate_items(
|
items = UTIL_virtools_types.EnumPropHelper.generate_items(
|
||||||
UTIL_virtools_types.VXCMPFUNC,
|
UTIL_virtools_types.VXCMPFUNC,
|
||||||
g_Annotation_VXCMPFUNC
|
UTIL_virtools_types.g_Annotation_VXCMPFUNC
|
||||||
),
|
),
|
||||||
default = UTIL_virtools_types.EnumPropHelper.to_selection(RawVirtoolsMaterial.cDefaultZFunc)
|
default = UTIL_virtools_types.EnumPropHelper.to_selection(RawVirtoolsMaterial.cDefaultZFunc)
|
||||||
)
|
)
|
||||||
|
@ -2,13 +2,6 @@ import bpy
|
|||||||
import typing, enum
|
import typing, enum
|
||||||
from . import UTIL_functions, UTIL_virtools_types
|
from . import UTIL_functions, UTIL_virtools_types
|
||||||
|
|
||||||
# Annotation
|
|
||||||
|
|
||||||
g_Annotation_VXMESH_LITMODE: dict[int, UTIL_virtools_types.EnumAnnotation] = {
|
|
||||||
UTIL_virtools_types.VXMESH_LITMODE.VX_PRELITMESH.value: UTIL_virtools_types.EnumAnnotation("Prelit", "Lighting use color information store with vertices "),
|
|
||||||
UTIL_virtools_types.VXMESH_LITMODE.VX_LITMESH.value: UTIL_virtools_types.EnumAnnotation("Lit", "Lighting is done by renderer using normals and face material information. "),
|
|
||||||
}
|
|
||||||
|
|
||||||
# Raw Data
|
# Raw Data
|
||||||
|
|
||||||
class RawVirtoolsMesh():
|
class RawVirtoolsMesh():
|
||||||
@ -29,7 +22,7 @@ class BBP_PG_virtools_mesh(bpy.types.PropertyGroup):
|
|||||||
description = "Lighting mode of the mesh.",
|
description = "Lighting mode of the mesh.",
|
||||||
items = UTIL_virtools_types.EnumPropHelper.generate_items(
|
items = UTIL_virtools_types.EnumPropHelper.generate_items(
|
||||||
UTIL_virtools_types.VXMESH_LITMODE,
|
UTIL_virtools_types.VXMESH_LITMODE,
|
||||||
g_Annotation_VXMESH_LITMODE
|
UTIL_virtools_types.g_Annotation_VXMESH_LITMODE
|
||||||
),
|
),
|
||||||
default = UTIL_virtools_types.EnumPropHelper.to_selection(RawVirtoolsMesh.cDefaultLitMode)
|
default = UTIL_virtools_types.EnumPropHelper.to_selection(RawVirtoolsMesh.cDefaultLitMode)
|
||||||
)
|
)
|
||||||
|
@ -2,52 +2,6 @@ import bpy
|
|||||||
import typing
|
import typing
|
||||||
from . import UTIL_virtools_types, UTIL_functions
|
from . import UTIL_virtools_types, UTIL_functions
|
||||||
|
|
||||||
#region Virtools Texture Annotation Data
|
|
||||||
|
|
||||||
g_Annotation_CK_TEXTURE_SAVEOPTIONS: dict[int, UTIL_virtools_types.EnumAnnotation] = {
|
|
||||||
UTIL_virtools_types.CK_TEXTURE_SAVEOPTIONS.CKTEXTURE_RAWDATA.value: UTIL_virtools_types.EnumAnnotation("Raw Data", "Save raw data inside file. The bitmap is saved in a raw 32 bit per pixel format. "),
|
|
||||||
UTIL_virtools_types.CK_TEXTURE_SAVEOPTIONS.CKTEXTURE_EXTERNAL.value: UTIL_virtools_types.EnumAnnotation("External", "Store only the file name for the texture. The bitmap file must be present in the bitmap paths when loading the composition. "),
|
|
||||||
UTIL_virtools_types.CK_TEXTURE_SAVEOPTIONS.CKTEXTURE_IMAGEFORMAT.value: UTIL_virtools_types.EnumAnnotation("Image Format", "Save using format specified. The bitmap data will be converted to the specified format by the correspondant bitmap plugin and saved inside file. "),
|
|
||||||
UTIL_virtools_types.CK_TEXTURE_SAVEOPTIONS.CKTEXTURE_USEGLOBAL.value: UTIL_virtools_types.EnumAnnotation("Use Global", "Use Global settings, that is the settings given with CKContext::SetGlobalImagesSaveOptions. (Not valid when using CKContext::SetImagesSaveOptions). "),
|
|
||||||
UTIL_virtools_types.CK_TEXTURE_SAVEOPTIONS.CKTEXTURE_INCLUDEORIGINALFILE.value: UTIL_virtools_types.EnumAnnotation("Include Original File", "Insert original image file inside CMO file. The bitmap file that was used originally for the texture or sprite will be append to the composition file and extracted when the file is loaded. "),
|
|
||||||
}
|
|
||||||
|
|
||||||
g_Annotation_VX_PIXELFORMAT: dict[int, UTIL_virtools_types.EnumAnnotation] = {
|
|
||||||
UTIL_virtools_types.VX_PIXELFORMAT._32_ARGB8888.value: UTIL_virtools_types.EnumAnnotation("32 Bits ARGB8888", "32-bit ARGB pixel format with alpha "),
|
|
||||||
UTIL_virtools_types.VX_PIXELFORMAT._32_RGB888.value: UTIL_virtools_types.EnumAnnotation("32 Bits RGB888", "32-bit RGB pixel format without alpha "),
|
|
||||||
UTIL_virtools_types.VX_PIXELFORMAT._24_RGB888.value: UTIL_virtools_types.EnumAnnotation("24 Bits RGB888", "24-bit RGB pixel format "),
|
|
||||||
UTIL_virtools_types.VX_PIXELFORMAT._16_RGB565.value: UTIL_virtools_types.EnumAnnotation("16 Bits RGB565", "16-bit RGB pixel format "),
|
|
||||||
UTIL_virtools_types.VX_PIXELFORMAT._16_RGB555.value: UTIL_virtools_types.EnumAnnotation("16 Bits RGB555", "16-bit RGB pixel format (5 bits per color) "),
|
|
||||||
UTIL_virtools_types.VX_PIXELFORMAT._16_ARGB1555.value: UTIL_virtools_types.EnumAnnotation("16 Bits ARGB1555", "16-bit ARGB pixel format (5 bits per color + 1 bit for alpha) "),
|
|
||||||
UTIL_virtools_types.VX_PIXELFORMAT._16_ARGB4444.value: UTIL_virtools_types.EnumAnnotation("16 Bits ARGB4444", "16-bit ARGB pixel format (4 bits per color) "),
|
|
||||||
UTIL_virtools_types.VX_PIXELFORMAT._8_RGB332.value: UTIL_virtools_types.EnumAnnotation("8 Bits RGB332", "8-bit RGB pixel format "),
|
|
||||||
UTIL_virtools_types.VX_PIXELFORMAT._8_ARGB2222.value: UTIL_virtools_types.EnumAnnotation("8 Bits ARGB2222", "8-bit ARGB pixel format "),
|
|
||||||
UTIL_virtools_types.VX_PIXELFORMAT._32_ABGR8888.value: UTIL_virtools_types.EnumAnnotation("32 Bits ABGR8888", "32-bit ABGR pixel format "),
|
|
||||||
UTIL_virtools_types.VX_PIXELFORMAT._32_RGBA8888.value: UTIL_virtools_types.EnumAnnotation("32 Bits RGBA8888", "32-bit RGBA pixel format "),
|
|
||||||
UTIL_virtools_types.VX_PIXELFORMAT._32_BGRA8888.value: UTIL_virtools_types.EnumAnnotation("32 Bits BGRA8888", "32-bit BGRA pixel format "),
|
|
||||||
UTIL_virtools_types.VX_PIXELFORMAT._32_BGR888.value: UTIL_virtools_types.EnumAnnotation("32 Bits BGR888", "32-bit BGR pixel format "),
|
|
||||||
UTIL_virtools_types.VX_PIXELFORMAT._24_BGR888.value: UTIL_virtools_types.EnumAnnotation("24 Bits BGR888", "24-bit BGR pixel format "),
|
|
||||||
UTIL_virtools_types.VX_PIXELFORMAT._16_BGR565.value: UTIL_virtools_types.EnumAnnotation("16 Bits BGR565", "16-bit BGR pixel format "),
|
|
||||||
UTIL_virtools_types.VX_PIXELFORMAT._16_BGR555.value: UTIL_virtools_types.EnumAnnotation("16 Bits BGR555", "16-bit BGR pixel format (5 bits per color) "),
|
|
||||||
UTIL_virtools_types.VX_PIXELFORMAT._16_ABGR1555.value: UTIL_virtools_types.EnumAnnotation("16 Bits ABGR1555", "16-bit ABGR pixel format (5 bits per color + 1 bit for alpha) "),
|
|
||||||
UTIL_virtools_types.VX_PIXELFORMAT._16_ABGR4444.value: UTIL_virtools_types.EnumAnnotation("16 Bits ABGR4444", "16-bit ABGR pixel format (4 bits per color) "),
|
|
||||||
UTIL_virtools_types.VX_PIXELFORMAT._DXT1.value: UTIL_virtools_types.EnumAnnotation("DXT1", "S3/DirectX Texture Compression 1 "),
|
|
||||||
UTIL_virtools_types.VX_PIXELFORMAT._DXT2.value: UTIL_virtools_types.EnumAnnotation("DXT2", "S3/DirectX Texture Compression 2 "),
|
|
||||||
UTIL_virtools_types.VX_PIXELFORMAT._DXT3.value: UTIL_virtools_types.EnumAnnotation("DXT3", "S3/DirectX Texture Compression 3 "),
|
|
||||||
UTIL_virtools_types.VX_PIXELFORMAT._DXT4.value: UTIL_virtools_types.EnumAnnotation("DXT4", "S3/DirectX Texture Compression 4 "),
|
|
||||||
UTIL_virtools_types.VX_PIXELFORMAT._DXT5.value: UTIL_virtools_types.EnumAnnotation("DXT5", "S3/DirectX Texture Compression 5 "),
|
|
||||||
UTIL_virtools_types.VX_PIXELFORMAT._16_V8U8.value: UTIL_virtools_types.EnumAnnotation("16 Bits V8U8", "16-bit Bump Map format format (8 bits per color) "),
|
|
||||||
UTIL_virtools_types.VX_PIXELFORMAT._32_V16U16.value: UTIL_virtools_types.EnumAnnotation("32 Bits V16U16", "32-bit Bump Map format format (16 bits per color) "),
|
|
||||||
UTIL_virtools_types.VX_PIXELFORMAT._16_L6V5U5.value: UTIL_virtools_types.EnumAnnotation("16 Bits L6V5U5", "16-bit Bump Map format format with luminance "),
|
|
||||||
UTIL_virtools_types.VX_PIXELFORMAT._32_X8L8V8U8.value: UTIL_virtools_types.EnumAnnotation("32 Bits X8L8V8U8", "32-bit Bump Map format format with luminance "),
|
|
||||||
UTIL_virtools_types.VX_PIXELFORMAT._8_ABGR8888_CLUT.value: UTIL_virtools_types.EnumAnnotation("8 Bits ABGR8888 CLUT", "8 bits indexed CLUT (ABGR) "),
|
|
||||||
UTIL_virtools_types.VX_PIXELFORMAT._8_ARGB8888_CLUT.value: UTIL_virtools_types.EnumAnnotation("8 Bits ARGB8888 CLUT", "8 bits indexed CLUT (ARGB) "),
|
|
||||||
UTIL_virtools_types.VX_PIXELFORMAT._4_ABGR8888_CLUT.value: UTIL_virtools_types.EnumAnnotation("4 Bits ABGR8888 CLUT", "4 bits indexed CLUT (ABGR) "),
|
|
||||||
UTIL_virtools_types.VX_PIXELFORMAT._4_ARGB8888_CLUT.value: UTIL_virtools_types.EnumAnnotation("4 Bits ARGB8888 CLUT", "4 bits indexed CLUT (ARGB) "),
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
class RawVirtoolsTexture():
|
class RawVirtoolsTexture():
|
||||||
|
|
||||||
# Instance Member Declarations
|
# Instance Member Declarations
|
||||||
@ -72,7 +26,7 @@ class BBP_PG_virtools_texture(bpy.types.PropertyGroup):
|
|||||||
description = "When saving a composition textures or sprites can be kept as reference to external files or converted to a given format and saved inside the composition file.",
|
description = "When saving a composition textures or sprites can be kept as reference to external files or converted to a given format and saved inside the composition file.",
|
||||||
items = UTIL_virtools_types.EnumPropHelper.generate_items(
|
items = UTIL_virtools_types.EnumPropHelper.generate_items(
|
||||||
UTIL_virtools_types.CK_TEXTURE_SAVEOPTIONS,
|
UTIL_virtools_types.CK_TEXTURE_SAVEOPTIONS,
|
||||||
g_Annotation_CK_TEXTURE_SAVEOPTIONS
|
UTIL_virtools_types.g_Annotation_CK_TEXTURE_SAVEOPTIONS
|
||||||
),
|
),
|
||||||
default = UTIL_virtools_types.EnumPropHelper.to_selection(RawVirtoolsTexture.cDefaultSaveOptions)
|
default = UTIL_virtools_types.EnumPropHelper.to_selection(RawVirtoolsTexture.cDefaultSaveOptions)
|
||||||
)
|
)
|
||||||
@ -82,7 +36,7 @@ class BBP_PG_virtools_texture(bpy.types.PropertyGroup):
|
|||||||
description = "The desired surface pixel format in video memory.",
|
description = "The desired surface pixel format in video memory.",
|
||||||
items = UTIL_virtools_types.EnumPropHelper.generate_items(
|
items = UTIL_virtools_types.EnumPropHelper.generate_items(
|
||||||
UTIL_virtools_types.VX_PIXELFORMAT,
|
UTIL_virtools_types.VX_PIXELFORMAT,
|
||||||
g_Annotation_VX_PIXELFORMAT
|
UTIL_virtools_types.g_Annotation_VX_PIXELFORMAT
|
||||||
),
|
),
|
||||||
default = UTIL_virtools_types.EnumPropHelper.to_selection(RawVirtoolsTexture.cDefaultVideoFormat)
|
default = UTIL_virtools_types.EnumPropHelper.to_selection(RawVirtoolsTexture.cDefaultVideoFormat)
|
||||||
)
|
)
|
||||||
|
@ -135,9 +135,11 @@ BMFile_Create = _create_bmap_func('BMFile_Create', [bm_CKSTRING, bm_CKSTRING, bm
|
|||||||
## BMFile_Save
|
## BMFile_Save
|
||||||
# @param map_file[in] Type: BMap::BMFile*.
|
# @param map_file[in] Type: BMap::BMFile*.
|
||||||
# @param file_name[in] Type: LibCmo::CKSTRING.
|
# @param file_name[in] Type: LibCmo::CKSTRING.
|
||||||
|
# @param texture_save_opt[in] Type: LibCmo::CK2::CK_TEXTURE_SAVEOPTIONS.
|
||||||
|
# @param use_compress[in] Type: bool.
|
||||||
# @param compreess_level[in] Type: LibCmo::CKINT.
|
# @param compreess_level[in] Type: LibCmo::CKINT.
|
||||||
# @return True if no error, otherwise False.
|
# @return True if no error, otherwise False.
|
||||||
BMFile_Save = _create_bmap_func('BMFile_Save', [bm_void_p, bm_CKSTRING, bm_CKINT])
|
BMFile_Save = _create_bmap_func('BMFile_Save', [bm_void_p, bm_CKSTRING, bm_enum, bm_bool, bm_CKINT])
|
||||||
## BMFile_Free
|
## BMFile_Free
|
||||||
# @param map_file[in] Type: BMap::BMFile*.
|
# @param map_file[in] Type: BMap::BMFile*.
|
||||||
# @return True if no error, otherwise False.
|
# @return True if no error, otherwise False.
|
||||||
|
@ -713,12 +713,14 @@ class BMFileWriter(_AbstractPointer):
|
|||||||
def __exit__(self, exc_type, exc_value, traceback):
|
def __exit__(self, exc_type, exc_value, traceback):
|
||||||
self.dispose()
|
self.dispose()
|
||||||
|
|
||||||
def save(self, file_name_: str, compress_level_: int) -> None:
|
def save(self, file_name_: str, texture_save_opt_: virtools_types.CK_TEXTURE_SAVEOPTIONS, use_compress_: bool, compress_level_: int) -> None:
|
||||||
# create param
|
# create param
|
||||||
file_name: bmap.bm_CKSTRING = bmap.bm_CKSTRING(file_name_.encode(g_BMapEncoding))
|
file_name: bmap.bm_CKSTRING = bmap.bm_CKSTRING(file_name_.encode(g_BMapEncoding))
|
||||||
|
texture_save_opt: bmap.bm_enum = bmap.bm_enum(texture_save_opt_.value)
|
||||||
|
use_compress: bmap.bm_bool = bmap.bm_bool(use_compress_)
|
||||||
compress_level: bmap.bm_CKINT = bmap.bm_CKINT(compress_level_)
|
compress_level: bmap.bm_CKINT = bmap.bm_CKINT(compress_level_)
|
||||||
# exec
|
# exec
|
||||||
bmap.BMFile_Save(self._get_pointer(), file_name, compress_level)
|
bmap.BMFile_Save(self._get_pointer(), file_name, texture_save_opt, use_compress, compress_level)
|
||||||
|
|
||||||
def dispose(self) -> None:
|
def dispose(self) -> None:
|
||||||
if self._is_valid():
|
if self._is_valid():
|
||||||
|
@ -135,6 +135,120 @@ class EnumPropHelper():
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Enum Annotations
|
||||||
|
|
||||||
|
g_Annotation_VXTEXTURE_BLENDMODE: dict[int, EnumAnnotation] = {
|
||||||
|
VXTEXTURE_BLENDMODE.VXTEXTUREBLEND_DECAL.value: EnumAnnotation("Decal", "Texture replace any material information "),
|
||||||
|
VXTEXTURE_BLENDMODE.VXTEXTUREBLEND_MODULATE.value: EnumAnnotation("Modulate", "Texture and material are combine. Alpha information of the texture replace material alpha component. "),
|
||||||
|
VXTEXTURE_BLENDMODE.VXTEXTUREBLEND_DECALALPHA.value: EnumAnnotation("Decal Alpha", "Alpha information in the texture specify how material and texture are combined. Alpha information of the texture replace material alpha component. "),
|
||||||
|
VXTEXTURE_BLENDMODE.VXTEXTUREBLEND_MODULATEALPHA.value: EnumAnnotation("Modulate Alpha", "Alpha information in the texture specify how material and texture are combined "),
|
||||||
|
VXTEXTURE_BLENDMODE.VXTEXTUREBLEND_DECALMASK.value: EnumAnnotation("Decal Mask", ""),
|
||||||
|
VXTEXTURE_BLENDMODE.VXTEXTUREBLEND_MODULATEMASK.value: EnumAnnotation("Modulate Mask", ""),
|
||||||
|
VXTEXTURE_BLENDMODE.VXTEXTUREBLEND_COPY.value: EnumAnnotation("Copy", "Equivalent to DECAL "),
|
||||||
|
VXTEXTURE_BLENDMODE.VXTEXTUREBLEND_ADD.value: EnumAnnotation("Add", ""),
|
||||||
|
VXTEXTURE_BLENDMODE.VXTEXTUREBLEND_DOTPRODUCT3.value: EnumAnnotation("Dot Product 3", "Perform a Dot Product 3 between texture (normal map) and a referential vector given in VXRENDERSTATE_TEXTUREFACTOR. "),
|
||||||
|
VXTEXTURE_BLENDMODE.VXTEXTUREBLEND_MAX.value: EnumAnnotation("Max", ""),
|
||||||
|
}
|
||||||
|
g_Annotation_VXTEXTURE_FILTERMODE: dict[int, EnumAnnotation] = {
|
||||||
|
VXTEXTURE_FILTERMODE.VXTEXTUREFILTER_NEAREST.value: EnumAnnotation("Nearest", "No Filter "),
|
||||||
|
VXTEXTURE_FILTERMODE.VXTEXTUREFILTER_LINEAR.value: EnumAnnotation("Linear", "Bilinear Interpolation "),
|
||||||
|
VXTEXTURE_FILTERMODE.VXTEXTUREFILTER_MIPNEAREST.value: EnumAnnotation("Mip Nearest", "Mip mapping "),
|
||||||
|
VXTEXTURE_FILTERMODE.VXTEXTUREFILTER_MIPLINEAR.value: EnumAnnotation("Mip Linear", "Mip Mapping with Bilinear interpolation "),
|
||||||
|
VXTEXTURE_FILTERMODE.VXTEXTUREFILTER_LINEARMIPNEAREST.value: EnumAnnotation("Linear Mip Nearest", "Mip Mapping with Bilinear interpolation between mipmap levels. "),
|
||||||
|
VXTEXTURE_FILTERMODE.VXTEXTUREFILTER_LINEARMIPLINEAR.value: EnumAnnotation("Linear Mip Linear", "Trilinear Filtering "),
|
||||||
|
VXTEXTURE_FILTERMODE.VXTEXTUREFILTER_ANISOTROPIC.value: EnumAnnotation("Anisotropic", "Anisotropic filtering "),
|
||||||
|
}
|
||||||
|
g_Annotation_VXBLEND_MODE: dict[int, EnumAnnotation] = {
|
||||||
|
VXBLEND_MODE.VXBLEND_ZERO.value: EnumAnnotation("Zero", "Blend factor is (0, 0, 0, 0). "),
|
||||||
|
VXBLEND_MODE.VXBLEND_ONE.value: EnumAnnotation("One", "Blend factor is (1, 1, 1, 1). "),
|
||||||
|
VXBLEND_MODE.VXBLEND_SRCCOLOR.value: EnumAnnotation("Src Color", "Blend factor is (Rs, Gs, Bs, As). "),
|
||||||
|
VXBLEND_MODE.VXBLEND_INVSRCCOLOR.value: EnumAnnotation("Inv Src Color", "Blend factor is (1-Rs, 1-Gs, 1-Bs, 1-As). "),
|
||||||
|
VXBLEND_MODE.VXBLEND_SRCALPHA.value: EnumAnnotation("Src Alpha", "Blend factor is (As, As, As, As). "),
|
||||||
|
VXBLEND_MODE.VXBLEND_INVSRCALPHA.value: EnumAnnotation("Inv Src Alpha", "Blend factor is (1-As, 1-As, 1-As, 1-As). "),
|
||||||
|
VXBLEND_MODE.VXBLEND_DESTALPHA.value: EnumAnnotation("Dest Alpha", "Blend factor is (Ad, Ad, Ad, Ad). "),
|
||||||
|
VXBLEND_MODE.VXBLEND_INVDESTALPHA.value: EnumAnnotation("Inv Dest Alpha", "Blend factor is (1-Ad, 1-Ad, 1-Ad, 1-Ad). "),
|
||||||
|
VXBLEND_MODE.VXBLEND_DESTCOLOR.value: EnumAnnotation("Dest Color", "Blend factor is (Rd, Gd, Bd, Ad). "),
|
||||||
|
VXBLEND_MODE.VXBLEND_INVDESTCOLOR.value: EnumAnnotation("Inv Dest Color", "Blend factor is (1-Rd, 1-Gd, 1-Bd, 1-Ad). "),
|
||||||
|
VXBLEND_MODE.VXBLEND_SRCALPHASAT.value: EnumAnnotation("Src Alpha Sat", "Blend factor is (f, f, f, 1); f = min(As, 1-Ad). "),
|
||||||
|
#VXBLEND_MODE.VXBLEND_BOTHSRCALPHA.value: EnumAnnotation("Both Src Alpha", "Source blend factor is (As, As, As, As) and destination blend factor is (1-As, 1-As, 1-As, 1-As) "),
|
||||||
|
#VXBLEND_MODE.VXBLEND_BOTHINVSRCALPHA.value: EnumAnnotation("Both Inv Src Alpha", "Source blend factor is (1-As, 1-As, 1-As, 1-As) and destination blend factor is (As, As, As, As) "),
|
||||||
|
}
|
||||||
|
g_Annotation_VXTEXTURE_ADDRESSMODE: dict[int, EnumAnnotation] = {
|
||||||
|
VXTEXTURE_ADDRESSMODE.VXTEXTURE_ADDRESSWRAP.value: EnumAnnotation("Wrap", "Default mesh wrap mode is used (see CKMesh::SetWrapMode) "),
|
||||||
|
VXTEXTURE_ADDRESSMODE.VXTEXTURE_ADDRESSMIRROR.value: EnumAnnotation("Mirror", "Texture coordinates outside the range [0..1] are flipped evenly. "),
|
||||||
|
VXTEXTURE_ADDRESSMODE.VXTEXTURE_ADDRESSCLAMP.value: EnumAnnotation("Clamp", "Texture coordinates greater than 1.0 are set to 1.0, and values less than 0.0 are set to 0.0. "),
|
||||||
|
VXTEXTURE_ADDRESSMODE.VXTEXTURE_ADDRESSBORDER.value: EnumAnnotation("Border", "When texture coordinates are greater than 1.0 or less than 0.0 texture is set to a color defined in CKMaterial::SetTextureBorderColor. "),
|
||||||
|
VXTEXTURE_ADDRESSMODE.VXTEXTURE_ADDRESSMIRRORONCE.value: EnumAnnotation("Mirror Once", " "),
|
||||||
|
}
|
||||||
|
g_Annotation_VXFILL_MODE: dict[int, EnumAnnotation] = {
|
||||||
|
VXFILL_MODE.VXFILL_POINT.value: EnumAnnotation("Point", "Vertices rendering "),
|
||||||
|
VXFILL_MODE.VXFILL_WIREFRAME.value: EnumAnnotation("Wireframe", "Edges rendering "),
|
||||||
|
VXFILL_MODE.VXFILL_SOLID.value: EnumAnnotation("Solid", "Face rendering "),
|
||||||
|
}
|
||||||
|
g_Annotation_VXSHADE_MODE: dict[int, EnumAnnotation] = {
|
||||||
|
VXSHADE_MODE.VXSHADE_FLAT.value: EnumAnnotation("Flat", "Flat Shading "),
|
||||||
|
VXSHADE_MODE.VXSHADE_GOURAUD.value: EnumAnnotation("Gouraud", "Gouraud Shading "),
|
||||||
|
VXSHADE_MODE.VXSHADE_PHONG.value: EnumAnnotation("Phong", "Phong Shading (Not yet supported by most implementation) "),
|
||||||
|
}
|
||||||
|
g_Annotation_VXCMPFUNC: dict[int, EnumAnnotation] = {
|
||||||
|
VXCMPFUNC.VXCMP_NEVER.value: EnumAnnotation("Never", "Always fail the test. "),
|
||||||
|
VXCMPFUNC.VXCMP_LESS.value: EnumAnnotation("Less", "Accept if value if less than current value. "),
|
||||||
|
VXCMPFUNC.VXCMP_EQUAL.value: EnumAnnotation("Equal", "Accept if value if equal than current value. "),
|
||||||
|
VXCMPFUNC.VXCMP_LESSEQUAL.value: EnumAnnotation("Less Equal", "Accept if value if less or equal than current value. "),
|
||||||
|
VXCMPFUNC.VXCMP_GREATER.value: EnumAnnotation("Greater", "Accept if value if greater than current value. "),
|
||||||
|
VXCMPFUNC.VXCMP_NOTEQUAL.value: EnumAnnotation("Not Equal", "Accept if value if different than current value. "),
|
||||||
|
VXCMPFUNC.VXCMP_GREATEREQUAL.value: EnumAnnotation("Greater Equal", "Accept if value if greater or equal current value. "),
|
||||||
|
VXCMPFUNC.VXCMP_ALWAYS.value: EnumAnnotation("Always", "Always accept the test. "),
|
||||||
|
}
|
||||||
|
|
||||||
|
g_Annotation_CK_TEXTURE_SAVEOPTIONS: dict[int, EnumAnnotation] = {
|
||||||
|
CK_TEXTURE_SAVEOPTIONS.CKTEXTURE_RAWDATA.value: EnumAnnotation("Raw Data", "Save raw data inside file. The bitmap is saved in a raw 32 bit per pixel format. "),
|
||||||
|
CK_TEXTURE_SAVEOPTIONS.CKTEXTURE_EXTERNAL.value: EnumAnnotation("External", "Store only the file name for the texture. The bitmap file must be present in the bitmap paths when loading the composition. "),
|
||||||
|
CK_TEXTURE_SAVEOPTIONS.CKTEXTURE_IMAGEFORMAT.value: EnumAnnotation("Image Format", "Save using format specified. The bitmap data will be converted to the specified format by the correspondant bitmap plugin and saved inside file. "),
|
||||||
|
CK_TEXTURE_SAVEOPTIONS.CKTEXTURE_USEGLOBAL.value: EnumAnnotation("Use Global", "Use Global settings, that is the settings given with CKContext::SetGlobalImagesSaveOptions. (Not valid when using CKContext::SetImagesSaveOptions). "),
|
||||||
|
CK_TEXTURE_SAVEOPTIONS.CKTEXTURE_INCLUDEORIGINALFILE.value: EnumAnnotation("Include Original File", "Insert original image file inside CMO file. The bitmap file that was used originally for the texture or sprite will be append to the composition file and extracted when the file is loaded. "),
|
||||||
|
}
|
||||||
|
g_Annotation_VX_PIXELFORMAT: dict[int, EnumAnnotation] = {
|
||||||
|
VX_PIXELFORMAT._32_ARGB8888.value: EnumAnnotation("32 Bits ARGB8888", "32-bit ARGB pixel format with alpha "),
|
||||||
|
VX_PIXELFORMAT._32_RGB888.value: EnumAnnotation("32 Bits RGB888", "32-bit RGB pixel format without alpha "),
|
||||||
|
VX_PIXELFORMAT._24_RGB888.value: EnumAnnotation("24 Bits RGB888", "24-bit RGB pixel format "),
|
||||||
|
VX_PIXELFORMAT._16_RGB565.value: EnumAnnotation("16 Bits RGB565", "16-bit RGB pixel format "),
|
||||||
|
VX_PIXELFORMAT._16_RGB555.value: EnumAnnotation("16 Bits RGB555", "16-bit RGB pixel format (5 bits per color) "),
|
||||||
|
VX_PIXELFORMAT._16_ARGB1555.value: EnumAnnotation("16 Bits ARGB1555", "16-bit ARGB pixel format (5 bits per color + 1 bit for alpha) "),
|
||||||
|
VX_PIXELFORMAT._16_ARGB4444.value: EnumAnnotation("16 Bits ARGB4444", "16-bit ARGB pixel format (4 bits per color) "),
|
||||||
|
VX_PIXELFORMAT._8_RGB332.value: EnumAnnotation("8 Bits RGB332", "8-bit RGB pixel format "),
|
||||||
|
VX_PIXELFORMAT._8_ARGB2222.value: EnumAnnotation("8 Bits ARGB2222", "8-bit ARGB pixel format "),
|
||||||
|
VX_PIXELFORMAT._32_ABGR8888.value: EnumAnnotation("32 Bits ABGR8888", "32-bit ABGR pixel format "),
|
||||||
|
VX_PIXELFORMAT._32_RGBA8888.value: EnumAnnotation("32 Bits RGBA8888", "32-bit RGBA pixel format "),
|
||||||
|
VX_PIXELFORMAT._32_BGRA8888.value: EnumAnnotation("32 Bits BGRA8888", "32-bit BGRA pixel format "),
|
||||||
|
VX_PIXELFORMAT._32_BGR888.value: EnumAnnotation("32 Bits BGR888", "32-bit BGR pixel format "),
|
||||||
|
VX_PIXELFORMAT._24_BGR888.value: EnumAnnotation("24 Bits BGR888", "24-bit BGR pixel format "),
|
||||||
|
VX_PIXELFORMAT._16_BGR565.value: EnumAnnotation("16 Bits BGR565", "16-bit BGR pixel format "),
|
||||||
|
VX_PIXELFORMAT._16_BGR555.value: EnumAnnotation("16 Bits BGR555", "16-bit BGR pixel format (5 bits per color) "),
|
||||||
|
VX_PIXELFORMAT._16_ABGR1555.value: EnumAnnotation("16 Bits ABGR1555", "16-bit ABGR pixel format (5 bits per color + 1 bit for alpha) "),
|
||||||
|
VX_PIXELFORMAT._16_ABGR4444.value: EnumAnnotation("16 Bits ABGR4444", "16-bit ABGR pixel format (4 bits per color) "),
|
||||||
|
VX_PIXELFORMAT._DXT1.value: EnumAnnotation("DXT1", "S3/DirectX Texture Compression 1 "),
|
||||||
|
VX_PIXELFORMAT._DXT2.value: EnumAnnotation("DXT2", "S3/DirectX Texture Compression 2 "),
|
||||||
|
VX_PIXELFORMAT._DXT3.value: EnumAnnotation("DXT3", "S3/DirectX Texture Compression 3 "),
|
||||||
|
VX_PIXELFORMAT._DXT4.value: EnumAnnotation("DXT4", "S3/DirectX Texture Compression 4 "),
|
||||||
|
VX_PIXELFORMAT._DXT5.value: EnumAnnotation("DXT5", "S3/DirectX Texture Compression 5 "),
|
||||||
|
VX_PIXELFORMAT._16_V8U8.value: EnumAnnotation("16 Bits V8U8", "16-bit Bump Map format format (8 bits per color) "),
|
||||||
|
VX_PIXELFORMAT._32_V16U16.value: EnumAnnotation("32 Bits V16U16", "32-bit Bump Map format format (16 bits per color) "),
|
||||||
|
VX_PIXELFORMAT._16_L6V5U5.value: EnumAnnotation("16 Bits L6V5U5", "16-bit Bump Map format format with luminance "),
|
||||||
|
VX_PIXELFORMAT._32_X8L8V8U8.value: EnumAnnotation("32 Bits X8L8V8U8", "32-bit Bump Map format format with luminance "),
|
||||||
|
VX_PIXELFORMAT._8_ABGR8888_CLUT.value: EnumAnnotation("8 Bits ABGR8888 CLUT", "8 bits indexed CLUT (ABGR) "),
|
||||||
|
VX_PIXELFORMAT._8_ARGB8888_CLUT.value: EnumAnnotation("8 Bits ARGB8888 CLUT", "8 bits indexed CLUT (ARGB) "),
|
||||||
|
VX_PIXELFORMAT._4_ABGR8888_CLUT.value: EnumAnnotation("4 Bits ABGR8888 CLUT", "4 bits indexed CLUT (ABGR) "),
|
||||||
|
VX_PIXELFORMAT._4_ARGB8888_CLUT.value: EnumAnnotation("4 Bits ARGB8888 CLUT", "4 bits indexed CLUT (ARGB) "),
|
||||||
|
}
|
||||||
|
|
||||||
|
g_Annotation_VXMESH_LITMODE: dict[int, EnumAnnotation] = {
|
||||||
|
VXMESH_LITMODE.VX_PRELITMESH.value: EnumAnnotation("Prelit", "Lighting use color information store with vertices "),
|
||||||
|
VXMESH_LITMODE.VX_LITMESH.value: EnumAnnotation("Lit", "Lighting is done by renderer using normals and face material information. "),
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region Virtools Blender Bridge Funcs & Vars
|
#region Virtools Blender Bridge Funcs & Vars
|
||||||
|
|
||||||
def virtools_name_regulator(name: str | None) -> str:
|
def virtools_name_regulator(name: str | None) -> str:
|
||||||
|
Loading…
Reference in New Issue
Block a user