Page 1 of 2

Camera Effect Script - once again

Posted: 07 Aug 2018, 23:11
by winnixxl
TL;DR
(How) does the camera effect script work in the Replay Editor?

I know there were already a couple threads discussing this, but I cant figure out whether you can use a script to control the camera.

What Im trying to do:
I filmed a video with my camera, tracked the camera motion using Blender, and exported the position and rotation data to a text file. The result looks something like this (each line corresponds to 1 frame in the video):
|------camera position----------|-------camera rotation-------|
224.9051, 390.6299, 105.5979, 27.4825, 94.2573, 163.1965
224.9791, 390.6056, 105.5692, 27.4877, 94.3128, 163.1984
225.0992, 390.6345, 105.5379, 27.5061, 94.3870, 163.2044

now I want to get this data into the mediatracker (matching the movement of the real camera to the ingame camera)
The Camera Effect Script seemed to be the perfect tool for that.

What I've got so far:
I am using this script right now for testing how it works:

Code: Select all

#RequireContext CGameCtnMediaBlockCameraEffectScript
#Include "MathLib" as MathLib

while(True){
	OffsetPos[0] = A*200;
	OffsetPos[1] = 512.0;
	OffsetPos[2] = 15.0;
	
	OffsetRot[0] = 0.0;
	OffsetRot[1] = 0.0;
	OffsetRot[2] = 0.0;
	yield;
}
However the camera just stays fixed to its default position, where it was when I open the replay

How can you help me:
  • How to use the Camera Effect Script
    If I was able to make the camera do anything at all, that would be a huge step for me
  • Other ideas on how to control the movement of the camera
    My last resort would probably be a regular custom camera and AutoHotkey to create lots and lots of keyframes, but that would probably be really annoying
    I never have looked at Openplanet, could this be a possibility?
Thank you very much for reading this far :clap:
Any help would be appreciated

winnixxl

Re: Camera Effect Script - once again

Posted: 08 Aug 2018, 13:32
by Demented
Hi winnixxl, and welcome to the forum.
What you are trying to do sounds really cool.
I wish I had some answers for you, but I would like to know more about this also.

Re: Camera Effect Script - once again

Posted: 08 Aug 2018, 16:48
by winnixxl
OK so Im gonna use this thread, to keep you updated about the progress I made

METHOD 1: AutoHotkey (Updated 2018-08-17)

The code for this will from now be hosted at
https://bitbucket.org/winnixxl/blender_ ... planet/src
  • 2018-08-08
    Basically it creates a new keyframe, reads one line from the file and enters the coordinates
  • 2018-08-09
    The script now adds multiple keyframes. However Maniaplanet is limiting me to put the keyframes 0.05 seconds apart
    With my 50fps video, Id like to have a 0.02 second gap, but that is only possible if you drag the keyframes to their correct position and this seems to be almost impossible via AutoHotkey. :? Oh and I can put keyframes on 0.05 -> 0.10 -> 0.15 -> 0.21 but not 0.20??? Nadeo please...
    The next Task will be to make the script a bit faster (1.2 seconds per keyframe)
  • 2018-08-17
    Added setting to to deal with different framerates, FOVs, and compensate for Maniaplanets strange coordinate system
    Not too much new features but overall workflow enhancements
  • 2018-08-24 moved the code to bitbucket
    Added a GUI for the conversion of the Blender file

Re: Camera Effect Script - once again

Posted: 08 Aug 2018, 17:23
by adamkooo2
It would be nice if someone would know some information about this

Re: Camera Effect Script - once again

Posted: 10 Aug 2018, 01:20
by winnixxl
A First Test Video :pop:
Far from perfect but im still quite happy
https://media.giphy.com/media/8ZhQm4nkp ... /giphy.gif

And its really annoying that I cant post links, images or videos :roll:

Re: Camera Effect Script - once again

Posted: 10 Aug 2018, 07:59
by TMarc
Nice shot :thumbsup:
Yeah you don't have enough messages posted yet, it is part of the spam prevention.
Btw. I fixed the link for you :)

Re: Camera Effect Script - once again

Posted: 10 Aug 2018, 17:43
by winnixxl
TMarc wrote:
10 Aug 2018, 07:59
I fixed the link for you :)
Thank you.
I wil be gone over the weekend, but post more updates next week

Re: Camera Effect Script - once again

Posted: 13 Aug 2018, 23:41
by winnixxl
Just a small update video today, gonna write more tomorrow.


Re: Camera Effect Script - once again

Posted: 14 Aug 2018, 03:34
by Miss
Fixed your link again. That is super cool.

I'd like to add - it might be possible to simplify your AHK script a lot by using Openplanet scripts (see my signature). Not sure about the possibilities there as I haven't looked at MP's APIs for the maniatracker classes myself, but it might be worth checking out.

Re: Camera Effect Script - once again

Posted: 14 Aug 2018, 15:10
by Demented
Wow! That's looking really cool. Can't wait to see what more you achieve with this project. :thumbsup: