feat: update PyBMap dependency.
- update PyBMap dependency. - use BMap 0.2 instead of old one. - change default encoding name string according to the change of LibCmo changes.
This commit is contained in:
parent
f5c50ae079
commit
c8d59ef5f4
@ -78,12 +78,13 @@ elif sys.platform.startswith('darwin'):
|
||||
else:
|
||||
_g_BMapLibName = "BMap.bin"
|
||||
|
||||
_g_BMapLibPath: str = os.path.join(os.path.dirname(__file__), _g_BMapLibName)
|
||||
|
||||
_g_BMapModule: ctypes.CDLL | None = None
|
||||
try:
|
||||
_g_BMapModule = ctypes.cdll.LoadLibrary(
|
||||
os.path.join(os.path.dirname(__file__), _g_BMapLibName)
|
||||
)
|
||||
_g_BMapModule = ctypes.cdll.LoadLibrary(_g_BMapLibPath)
|
||||
except:
|
||||
print(f'Fail to load native BMap dynamic library file "{_g_BMapLibPath}".')
|
||||
_g_BMapModule = None
|
||||
|
||||
def is_bmap_available() -> bool:
|
||||
@ -107,6 +108,8 @@ def _create_bmap_func(fct_name: str, fct_params: list[typing.Any]) -> typing.Cal
|
||||
|
||||
#region Function Defines
|
||||
|
||||
##### GENERATED FUNCTIONS BEGIN #####
|
||||
|
||||
## BMInit
|
||||
# @return True if no error, otherwise False.
|
||||
BMInit = _create_bmap_func('BMInit', [])
|
||||
@ -781,5 +784,6 @@ BM3dObject_GetVisibility = _create_bmap_func('BM3dObject_GetVisibility', [bm_voi
|
||||
# @return True if no error, otherwise False.
|
||||
BM3dObject_SetVisibility = _create_bmap_func('BM3dObject_SetVisibility', [bm_void_p, bm_CKID, bm_bool])
|
||||
|
||||
#endregion
|
||||
##### GENERATED FUNCTIONS END #####
|
||||
|
||||
#endregion
|
||||
|
@ -128,28 +128,28 @@ class ImportParams():
|
||||
items = _g_EnumHelper_ConflictStrategy.generate_items(),
|
||||
description = "Define how to process texture name conflict",
|
||||
default = _g_EnumHelper_ConflictStrategy.to_selection(ConflictStrategy.Current),
|
||||
)
|
||||
) # type: ignore
|
||||
|
||||
material_conflict_strategy: bpy.props.EnumProperty(
|
||||
name = "Material Name Conflict",
|
||||
items = _g_EnumHelper_ConflictStrategy.generate_items(),
|
||||
description = "Define how to process material name conflict",
|
||||
default = _g_EnumHelper_ConflictStrategy.to_selection(ConflictStrategy.Rename),
|
||||
)
|
||||
) # type: ignore
|
||||
|
||||
mesh_conflict_strategy: bpy.props.EnumProperty(
|
||||
name = "Mesh Name Conflict",
|
||||
items = _g_EnumHelper_ConflictStrategy.generate_items(),
|
||||
description = "Define how to process mesh name conflict",
|
||||
default = _g_EnumHelper_ConflictStrategy.to_selection(ConflictStrategy.Rename),
|
||||
)
|
||||
) # type: ignore
|
||||
|
||||
object_conflict_strategy: bpy.props.EnumProperty(
|
||||
name = "Object Name Conflict",
|
||||
items = _g_EnumHelper_ConflictStrategy.generate_items(),
|
||||
description = "Define how to process object name conflict",
|
||||
default = _g_EnumHelper_ConflictStrategy.to_selection(ConflictStrategy.Rename),
|
||||
)
|
||||
) # type: ignore
|
||||
|
||||
def draw_import_params(self, layout: bpy.types.UILayout) -> None:
|
||||
layout.label(text = 'Object Name Conflict')
|
||||
@ -188,7 +188,7 @@ class ExportParams():
|
||||
('COLLECTION', "Collection", "Export a collection", 'OUTLINER_COLLECTION', 0),
|
||||
('OBJECT', "Object", "Export an object", 'OBJECT_DATA', 1),
|
||||
),
|
||||
)
|
||||
) # type: ignore
|
||||
|
||||
def draw_export_params(self, layout: bpy.types.UILayout) -> None:
|
||||
# make prop expand horizontaly, not vertical.
|
||||
@ -221,7 +221,7 @@ class VirtoolsParams():
|
||||
name = "Encodings",
|
||||
description = "The encoding list used by Virtools engine to resolve object name. Use `;` to split multiple encodings",
|
||||
default = UTIL_virtools_types.g_PyBMapDefaultEncoding
|
||||
)
|
||||
) # type: ignore
|
||||
|
||||
def draw_virtools_params(self, layout: bpy.types.UILayout) -> None:
|
||||
layout.label(text = 'Encodings')
|
||||
|
@ -227,12 +227,9 @@ def virtools_name_regulator(name: str | None) -> str:
|
||||
|
||||
## Default Encoding for PyBMap
|
||||
# Use semicolon split each encodings. Support Western European and Simplified Chinese in default.
|
||||
g_PyBMapDefaultEncoding: str
|
||||
if sys.platform.startswith('win32') or sys.platform.startswith('cygwin'):
|
||||
# See: https://learn.microsoft.com/en-us/windows/win32/intl/code-page-identifiers
|
||||
g_PyBMapDefaultEncoding = "1252;936"
|
||||
else:
|
||||
# See: https://www.gnu.org/software/libiconv/
|
||||
g_PyBMapDefaultEncoding = "CP1252;CP936"
|
||||
# Since LibCmo 0.2, the encoding name of LibCmo become universal encoding which is platfoorm independent.
|
||||
# So no need set it according to different platform.
|
||||
# Use universal encoding name (like Python).
|
||||
g_PyBMapDefaultEncoding: str = 'cp1252;gb2312'
|
||||
|
||||
#endregion
|
||||
|
Loading…
Reference in New Issue
Block a user