⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ck_freecameracontroller.ms

📁 3dmax导出3d模型二次开发插件
💻 MS
字号:
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-- Register FreeCameraController Instruction
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
global instFreeCameraControllerStr = "Free Camera Controller"
global instFreeCameraControllerRollout
global instFreeCameraControllerFct

--------------------------------------------------------
-- Rollout Fonction
--------------------------------------------------------
rollout instFreeCameraControllerRollout "Free Camera Controller Options" width:408 height:114
(
	label info_Label "Info: Controls the camera position with Arrow Keys + PageUp and PageDown Keys, and orientation with mouse displacement (disable = Right-Ctrl Key)." pos:[8,8] width:250 height:64
	spinner transspeed_Spin "" pos:[332,48] width:50 height:16 range:[0,1000,5] type:#float scale:0.1
	spinner rotationspeed_Spin "" pos:[332,72] width:50 height:16 range:[0,1000,0.3] type:#float scale:0.1
	spinner banking_Spin "" pos:[96,72] width:50 height:16 range:[0,20,2] type:#float scale:0.1
	label transspeed_Label "Translation Speed:" pos:[236,48] width:92 height:16
	label rotationspeed_Label "Rotation Speed:" pos:[248,72] width:80 height:16
	label banking_Label "Banking Adjust:" pos:[8,72] width:88 height:16

	include "CKInstScripts\\ApplyPreviewButtons.ms"
	
	--------------------------------------------------------
	-- Update Rollout From Chunk
	--------------------------------------------------------
	fn UpdateFromChunk = (
		currentChunkBuf = GetCKChunk selection[1] instFreeCameraControllerStr
		
		transspeed_Spin.value = ReadCKBufValueAsNumber "Camera Translation Speed"
		rotationspeed_Spin.value = ReadCKBufValueAsAngle "Camera Rotation Speed"
		banking_Spin.value = ReadCKBufValueAsNumber "Camera Banking Compensation"
	)
	
)


--------------------------------------------------------
-- Apply Instruction
--------------------------------------------------------
fn instFreeCameraControllerFct = (

	-- Attach Script 
	chunkData = "  " + CKAttacheScriptOnThisStr + "(\"Free Camera Controller\")"
	chunkdata += "\x0d\x0a"

	-- Translation Speed
	transspeed = instFreeCameraControllerRollout.transspeed_Spin.value
	chunkData += "  " + CKSetParamOnThisStr + "(\"Camera Translation Speed\", \"" + (transspeed as string) + "\" )"
	chunkdata += "\x0d\x0a"

	-- Rotation Speed
	rotationspeed = instFreeCameraControllerRollout.rotationspeed_Spin.value
	chunkData += "  " + CKSetParamOnThisStr + "(\"Camera Rotation Speed\", \"0:" + (rotationspeed as string) + "\" )"
	chunkdata += "\x0d\x0a"

	-- Banking Adjustment
	banking = instFreeCameraControllerRollout.banking_Spin.value
	chunkData += "  " + CKSetParamOnThisStr + "(\"Camera Banking Compensation\", \"" + (banking as string) + "\" )"
	chunkdata += "\x0d\x0a"

	for obj in selection do (
		if( (superclassof obj)==camera ) do (
			AddCKChunk obj instFreeCameraControllerStr chunkData
			updateInstructionsList()
		)
	)
)

registerInstruction instFreeCameraControllerStr instFreeCameraControllerFct instRollout:instFreeCameraControllerRollout


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -