ck_loadobjects.ms
来自「3dmax导出3d模型二次开发插件」· MS 代码 · 共 56 行
MS
56 行
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-- Register LoadObjects Instruction
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
global instLoadObjectsStr = "Load Objects"
global instLoadObjectsRollout
global instLoadObjectsFct
--------------------------------------------------------
-- Rollout Fonction
--------------------------------------------------------
rollout instLoadObjectsRollout "Loads Objects Options" width:408 height:50
(
label info_Label "Info: Load a .NMO file." pos:[8,8] width:250 height:32
include "CKInstScripts\\ApplyPreviewButtons.ms"
label loadfile_Label "Load Objects:" align:#left pos:[8,38]
button loadfile_Button "<File to Load>" align:#left pos:[82,32]
on loadfile_Button pressed do (
local result = getopenfilename caption:"Load Virtools objects file" types:"Virtools Objects (*.NMO)|*.nmo"
if result!=undefined do (
loadfile_Button.text = result
)
)
--------------------------------------------------------
-- Update Rollout From Chunk
--------------------------------------------------------
fn UpdateFromChunk = (
currentChunkBuf = GetCKChunk selection[1] instLoadObjectsStr
loadfile_Button.text = ReadCKBufValue CKLoadStr paramIsInst:true
)
)
--------------------------------------------------------
-- Apply Instruction
--------------------------------------------------------
fn instLoadObjectsFct = (
-- Load Objects
chunkData = " " + CKLoadStr + "(\"" + instLoadObjectsRollout.loadfile_Button.text + "\")"
chunkdata += "\x0d\x0a"
for obj in selection do (
AddCKChunk obj instLoadObjectsStr chunkData AllowMultipleChunk:true
updateInstructionsList()
)
)
registerInstruction instLoadObjectsStr instLoadObjectsFct instRollout:instLoadObjectsRollout
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?