📄 ck_loadobjects.ms
字号:
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-- 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -