When i duplicate a matinee actor in my level, and then try to add a new Matinee controller for the newly duplicated matinee into the level blueprint I get an error message that there are now multiple copies of the original matinee scenes controller in the level.
this creates a huge amount of cross linkages behind the scenes, I found if i duplicate the same scene 6 or 7 times, there are hundreds of cross references between all the actors referenced by the matinee scenes.
I am not seeing an error in any version of the engine from 4.5.0 onward. Let me give you my reproduction steps and see if they break for you and where:
Open a blank project.
Create a New Matinee
Add a New Empty Group
In the New Empty Group, Create a New Event Track
Add 2 Events named Event and Event2
Close Matinee
Open the Level Blueprint
With the Matinee Actor selected in the Level, Right Click in Level BP and add Matinee Controller from Matinee Referenced
In the Level Viewport, Hold ALT and Drag the Matinee Actor to create a duplicate actor
In the level Blueprint and the new Matinee Actor selected, Right Click and add Matinee Controller from Matinee Referenced
RESULTS: Two Controls in Level BP each identical except referencing the separate matinee actors
Let me know your exact steps if different and the outcome
I just got back from holidays, here is the repro steps for the bug. Which I can confirm still happens in 4.6
open a new level.
Create a matinee actor
Add a matinee controller to the level blueprint for the matinee actor
Duplicate the Matinee actor in the level
Add a Matinee controller for the second matinee actor in the level blueprint
6. Compile the Level Blueprint (this step was missing from your steps above)
A blueprint compile error occurs saying that there are more than one function with the same name. (see attached screenshot)
We had a bit of a look into the code for this: When you duplicate a matinee actor, under the hood it’s duplicating the matinee controller in the blueprint as well but not adding the blueprint node. If you then manually add the matinee controller node in the blueprint it lets you add a second controller when it’s not supposed to.
The next part of the problem this causes is:
Compiling the blueprint for a second time appears to resolves the error (in the blueprint log anyway)
If you now add a skeletal mesh with a Visibility track to the duplicated matinee, and create some keys in the visibility track, nodes for each key are added to the output of the matinee controller.
This causes the matinee scene to slow down, and eventually
This issue has completely stalled our cutscene work, which is a large part of finishing our project, so I’ve had to go and put some hack fixes in myself. Here’s some extra info for your engineers:
Problem 1: Adding keys to tracks that aren’t event tracks (like adding show/hide keys to a visibility track) is causing events to be added to the matinee controller. My hack fix is this:
#if 1 // UG_CHANGE: ryan: Never call OnEventKeyframeAdded if the track being added to is not an event track
if( !bCommonName && Track->IsA(UInterpTrackEvent::StaticClass()))
#else
if( !bCommonName )
#endif
in FMatinee::FinishAddKey.
Problem 2: Duplicate matinee controllers are being created. Every time an event is added to a matinee controller the blueprint is recompiled (it’s a partial recompile I think, but I don’t really understand the blueprint compiler at all). This compilation causes the entire blueprint graph to be completely duplicated which includes duplicating the matinee controller.
My understanding is there is only supposed to be one matinee controller per matinee actor. There are many and because the matinee controller’s constructor adds the controller to a bunch of delegates, even though the controllers aren’t in the blueprint graph they are still having those delegates called on them which causes a blueprint recompile! See “Problem 1” for why this can explode into a serious problem.
My hack fix is this:
#if 1 // UG_CHANGE: ryan: duplicate matinee controllers exist! Make sure the matinee actor actually has our name as it's MatineeControllerName
if ( MatineeActor == InMatineeActor && InMatineeActor->MatineeControllerName == GetFName())
#else
if ( MatineeActor == InMatineeActor )
#endif
in each delegate implementation of UK2Node_MatineeController. I’m making sure the matinee actor’s MatineeControllerName is equal to the matinee controller the delegate has been called on.