Camera Effect Script - once again

Talk about the MediaTracker here

Moderator: English Moderator

winnixxl
Posts: 7
Joined: 04 Oct 2015, 14:24

Camera Effect Script - once again

Post 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
Last edited by winnixxl on 08 Aug 2018, 19:17, edited 1 time in total.
User avatar
Demented
Posts: 2329
Joined: 07 Nov 2010, 13:17
Location: United States

Re: Camera Effect Script - once again

Post 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.
CPU: Intel I7-4770 64Bit @ 3.4Ghz.
Ram: 32GB DDR3
GPU: Geforce GXT 1060 6.2GB DDR5
Windows: 7 Pro SP1 64bit
winnixxl
Posts: 7
Joined: 04 Oct 2015, 14:24

Re: Camera Effect Script - once again

Post 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
Last edited by winnixxl on 26 Aug 2018, 13:02, edited 7 times in total.
User avatar
adamkooo2
Posts: 1371
Joined: 13 Jun 2014, 08:43
Location: Slovakia
Contact:

Re: Camera Effect Script - once again

Post by adamkooo2 »

It would be nice if someone would know some information about this
/\rkady
Image
winnixxl
Posts: 7
Joined: 04 Oct 2015, 14:24

Re: Camera Effect Script - once again

Post 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:
User avatar
TMarc
Posts: 15441
Joined: 05 Apr 2011, 19:10
Location: Europe
Contact:

Re: Camera Effect Script - once again

Post 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 :)
winnixxl
Posts: 7
Joined: 04 Oct 2015, 14:24

Re: Camera Effect Script - once again

Post 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
winnixxl
Posts: 7
Joined: 04 Oct 2015, 14:24

Re: Camera Effect Script - once again

Post by winnixxl »

Just a small update video today, gonna write more tomorrow.

https://youtu.be/UASyvyC52Yg
User avatar
Miss
Posts: 2155
Joined: 05 Jan 2016, 11:34
Location: The Netherlands
Contact:

Re: Camera Effect Script - once again

Post 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.
3080 RTX, Ryzen 3700X, 32GB RAM, Windows 11
Forum moderator, opinions are my own. :thx:
Check out Image openplanet, the alternative ManiaPlanet & Turbo scripting platform! (Openplanet subforum)
I also stream and tweet.
User avatar
Demented
Posts: 2329
Joined: 07 Nov 2010, 13:17
Location: United States

Re: Camera Effect Script - once again

Post by Demented »

Wow! That's looking really cool. Can't wait to see what more you achieve with this project. :thumbsup:
CPU: Intel I7-4770 64Bit @ 3.4Ghz.
Ram: 32GB DDR3
GPU: Geforce GXT 1060 6.2GB DDR5
Windows: 7 Pro SP1 64bit
Post Reply

Return to “MediaTracker”

Who is online

Users browsing this forum: No registered users and 2 guests