zoukankan      html  css  js  c++  java
  • Max2013脚本工具的乱码问题

    有时一些中文的脚本会在max2013中显示为乱码,是因为max2013将多种语言统一在一起的缘故,在开始菜单中max2013可以用支持的各种语言的版本启动。

    题外插一句,可见还是用英文比较合适,不会出现乱码问题,哈哈。

    要解决使用中文的脚本乱码问题,方式如下。

    第一种是手动

    ========================================================================

    惯例分隔线,以下是代码改变选项的方式,美术同鞋可以止步了,技术美术和程序请继续

    ========================================================================

    这个选项就保存在3dsmax.ini中,可以读ini文件来判断或设置

    if "2052" != GetINISetting (GetMAXIniFile()) "File Language Options" "LanguageToUseForFileIO" do
    SetINISetting (GetMAXIniFile()) "File Language Options" "LanguageToUseForFileIO" "2052"

    当然修改ini文件会有个缺点,就是需要重启max。如果不想重启max,可以用下面的函数

    Fn SetDefaultLanguageToChinese = 
    (
        if (MaxVersion() )[1] >= 15000 do
        if "2052" != GetINISetting (GetMAXIniFile()) "File Language Options" "LanguageToUseForFileIO" do 
        (
            DialogMonitorOPS.UnRegisterNotification id:#SetDefaultLanguageToChinese
            Fn DialogMonitorCallBackSetDefaultLanguageToChinese = 
            (
                currentHandle = DialogMonitorOPS.GetWindowHandle()
                if "Preference Settings" == UIAccessor.GetWindowText currentHandle do
                (
                    languageNames = #("Chinese","English","German","French","japanese","Korean","Current")
                    childrens = Windows.getChildrenHWND currentHandle
                    
                    languageLabel = undefined 
                    for tempControl in childrens where tempControl[5] == "Default Language:" do 
                    (
                        languageLabel = tempControl
                    )
                    if languageLabel != undefined do
                    for tempControl in childrens where 
                    (
                        tempControl[2]==languageLabel[2] and \
                        tempControl[3]==languageLabel[3]  and \
                        "ComboBox" == tempControl[4] and \
                        FindItem languageNames tempControl[5] != 0
                    )
                    do
                    (
                        UIAccessor.SendMessage tempControl[1] 0x014E 6 0
                    )
                    UIAccessor.SendMessageID currentHandle #IDOK
                )
                true
            )
            DialogMonitorOPS.RegisterNotification DialogMonitorCallBackSetDefaultLanguageToChinese id:#SetDefaultLanguageToChinese
            DialogMonitorOPS.Enabled = true
            DialogMonitorOPS.ShowNotification()
            max file preferences
            DialogMonitorOPS.UnRegisterNotification id:#SetDefaultLanguageToChinese
            DialogMonitorOPS.Enabled = false
        )
    )
    SetDefaultLanguageToChinese()

    如果是2010的中文乱码,移步这里http://www.cnblogs.com/sitt/archive/2012/03/09/2387581.html

  • 相关阅读:
    [Windows] 输入字符间距变宽
    [Android] 安卓手机不用root删除自带app
    [Linux] 内核通知链 notifier
    [RK3399] ES8316+NS4150 播放视频只有背景音,播放歌曲有的有声音,有的无声音
    [Linux] RTC 读写指令及测试程序
    [Linux] scp指令用法
    [Ubuntu] sudo apt-get update指令执行失败
    [RK3399] 修改移动网络默认为4G
    [RK3288] 外接USB设备出现丢数
    laravel 模拟数据批量添加
  • 原文地址:https://www.cnblogs.com/sitt/p/2780481.html
Copyright © 2011-2022 走看看