Notifications
Clear all

[Closed] render camera move only

I need to render only frames when the camera is moving…how to detect camera motion then send info to the times output ( 1-50,85-112…)?
thank you for help

I dont know if following access to the render window setting or do its own job…
Render Scene Dialog[left]rendPickupFrames – string
[/left]
[left]Get/set the Frames string containing the user frames or sequences to render.
[/left]

14 Replies

This script will do what you want:


obj = $Camera01 -- change this to the name of your camera
framerange = #()
rangeString = ""

for j in animationrange.start to animationrange.end do
(
	at time (j-1) (pastPos = obj.pos;pastRot = obj.rotation)
	at time (j+1) (futurePos = obj.pos;futureRot = obj.rotation)
	at time j
	(
		currentPos = obj.pos
		currentRot = obj.rotation
		if currentPos != pastPos or currentPos != futurePos or currentRot != pastRot or currentRot != futureRot then
		(
			if firstNum == undefined then
			(
				firstNum = j
			)
			framerange[framerange.count + 1] = (j as integer)/160
		)else
		(
			if firstNum != undefined then
			(
				lastNum = j - 1
				rangeString += ((firstNum as integer/160) as string) + "-" + ((lastNum as integer/160) as string) +","
				firstNum = undefined
			)
			
		)
	)
)

if rangeString != "" then
(
	rangeString = substring rangeString 1 (rangeString.count - 1)
)

renderscenedialog.close()
rendTimeType = 4
rendPickupFrames = rangeString
renderscenedialog.open()

thank you ivanisavich
mmmm but I can’t make it work:/
it just open the render settings windows but doesnt fill the line with frame sequences.

thank you ivanisavich
mmmm but I can’t make it work:/
it just open the render settings windows but doesnt fill the line with frame sequences.

Did you change the first line of the script to have the correct camera name?

Are there position/rotation keyframes on your camera?

yes, but it doesn’t work

Try it now


 obj = $Camera01 -- change this to the name of your camera
 framerange = #()
 rangeString = ""
 global firstnum
 
 for j in animationrange.start to animationrange.end do
 (
 	at time (j-1) (pastPos = obj.pos;pastRot = obj.rotation)
 	at time (j+1) (futurePos = obj.pos;futureRot = obj.rotation)
 	at time j
 	(
 		currentPos = obj.pos
 		currentRot = obj.rotation
 		if currentPos != pastPos or currentPos != futurePos or currentRot != pastRot or currentRot != futureRot then
 		(
 			if firstNum == undefined then
 			(
 				firstNum = j
 			)
 			framerange[framerange.count + 1] = (j as integer)/160
 		)else
 		(
 			if firstNum != undefined then
 			(
 				lastNum = j - 1
 				rangeString += ((firstNum as integer/160) as string) + "-" + ((lastNum as integer/160) as string) +","
 				firstNum = undefined
 			)
 			
 		)
 	)
 )
 
 if rangeString != "" then
 (
 	rangeString = substring rangeString 1 (rangeString.count - 1)
 )
 
 renderscenedialog.close()
 rendTimeType = 4
 rendPickupFrames = rangeString
 
 renderscenedialog.open()

mmm I strated to work on a simplier version. I want to use key number
here is a test:

cam = $Camera01

if numKeys cam.pos.controller != 0 do
(
–keynumber = numKeys cam.pos.controller
–k1=1
–k2=3
range =( (k1 as string)+ “-” +(k2 as string))

renderscenedialog.close()
rendTimeType = 4
rendPickupFrames = range
renderscenedialog.open()
)

Sorry I reply before seing your answer! Thank you.
It works better but instead of cutting sequences it does one seq only.

0-125 instead of 0-10,22-35,55-76,105-125

Loran, the problem with that approach is it doesn’t determine if the camera is moving. For example, if you had 4 keyframes where you have two areas of animation. You would have to make an assumption that the animation is happening between keys 1 and 2, nothing between 2 and 3, and animation again between 3 and 4. But, if that isn’t the case then your code will break. ivanisavich code is calculating if there is actual transformation change or not, yours doesn’t take that into account.

-Eric

Page 1 / 2