Skip to content

(Fix-or-)Revert "Effect parenting" #4169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

ferdnyc
Copy link
Contributor

@ferdnyc ferdnyc commented Jun 2, 2021

Reverts #4058

I don't actually want to revert this. However, it needs to be fixed or reverted.

As I warned in review, the change to the properties_model.py breaks the optimization of undo/redo functionality. Previously, changing the location_x parameter of a clip produced this undo entry:

    {
        "type":"update",
        "key":["clips",{"id":"YC9SVDHLRG"}],
        "value":
        {
            "location_x":{"Points":[
                {"co":{"X":1.0,"Y":0.4803149606299213},"interpolation":2},
                {"co":{"X":24,"Y":0.46666666666666656},"interpolation":1},
                {"co":{"X":50,"Y":-0.35},"interpolation":1}]}
        },
        "partial":false,
        "old_values":
        {
            "alpha":{
                "Points":[
                    {"co":{"X":1.0,"Y":1.0},"interpolation":2},
                    {"co":{"X":24,"Y":0.7166666666666667},"interpolation":1},
                    {"co":{"X":50,"Y":0.23333333333333334},"interpolation":1}
            ]},
            "anchor":0,
            "channel_filter":{"Points":[{"co":{"X":1.0,"Y":-1.0},"interpolation":2}]},
            "channel_mapping":{"Points":[{"co":{"X":1.0,"Y":-1.0},"interpolation":2}]},
            "crop_height":{"Points":[{"co":{"X":1.0,"Y":1.0},"interpolation":2}]},
            "crop_width":{"Points":[{"co":{"X":1.0,"Y":1.0},"interpolation":2}]},
            "crop_x":{"Points":[{"co":{"X":1.0,"Y":0.0},"interpolation":2}]},
            "crop_y":{"Points":[{"co":{"X":1.0,"Y":0.0},"interpolation":2}]},
            "display":0,
            "duration":1.6333333651224773,
            "effects":[
                {"class_name":"ChromaKey","color":{"alpha":{"Points":[]},"blue":{"Points":[]},"green":{"Points":[]},"red":{"Points":[]}}, "description":"Replaces the color (or chroma) of the frame with transparency (i.e. keys out the color).", "duration":0.0, "end":0.0, "fuzz":{"Points":[{"co":{"X":1.0,"Y":5.0},"interpolation":2}]}, "has_audio":false, "has_video":true, "id":"F8EJSKJ63H", "layer":0, "name":"Chroma Key (Greenscreen)", "order":0, "position":0.0, "start":0.0, "type":"ChromaKey"}
            ],
            "end":1.6333333333333333,
            "gravity":4,
            "has_audio":{"Points":[{"co":{"X":1.0,"Y":-1.0},"interpolation":2}]},
            "has_video":{"Points":[{"co":{"X":1.0,"Y":-1.0},"interpolation":2}]},
            "id":"YC9SVDHLRG",
            "layer":3000000,
            "location_x":{"Points":[
                {"co":{"X":1.0,"Y":-0.3385826771653543},"interpolation":2},
                {"co":{"X":24,"Y":0.46666666666666656},"interpolation":1},
                {"co":{"X":50,"Y":-0.35},"interpolation":1}
            ]},
            "location_y":{"Points":[{"co":{"X":1.0,"Y":0.0},"interpolation":2}]},
            "mixing":0,
            "origin_x":{"Points":[{"co":{"X":1.0,"Y":0.5},"interpolation":2}]},
            "origin_y":{"Points":[{"co":{"X":1.0,"Y":0.5},"interpolation":2}]},
            "perspective_c1_x":{"Points":[{"co":{"X":1.0,"Y":-1.0},"interpolation":2}]},
            "perspective_c1_y":{"Points":[{"co":{"X":1.0,"Y":-1.0},"interpolation":2}]},
            "perspective_c2_x":{"Points":[{"co":{"X":1.0,"Y":-1.0},"interpolation":2}]},
            "perspective_c2_y":{"Points":[{"co":{"X":1.0,"Y":-1.0},"interpolation":2}]},
            "perspective_c3_x":{"Points":[{"co":{"X":1.0,"Y":-1.0},"interpolation":2}]},
            "perspective_c3_y":{"Points":[{"co":{"X":1.0,"Y":-1.0},"interpolation":2}]},
            "perspective_c4_x":{"Points":[{"co":{"X":1.0,"Y":-1.0},"interpolation":2}]},
            "perspective_c4_y":{"Points":[{"co":{"X":1.0,"Y":-1.0},"interpolation":2}]},
            "position":2.4,
            "reader":{"acodec":"","audio_bit_rate":0,"audio_stream_index":-1,"audio_timebase":{"den":1,"num":1},"channel_layout":4,"channels":0,"display_ratio":{"den":9,"num":16},"duration":1.6333333651224773,"file_size":"-1","fps":{"den":1,"num":30},"has_audio":false,"has_single_image":false,"has_video":true,"height":720,"interlaced_frame":false,"metadata":{},"path":"../../home/ferd/rpmbuild/REPOS/openshot-qt/bugtesting/seq_transparency/Venture%03d.png","pixel_format":26,"pixel_ratio":{"den":11811,"num":11811},"sample_rate":0,"top_field_first":true,"type":"FFmpegReader","vcodec":"png","video_bit_rate":0,"video_length":"49","video_stream_index":0,"video_timebase":{"den":25,"num":1},"width":1280},
            "rotation":{"Points":[{"co":{"X":1.0,"Y":0.0},"interpolation":2}]},
            "scale":1,
            "scale_x":{"Points":[{"co":{"X":1.0,"Y":1.0},"interpolation":2}]},
            "scale_y":{"Points":[{"co":{"X":1.0,"Y":1.0},"interpolation":2}]},
            "shear_x":{"Points":[{"co":{"X":1.0,"Y":0.0},"interpolation":2}]},
            "shear_y":{"Points":[{"co":{"X":1.0,"Y":0.0},"interpolation":2}]},
            "start":0,
            "time":{"Points":[{"co":{"X":1.0,"Y":1.0},"interpolation":2}]},
            "volume":{"Points":[{"co":{"X":1.0,"Y":1.0},"interpolation":2}]},
            "wave_color":{
                "alpha":{"Points":[{"co":{"X":1.0,"Y":255.0},"handle_left":{"X":0.5,"Y":1.0},"handle_right":{"X":0.5,"Y":0.0},"handle_type":0,"interpolation":0}]},
                "blue":{"Points":[{"co":{"X":1.0,"Y":255.0},"handle_left":{"X":0.5,"Y":1.0},"handle_right":{"X":0.5,"Y":0.0},"handle_type":0,"interpolation":0}]},
                "green":{"Points":[{"co":{"X":1.0,"Y":123.0},"handle_left":{"X":0.5,"Y":1.0},"handle_right":{"X":0.5,"Y":0.0},"handle_type":0,"interpolation":0}]},
                "red":{"Points":[{"co":{"X":1.0,"Y":0.0},"handle_left":{"X":0.5,"Y":1.0},"handle_right":{"X":0.5,"Y":0.0},"handle_type":0,"interpolation":0}]}
            },
            "waveform":false,
            "file_id":"R5EQI7PSFC",
            "title":"Venture%03d.png",
            "image":"thumbnail/R5EQI7PSFC.png"
        }
    }

