3dsmaxのcameraをUE5へ


パスコンストレイントしている場合や、うまく変換されない
場合はCollapseしてください。

ue4_camera_tool_v102をDLし実行

https://www.scriptspot.com/3ds-max/scripts/unreal-engine-4-camera-animation-exporter

CinetoolLabel_1.jpg


(
rollout Ue4CamExport "Weevilman's UE4 Camera Exporter" width:256
	
(
--Try to clear the variables from last time	
--global sourceCam = nil
	local orgAnimStart = animationRange.start
	local orgAnimEnd = animationRange.end
	
	local animStart = animationRange.start
	local animEnd = animationRange.end
	
	local resetRange = false
--Set up buttons
	bitmap mybitty  fileName:(getdir #maxroot + "MacroScripts\CinetoolLabel_1.jpg")
	label warningLbl "This tool is IN DEVELOPMENT"
	label warningLbl2 "It may have adverse effects on your scene"
	label warningLbl3	"ENSURE YOU SAVE YOUR SCENE"
	label warninglbl4 "BEFORE USING THIS TOOL!"
	label InstPickCam "1. Pick your Source Camera"
	button selCamBtn "Pick Cam"
	label rangeSet "Set animation range (Optional)"
	spinner spn1 "Start" range:[0,10000,animationRange.start]type:#integer
	spinner spn2 "End" range:[0,10000,animationRange.end]type:#integer
	checkbox chk1 "Reset Timeline After Bake?" checked:false
	--label dobake "Bake a camera first (for parented cams)"
	--button bakeCopyFirst "Bake a copy first"
	label InstBakeCam "2. Bake to an Export Camera"
	button cloneCamBtn "Clone and Bake New Camera"	
	Button aboutBtn "About"
	
	on chk1 changed animResetState do(
		print "state changed"
		messagebox ("Checkbox state is " + animResetState as string)
		)
	
	on spn1 changed val do(
		--print ("Animation Start Frame:"+ spn1.value as string)
		animStart = spn1.value
	--	print animstart
		if animStart<animEnd then(
		animationRange = interval animStart AnimEnd)
		)
		
	on spn2 changed val do(
		--print ("Animation End Frame:"+ spn2.value as string)
		animEnd = spn2.value
		--print animEnd
		if animEnd>animStart then(
		animationRange = interval animStart AnimEnd)
		)		
	
	on aboutBtn pressed do(
		messageBox ("UE4 camera exporter, by Weevilman \n"  + "I hope you enjoy this tool, \n" + "Visit www.weevilman.com for tutorials and tools! \n" + "Thanks for using!") --title:CUNT beep:true
		
		)
		
	on selCamBtn pressed  do(
		fn camera_filt obj = isKindOf obj Camera
		global sourceCam =selectByName title:"Select Camera" buttonText:"Get Camera" filter:camera_filt showHidden:true single:true
		selCamBtn.text = sourceCam.name
		)
		
	on cloneCamBtn pressed do(

		if sourceCam != undefined then(
			--Bake another one first
			clonedBaker = Freecamera fov:45 targetDistance:1902.55 nearclip:1 farclip:1000 nearrange:0 farrange:1000 mpassEnabled:off mpassRenderPerPass:off pos:[-1143.24,-3517.25,0] isSelected:on
			clonedBaker.name = sourceCam.name + "_Src_Prebake"
			posCtrl = Position_Constraint()
			clonedBaker.pos.controller = posCtrl
			posConstraintInterface = posCtrl.constraints
			posConstraintInterface.appendTarget sourceCam 100

			rotCtrl = Orientation_Constraint()
			clonedBaker.rotation.controller = rotCtrl
			rotConstraintInterface = rotCtrl.constraints
			rotConstraintInterface.appendTarget sourceCam 100	
			paramWire.connect sourceCam.baseObject[#FOV] clonedBaker.baseObject[#FOV] "FOV"			
			--Bake the src clone in situ
				select clonedBaker
				for obj in selection do (
					tmp = Point()
					for t = animStart to animEnd do (
					--	if redrawFlag do sliderTime = t -- update
						with animate on at time t tmp.transform = obj.transform
					)
					obj.transform.controller = tmp.transform.controller -- instance
					delete tmp
				)			
			
			--Clone the original camera
			maxOps.cloneNodes clonedBaker cloneType:#copy newNodes:&nnl
			clonedsrcCam = nnl[1]
			format clonedsrcCam.name
			clonedsrcCam.name = sourceCam.name +"_Clone"
			--Create the Dummy to use as reference
			SceneDumRoot = Dummy pos:[0,0,0] isSelected:on
			select clonedsrcCam
			clonedsrcCam.parent = SceneDumRoot
			rotate SceneDumRoot -90 [0,0,1]
			--Create the Export Camera
			ExportCam = Freecamera fov:45 targetDistance:1902.55 nearclip:1 farclip:1000 nearrange:0 farrange:1000 mpassEnabled:off mpassRenderPerPass:off pos:[-1143.24,-3517.25,0] isSelected:on
			ExportCam.name = sourceCam.name + "_Ue4_Baked"
			posCtrl = Position_Constraint()
			ExportCam.pos.controller = posCtrl
			posConstraintInterface = posCtrl.constraints
			posConstraintInterface.appendTarget clonedsrcCam 100

			rotCtrl = Orientation_Constraint()
			ExportCam.rotation.controller = rotCtrl
			rotConstraintInterface = rotCtrl.constraints
			rotConstraintInterface.appendTarget clonedsrcCam 100	
			paramWire.connect clonedsrcCam.baseObject[#FOV] ExportCam.baseObject[#FOV] "FOV"
			--bake the camera
				select ExportCam
				for obj in selection do (
					tmp = Point()
					for t = animationRange.start to animationRange.end do (
					--	if redrawFlag do sliderTime = t -- update
						with animate on at time t tmp.transform = obj.transform
					)
					obj.transform.controller = tmp.transform.controller -- instance
					delete tmp
				)
			select clonedBaker
			delete $					
			select clonedsrcCam
			delete $	
			select SceneDumRoot
			delete $		
			select ExportCam				
			--if reutnr to original range is checked, reset the timeline
				if animResetState = true then
					animationRange = interval orgAnimStart orgAnimEnd
					
			)else(
			print "Define a Camera First"
			)
		)	
)
	createdialog Ue4CamExport
)


Script起動(Ctrl + E)

Pick Camでカメラ選択
Clone and Bake New Cameraを実行
カメラが座標変換され複製されます
(変な場所にコピーされるがUEでは正しい位置となります)

File - Export Sellected

UEでシーケンサーを作成

アクションボタン-インポート

シーケンサのFBXインポート

FieldOfViewの値がおかしくなっている場合

キーを削除し正しい画角に修正

以上!

いいなと思ったら応援しよう!