After the merge, that same change results in this being inserted into the undo list:

    {
        "type":"update",
        "key":["clips",{"id":"YC9SVDHLRG"}],
        "value":
        {
            "alpha":{
                "Points":[
                    {"co":{"X":1.0,"Y":1.0},"interpolation":2},
                    {"co":{"X":24,"Y":0.7166666666666667},"interpolation":1},
                    {"co":{"X":50,"Y":0.23333333333333334},"interpolation":1}
            ]},
            "anchor":0,
            "channel_filter":{"Points":[{"co":{"X":1.0,"Y":-1.0},"interpolation":2}]},
            "channel_mapping":{"Points":[{"co":{"X":1.0,"Y":-1.0},"interpolation":2}]},
            "crop_height":{"Points":[{"co":{"X":1.0,"Y":1.0},"interpolation":2}]},
            "crop_width":{"Points":[{"co":{"X":1.0,"Y":1.0},"interpolation":2}]},
            "crop_x":{"Points":[{"co":{"X":1.0,"Y":0.0},"interpolation":2}]},
            "crop_y":{"Points":[{"co":{"X":1.0,"Y":0.0},"interpolation":2}]},
            "display":0,
            "duration":1.6333333651224773,
            "effects":[
                {"class_name":"ChromaKey","color":{"alpha":{"Points":[]},"blue":{"Points":[]},"green":{"Points":[]},"red":{"Points":[]}}, "description":"Replaces the color (or chroma) of the frame with transparency (i.e. keys out the color).", "duration":0.0, "end":0.0, "fuzz":{"Points":[{"co":{"X":1.0,"Y":5.0},"interpolation":2}]}, "has_audio":false, "has_video":true, "id":"F8EJSKJ63H", "layer":0, "name":"Chroma Key (Greenscreen)", "order":0, "position":0.0, "start":0.0, "type":"ChromaKey"}
            ],
            "end":1.6333333333333333,
            "gravity":4,
            "has_audio":{"Points":[{"co":{"X":1.0,"Y":-1.0},"interpolation":2}]},
            "has_video":{"Points":[{"co":{"X":1.0,"Y":-1.0},"interpolation":2}]},
            "id":"YC9SVDHLRG",
            "layer":3000000,
            "location_x":{"Points":[
                {"co":{"X":1.0,"Y":-0.3385826771653543},"interpolation":2},
                {"co":{"X":24,"Y":0.46666666666666656},"interpolation":1},
                {"co":{"X":50,"Y":-0.35},"interpolation":1}
            ]},
            "location_y":{"Points":[{"co":{"X":1.0,"Y":0.0},"interpolation":2}]},
            "mixing":0,
            "origin_x":{"Points":[{"co":{"X":1.0,"Y":0.5},"interpolation":2}]},
            "origin_y":{"Points":[{"co":{"X":1.0,"Y":0.5},"interpolation":2}]},
            "perspective_c1_x":{"Points":[{"co":{"X":1.0,"Y":-1.0},"interpolation":2}]},
            "perspective_c1_y":{"Points":[{"co":{"X":1.0,"Y":-1.0},"interpolation":2}]},
            "perspective_c2_x":{"Points":[{"co":{"X":1.0,"Y":-1.0},"interpolation":2}]},
            "perspective_c2_y":{"Points":[{"co":{"X":1.0,"Y":-1.0},"interpolation":2}]},
            "perspective_c3_x":{"Points":[{"co":{"X":1.0,"Y":-1.0},"interpolation":2}]},
            "perspective_c3_y":{"Points":[{"co":{"X":1.0,"Y":-1.0},"interpolation":2}]},
            "perspective_c4_x":{"Points":[{"co":{"X":1.0,"Y":-1.0},"interpolation":2}]},
            "perspective_c4_y":{"Points":[{"co":{"X":1.0,"Y":-1.0},"interpolation":2}]},
            "position":2.4,
            "reader":{"acodec":"","audio_bit_rate":0,"audio_stream_index":-1,"audio_timebase":{"den":1,"num":1},"channel_layout":4,"channels":0,"display_ratio":{"den":9,"num":16},"duration":1.6333333651224773,"file_size":"-1","fps":{"den":1,"num":30},"has_audio":false,"has_single_image":false,"has_video":true,"height":720,"interlaced_frame":false,"metadata":{},"path":"../../home/ferd/rpmbuild/REPOS/openshot-qt/bugtesting/seq_transparency/Venture%03d.png","pixel_format":26,"pixel_ratio":{"den":11811,"num":11811},"sample_rate":0,"top_field_first":true,"type":"FFmpegReader","vcodec":"png","video_bit_rate":0,"video_length":"49","video_stream_index":0,"video_timebase":{"den":25,"num":1},"width":1280},
            "rotation":{"Points":[{"co":{"X":1.0,"Y":0.0},"interpolation":2}]},
            "scale":1,
            "scale_x":{"Points":[{"co":{"X":1.0,"Y":1.0},"interpolation":2}]},
            "scale_y":{"Points":[{"co":{"X":1.0,"Y":1.0},"interpolation":2}]},
            "shear_x":{"Points":[{"co":{"X":1.0,"Y":0.0},"interpolation":2}]},
            "shear_y":{"Points":[{"co":{"X":1.0,"Y":0.0},"interpolation":2}]},
            "start":0,
            "time":{"Points":[{"co":{"X":1.0,"Y":1.0},"interpolation":2}]},
            "volume":{"Points":[{"co":{"X":1.0,"Y":1.0},"interpolation":2}]},
            "wave_color":{
                "alpha":{"Points":[{"co":{"X":1.0,"Y":255.0},"handle_left":{"X":0.5,"Y":1.0},"handle_right":{"X":0.5,"Y":0.0},"handle_type":0,"interpolation":0}]},
                "blue":{"Points":[{"co":{"X":1.0,"Y":255.0},"handle_left":{"X":0.5,"Y":1.0},"handle_right":{"X":0.5,"Y":0.0},"handle_type":0,"interpolation":0}]},
                "green":{"Points":[{"co":{"X":1.0,"Y":123.0},"handle_left":{"X":0.5,"Y":1.0},"handle_right":{"X":0.5,"Y":0.0},"handle_type":0,"interpolation":0}]},
                "red":{"Points":[{"co":{"X":1.0,"Y":0.0},"handle_left":{"X":0.5,"Y":1.0},"handle_right":{"X":0.5,"Y":0.0},"handle_type":0,"interpolation":0}]}
            },
            "waveform":false,
            "file_id":"R5EQI7PSFC",
            "title":"Venture%03d.png",
            "image":"thumbnail/R5EQI7PSFC.png"
        },
        "partial":false,
        "old_values":
        {
            "alpha":{
                "Points":[
                    {"co":{"X":1.0,"Y":1.0},"interpolation":2},
                    {"co":{"X":24,"Y":0.7166666666666667},"interpolation":1},
                    {"co":{"X":50,"Y":0.23333333333333334},"interpolation":1}
            ]},
            "anchor":0,
            "channel_filter":{"Points":[{"co":{"X":1.0,"Y":-1.0},"interpolation":2}]},
            "channel_mapping":{"Points":[{"co":{"X":1.0,"Y":-1.0},"interpolation":2}]},
            "crop_height":{"Points":[{"co":{"X":1.0,"Y":1.0},"interpolation":2}]},
            "crop_width":{"Points":[{"co":{"X":1.0,"Y":1.0},"interpolation":2}]},
            "crop_x":{"Points":[{"co":{"X":1.0,"Y":0.0},"interpolation":2}]},
            "crop_y":{"Points":[{"co":{"X":1.0,"Y":0.0},"interpolation":2}]},
            "display":0,
            "duration":1.6333333651224773,
            "effects":[
                {"class_name":"ChromaKey","color":{"alpha":{"Points":[]},"blue":{"Points":[]},"green":{"Points":[]},"red":{"Points":[]}}, "description":"Replaces the color (or chroma) of the frame with transparency (i.e. keys out the color).", "duration":0.0, "end":0.0, "fuzz":{"Points":[{"co":{"X":1.0,"Y":5.0},"interpolation":2}]}, "has_audio":false, "has_video":true, "id":"F8EJSKJ63H", "layer":0, "name":"Chroma Key (Greenscreen)", "order":0, "position":0.0, "start":0.0, "type":"ChromaKey"}
            ],
            "end":1.6333333333333333,
            "gravity":4,
            "has_audio":{"Points":[{"co":{"X":1.0,"Y":-1.0},"interpolation":2}]},
            "has_video":{"Points":[{"co":{"X":1.0,"Y":-1.0},"interpolation":2}]},
            "id":"YC9SVDHLRG",
            "layer":3000000,
            "location_x":{"Points":[
                {"co":{"X":1.0,"Y":0.0},"interpolation":2},
                {"co":{"X":24,"Y":0.46666666666666656},"interpolation":1},
                {"co":{"X":50,"Y":-0.35},"interpolation":1}
            ]},
            "location_y":{"Points":[{"co":{"X":1.0,"Y":0.0},"interpolation":2}]},
            "mixing":0,
            "origin_x":{"Points":[{"co":{"X":1.0,"Y":0.5},"interpolation":2}]},
            "origin_y":{"Points":[{"co":{"X":1.0,"Y":0.5},"interpolation":2}]},
            "perspective_c1_x":{"Points":[{"co":{"X":1.0,"Y":-1.0},"interpolation":2}]},
            "perspective_c1_y":{"Points":[{"co":{"X":1.0,"Y":-1.0},"interpolation":2}]},
            "perspective_c2_x":{"Points":[{"co":{"X":1.0,"Y":-1.0},"interpolation":2}]},
            "perspective_c2_y":{"Points":[{"co":{"X":1.0,"Y":-1.0},"interpolation":2}]},
            "perspective_c3_x":{"Points":[{"co":{"X":1.0,"Y":-1.0},"interpolation":2}]},
            "perspective_c3_y":{"Points":[{"co":{"X":1.0,"Y":-1.0},"interpolation":2}]},
            "perspective_c4_x":{"Points":[{"co":{"X":1.0,"Y":-1.0},"interpolation":2}]},
            "perspective_c4_y":{"Points":[{"co":{"X":1.0,"Y":-1.0},"interpolation":2}]},
            "position":2.4,
            "reader":{"acodec":"","audio_bit_rate":0,"audio_stream_index":-1,"audio_timebase":{"den":1,"num":1},"channel_layout":4,"channels":0,"display_ratio":{"den":9,"num":16},"duration":1.6333333651224773,"file_size":"-1","fps":{"den":1,"num":30},"has_audio":false,"has_single_image":false,"has_video":true,"height":720,"interlaced_frame":false,"metadata":{},"path":"../../home/ferd/rpmbuild/REPOS/openshot-qt/bugtesting/seq_transparency/Venture%03d.png","pixel_format":26,"pixel_ratio":{"den":11811,"num":11811},"sample_rate":0,"top_field_first":true,"type":"FFmpegReader","vcodec":"png","video_bit_rate":0,"video_length":"49","video_stream_index":0,"video_timebase":{"den":25,"num":1},"width":1280},
            "rotation":{"Points":[{"co":{"X":1.0,"Y":0.0},"interpolation":2}]},
            "scale":1,
            "scale_x":{"Points":[{"co":{"X":1.0,"Y":1.0},"interpolation":2}]},
            "scale_y":{"Points":[{"co":{"X":1.0,"Y":1.0},"interpolation":2}]},
            "shear_x":{"Points":[{"co":{"X":1.0,"Y":0.0},"interpolation":2}]},
            "shear_y":{"Points":[{"co":{"X":1.0,"Y":0.0},"interpolation":2}]},
            "start":0,
            "time":{"Points":[{"co":{"X":1.0,"Y":1.0},"interpolation":2}]},
            "volume":{"Points":[{"co":{"X":1.0,"Y":1.0},"interpolation":2}]},
            "wave_color":{
                "alpha":{"Points":[{"co":{"X":1.0,"Y":255.0},"handle_left":{"X":0.5,"Y":1.0},"handle_right":{"X":0.5,"Y":0.0},"handle_type":0,"interpolation":0}]},
                "blue":{"Points":[{"co":{"X":1.0,"Y":255.0},"handle_left":{"X":0.5,"Y":1.0},"handle_right":{"X":0.5,"Y":0.0},"handle_type":0,"interpolation":0}]},
                "green":{"Points":[{"co":{"X":1.0,"Y":123.0},"handle_left":{"X":0.5,"Y":1.0},"handle_right":{"X":0.5,"Y":0.0},"handle_type":0,"interpolation":0}]},
                "red":{"Points":[{"co":{"X":1.0,"Y":0.0},"handle_left":{"X":0.5,"Y":1.0},"handle_right":{"X":0.5,"Y":0.0},"handle_type":0,"interpolation":0}]}
            },
            "waveform":false,
            "file_id":"R5EQI7PSFC",
            "title":"Venture%03d.png",
            "image":"thumbnail/R5EQI7PSFC.png"
        }
    }

The same is true for any change to any property. That's not an acceptable regression.

cc: @jonoomph @BrennoCaldato

Copy link
Collaborator

@JacksonRG JacksonRG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just noticed that in develop dragging a clip to timeline freezes the program. This isn't happening in develop~1. So a revert seems in order.

@ferdnyc
Copy link
Contributor Author

ferdnyc commented Jun 3, 2021

@JacksonRG

That I'm not seeing, I don't think... do you mean dragging from the Project Files list, or dragging in a media file directly from the OS?

Is your libopenshot build up to date? There were corresponding changes merged there recently, if you haven't built a most-current libopenshot that could cause issues.

(It's also a good idea to blow away the bindings subtree of your build directory entirely before building, if there have been API changes and you're recompiling a dirty tree. For historical reasons the SWIG module code isn't properly dependent on the header files it's generated from, in CMake, so changes to headers won't automatically cause the bindings to get re-generated. Deleting the entire bindings directory prompts CMake to start over again from scratch with the SWIG parts.)

@ferdnyc
Copy link
Contributor Author

ferdnyc commented Jun 3, 2021

Is your libopenshot build up to date? There were corresponding changes merged there recently, if you haven't built a most-current libopenshot that could cause issues.

Heh. In fact, I think that's what took down the previous CI run; the CI builds here use the Ubuntu PPA packages as their source for libopenshot-audio and libopenshot, and yesterday those packages were still a day out of date. I've ensured that they're now regenerated, so we'll see if this unit test run goes any better...

(ETA: It did not. Something weird is going on with the CI runs, but I don't think it's our code. Runs fine for me locally. Still investigating.)

@ferdnyc
Copy link
Contributor Author

ferdnyc commented Jun 5, 2021

Solved it, PR building in libopenshot

@ferdnyc
Copy link
Contributor Author

ferdnyc commented Jun 5, 2021

(The build issue, I mean. The properties thing is still a problem)

@ferdnyc
Copy link
Contributor Author

ferdnyc commented Jun 5, 2021

Turned out, there were some issues caused by those aforementioned libopenshot changes, which I fixed last night in OpenShot/libopenshot#683. Anyone using the Ubuntu PPAs or building their own libopenshot should update to fix the Python bindings, which affects OpenShot.

@ferdnyc
Copy link
Contributor Author

ferdnyc commented Jul 13, 2021

(It's also a good idea to blow away the bindings subtree of your build directory entirely before building, if there have been API changes and you're recompiling a dirty tree. For historical reasons the SWIG module code isn't properly dependent on the header files it's generated from, in CMake, so changes to headers won't automatically cause the bindings to get re-generated. Deleting the entire bindings directory prompts CMake to start over again from scratch with the SWIG parts

That was FINALLY fixed in CMake 3.20, btw.

@ferdnyc
Copy link
Contributor Author

ferdnyc commented Jul 13, 2021

This issue, OTOH is fixed by my recent optimized-saving PR (don't have the # handy), which will make this revert unnecessary when merged. That's looking likely enough at this point that I'm going to close this as solved.

@ferdnyc ferdnyc closed this Jul 13, 2021
@jonoomph jonoomph deleted the revert-4058-effect-parenting branch November 30, 2022 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants