Skip to content
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

Replace OTIO Core with python-wrapped C++ #540

Merged
merged 140 commits into from Jul 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
140 commits
Select commit Hold shift + click to select a range
2b1a03b
initial restructure with c++ files
Dec 9, 2018
75311e8
add install of include files
Dec 9, 2018
9186eda
add MACOSX_RPATH
Dec 9, 2018
275b885
fix how we get to deps include stuff
Dec 9, 2018
8f35d8b
removed extraneous move
Dec 9, 2018
cf7df55
add support for int64
Dec 9, 2018
23636cf
added in many missing methods
Dec 12, 2018
de298e6
eliminate int/size_t warnings
Dec 12, 2018
2db9bf1
fixing up tests, adding in python each methods
Dec 12, 2018
5ad2e21
python methods for stack, track
Dec 12, 2018
991be52
checkpointing assorted fixes
Dec 13, 2018
ba163f9
c++11 style initialization syntax (i.e. {})
Dec 18, 2018
ae4acbe
updates
Dec 18, 2018
2c99342
baseline updates
Dec 18, 2018
9a4f0e2
after rebasing, fixed a few g++ bugs, more test fixes
Dec 19, 2018
17b1cf6
assorted bug fixes/cleanups/missing methods
Dec 22, 2018
78f9a11
make sure to use the specialized map::swap, not std::swap for AnyDict…
Dec 22, 2018
ff440b5
added namespaces
Dec 25, 2018
74346ac
added gil_scoping
Dec 28, 2018
ee96a41
make flatten_stack work on a vector of tracks
Dec 28, 2018
8efa004
updated comment
Dec 28, 2018
7483864
Add version.h header, fix ommission in from() method that didn't set …
Jan 19, 2019
9fa11db
Added code branching for python 3 typing differences (#1)
reinecke Jan 24, 2019
aa0d9ec
Python 3 fixes, fixed test that was using .copy() on a SerializabeObj…
Jan 24, 2019
753c859
remove debugging printf
Jan 28, 2019
f5e0012
removed junk file stupidfile
Jan 29, 2019
4b1debd
be specific that OK = 0 in error structures
Jan 29, 2019
e9dc4f2
enable building via setup.py
Feb 8, 2019
4bbc954
checkpointing swift work
Feb 8, 2019
88a7a70
fixups for working with pip install/python setup
Feb 9, 2019
cdd7723
Update README.md
davidbaraff Feb 9, 2019
8d738cb
Update README.md
davidbaraff Feb 9, 2019
33f6b8d
add cmake as a dependency
davidbaraff Feb 14, 2019
2a54fce
syncing up with master
Feb 19, 2019
cbb0175
checkpoint swift bindings code
Mar 14, 2019
20b9b84
added Unknown type, fixed some prints with type-info data
Mar 14, 2019
0d64ff3
fixed Timeline::setTracks() to be Timeline::set_tracks()
Apr 2, 2019
6681dc0
fleshing out the swift bindings
Apr 2, 2019
97e38c5
removed unused stuff in test, fixed binding code to use set_tracks, n…
Apr 4, 2019
6c84988
moved xges etc to proper place in contrib hierarchy
Apr 8, 2019
c0a8199
moved console_utils.py to proper place
Apr 8, 2019
3a6432a
Workaround swift compiler bug sending swift strings down to C++ throu…
Apr 9, 2019
4778a35
missing comma in package specifications
Apr 9, 2019
d92b69a
Move recent AAF work into correct location.
ssteinbach Apr 9, 2019
92568d5
check-manifest is now happy
ssteinbach Apr 9, 2019
d9529ef
fixed test (need to convert to list to do explicit comparison)
Apr 9, 2019
69a0136
Remove .git directors but include deps.
ssteinbach Apr 9, 2019
98f9608
fixed test failure in flatten_stack
Apr 10, 2019
447289d
removed stray printf
Apr 10, 2019
d62311e
fix for p aths
Apr 10, 2019
d84b8db
fixed lots of conbtrib tests
Apr 11, 2019
bd32b19
disable tests_xges_adapter.py
Apr 11, 2019
643a703
Merge pull request #486 from davidbaraff/cxx1
ssteinbach Apr 15, 2019
b8787e6
Use safe_str to handle py2/3 unicode differences
ssteinbach Apr 15, 2019
c591d62
Turn off the rv adapter in python3.
ssteinbach Apr 15, 2019
9f988f2
Enforce int type (from float in C++).
ssteinbach Apr 15, 2019
65a15e5
Run preflight checks before opening aaf file.
ssteinbach Apr 15, 2019
f138c93
Merge pull request #492 from ssteinbach/cxx-py3fix
ssteinbach Apr 17, 2019
b3c6987
fixed readme
Apr 17, 2019
8a7041f
Cxx coverage support (#495)
ssteinbach May 7, 2019
e788e7d
Suggested fix for #476 (#488)
apetrynet Apr 12, 2019
99722df
Use relative imports so otioview works in python3. (#489)
jminor Apr 13, 2019
8831793
Add global_start_time as a serializable_field. (#477)
ssteinbach Apr 19, 2019
789d6ed
AAF reader supports Timeline global_start_time (#478)
jminor Apr 19, 2019
a17bdcf
Timecode rate enhancements (#497)
reinecke Apr 19, 2019
e137747
documentation: Add information about the GES adapter (#498)
thiblahute Apr 19, 2019
8239a8e
Pass track name to mobslot (#500)
jchen9 Apr 19, 2019
ff063a3
Remove `console` and `test_utils` from the default import (#472)
ssteinbach Apr 19, 2019
8d1a410
Add AAF notes to adapter markdown. (#503)
ssteinbach Apr 19, 2019
f3c7915
Updated otioview screenshot. (#504)
jminor Apr 19, 2019
f161e1e
import console directly in otioview. (#505)
ssteinbach Apr 19, 2019
61b686d
Bump version number to beta 11
ssteinbach Apr 23, 2019
07803e0
Fix source clip start offset when writing AAFs (#506)
jchen9 Apr 24, 2019
a460aa7
AAF Writer: Improves support of nesting (#493)
freesonluxo Apr 29, 2019
154ff2b
Require a recent version of urllib3. (#513)
jminor May 3, 2019
241f6d6
Added OTIO logo (#510)
jminor May 4, 2019
4327476
Fixed link on title image
ssteinbach May 4, 2019
c269cb2
Add function to explicitly load SchemaDef plugins (#511)
ssteinbach May 7, 2019
bdbeab9
AAF Writer: Making precheck() more robust (#512)
freesonluxo May 8, 2019
d1195fc
Refactor FCP XML adapter - add generator and effect support (#494)
ssteinbach Jun 20, 2019
5114821
Add support for more elements and XMLs without libraries (#515)
ssteinbach Jun 20, 2019
693449c
AAF Writer: To get the edit rate, look at the first "child" not the f…
freesonluxo May 24, 2019
602dcde
AAF Reader: simplify source_range and available_range in transcribe()…
freesonluxo May 31, 2019
26a8de4
Merge branch 'master' into rebased_master
ssteinbach Jun 20, 2019
3917d18
move to relative imports for fetching names from the C++ code. (#530)
ssteinbach Jun 27, 2019
3ba2242
make global_start_time a serializable field (#532)
davidbaraff Jul 2, 2019
8ff8556
More local imports that I had missed. Whoops! (#531)
ssteinbach Jul 2, 2019
9b33365
Merge remote-tracking branch 'upstream/cxx' into test-merge
ssteinbach Jul 2, 2019
0da4a90
Use correct json serializer in the fcp adapter.
ssteinbach Jul 2, 2019
2ed809f
Fix typo.
ssteinbach Jul 2, 2019
efbfcd5
Expose drop_frame parameter to to_timecode.
ssteinbach Jul 2, 2019
f427435
Expand list of valid timecodes
ssteinbach Jul 3, 2019
4e44ffe
Use better truthy-ness detection in pybind 11
ssteinbach Jul 3, 2019
6bb80f2
Add SMPTE style timecodes to drop frame list
ssteinbach Jul 3, 2019
5272978
Conforming the from_timecode to match python
ssteinbach Jul 3, 2019
49f0b13
Argument passing to constructors
ssteinbach Jul 3, 2019
1c69735
Convert string None arguments to ""
ssteinbach Jul 3, 2019
0436904
Update FCP XML adapter test for None->""
ssteinbach Jul 3, 2019
9bbc2ee
add line number to error strings (#533)
davidbaraff Jul 3, 2019
8babc66
Merge remote-tracking branch 'upstream/cxx' into cxx
ssteinbach Jul 3, 2019
4ef2ac0
Remove OTIO_REF_ID (for now) to match master
ssteinbach Jul 5, 2019
827720a
Truing up baselines to master.
ssteinbach Jul 5, 2019
ba20595
Fix bug in FCP XML tests related to AnyDictionary
ssteinbach Jul 5, 2019
7391cca
Update test to default name of "" (was None)
ssteinbach Jul 8, 2019
242004b
Conform rv screening_example baseline to current
ssteinbach Jul 8, 2019
d633c3a
Conform tests with floats serializing with .0s
ssteinbach Jul 8, 2019
e963a78
Reading JSON is now more permissive
ssteinbach Jul 9, 2019
f805e83
When expanding transitions, fetch rate from the offset.
ssteinbach Jul 9, 2019
8daeb9c
Set rate correctly in TimeRange constructor.
ssteinbach Jul 10, 2019
390eb78
Fix metadata dictionary serialization order test
ssteinbach Jul 15, 2019
7499421
FCP_XML: video tracks write before audio tracks
ssteinbach Jul 15, 2019
cc802a2
Small cleanup in the FCP_XML unit tests.
ssteinbach Jul 15, 2019
bfa7a44
Lint pass (c++)
ssteinbach Jul 15, 2019
7468d52
Move the flake8 configuration to setup.cfg.
ssteinbach Jul 15, 2019
e964bd5
Move configuration for tox into the setup.cfg
ssteinbach Jul 16, 2019
944bc6d
Remove unneeded line from Makefile
ssteinbach Jul 16, 2019
4a1a303
Remove tox.ini from configuration files.
ssteinbach Jul 16, 2019
7eb0932
Rearranging flake8 configuration
ssteinbach Jul 16, 2019
aecc647
Add check-manifest configuration to setup.cfg
ssteinbach Jul 16, 2019
87d2832
Merge remote-tracking branch 'upstream/master' into cxx
ssteinbach Jul 16, 2019
f10e923
[opentimelineio] add OTIO_NS convenience macro for C++ clients (#534)
mattyjams Jul 16, 2019
5817088
Include <functional> to fix the build (#539)
thiblahute Jul 16, 2019
c529ef7
Working through lint errors
ssteinbach Jul 16, 2019
9f1e7c8
Merge remote-tracking branch 'upstream/cxx' into cxx
ssteinbach Jul 16, 2019
85a8665
Lint + bug fixes in timeline_widget.py
ssteinbach Jul 16, 2019
d7da58c
Bug fixes + linting in otioview.
ssteinbach Jul 16, 2019
cfc2c55
Lint pass.
ssteinbach Jul 16, 2019
1caffc2
Python3 Fixes for fcp_xml.
ssteinbach Jul 16, 2019
13b21d8
Python 3 fixes
ssteinbach Jul 16, 2019
4378f3d
Attempting to fix the python3 detection
ssteinbach Jul 16, 2019
d46948e
Marking python2 lines for noqa
ssteinbach Jul 16, 2019
27bd9dd
Merge remote-tracking branch 'upstream/master' into cxx
ssteinbach Jul 16, 2019
be4f929
Update the schema-doc with C++ classes to ignore
ssteinbach Jul 16, 2019
9756751
Repairing test console for CXX branch.
ssteinbach Jul 16, 2019
8ddd5ca
Update the autodoc-generation code.
ssteinbach Jul 17, 2019
5d63368
Update automatic schema doc with the C++ schemas
ssteinbach Jul 17, 2019
313eb3e
Lint pass.
ssteinbach Jul 17, 2019
ccc9b4e
Merge pull request #528 from ssteinbach/cxx
ssteinbach Jul 17, 2019
65298c7
Merge remote-tracking branch 'upstream/master' into cxx
ssteinbach Jul 22, 2019
acc486c
Merge pull request #543 from ssteinbach/cxx
ssteinbach Jul 22, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 10 additions & 2 deletions .codecov.yml
Expand Up @@ -5,12 +5,12 @@ codecov:
coverage:
precision: 2
round: down
range: "70...100"
range: "70...95"

status:
project: yes
patch: yes
changes: no
changes: yes

comment:
layout: "reach, diff, flags, files, footer"
Expand All @@ -22,3 +22,11 @@ ignore:
- "opentimelineio_contrib/adapters/tests/test_maya_sequencer.py"
- "opentimelineio_contrib/adapters/tests/test_burnins.py"
- "opentimelineio_contrib/adapters/burnins.py"
- "*aaf2*"
- "*pkg_resources*"
- "*pbr*"
- "*mock*"
- "*PIL*"
- "*funcsigs*"
- "/usr/*"
- "*/deps/*"
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -4,6 +4,7 @@ build*
dist*
*.egg-info
.coverage
coverage.info
.DS_store
htmlcov

Expand Down
12 changes: 12 additions & 0 deletions .gitmodules
@@ -0,0 +1,12 @@
[submodule "src/deps/optional-lite"]
path = src/deps/optional-lite
url = https://github.com/martinmoene/optional-lite
[submodule "src/deps/pybind11"]
path = src/deps/pybind11
url = https://github.com/pybind/pybind11.git
[submodule "src/deps/rapidjson"]
path = src/deps/rapidjson
url = https://github.com/Tencent/rapidjson.git
[submodule "src/deps/any"]
path = src/deps/any
url = https://github.com/thelink2012/any.git
7 changes: 6 additions & 1 deletion .travis.yml
@@ -1,3 +1,7 @@
addons:
apt:
packages: lcov

language: python
dist: xenial
python:
Expand All @@ -22,4 +26,5 @@ script:
after_success:
# Documentation for codecov uploader
# https://docs.codecov.io/docs/about-the-codecov-bash-uploader
- bash <(curl -s https://codecov.io/bash)
# run it twice, once to just print out data for debugging
- bash <(curl -s https://codecov.io/bash) -F $TOX_ENV -f .tox/build-$TOX_ENV/coverage.info -f .coverage
3 changes: 3 additions & 0 deletions CMakeLists.txt
@@ -0,0 +1,3 @@
cmake_minimum_required(VERSION 2.8.12)

add_subdirectory(src)
19 changes: 10 additions & 9 deletions MANIFEST.in
@@ -1,21 +1,22 @@
include README.md CHANGELOG.md LICENSE.txt NOTICE.txt
include README.md CHANGELOG.md LICENSE.txt NOTICE.txt CMakeLists.txt
recursive-include examples *
recursive-include opentimelineio *
recursive-include opentimelineio_contrib *.py
recursive-include contrib *
recursive-include src *

recursive-exclude docs *
prune docs
exclude .gitmodules
recursive-exclude src *.git
exclude .readthedocs.yml
exclude .codecov.yml
exclude .gitlab-ci.yml
exclude .travis.yml
exclude *.pdf
exclude CODE_OF_CONDUCT.md
exclude CONTRIBUTING.md
exclude opentimelineio_contrib/adapters/Makefile
exclude contrib/opentimelineio_contrib/adapters/Makefile
exclude Makefile

recursive-exclude opentimelineio_contrib/adapters/tests *
recursive-exclude **/__pycache__ *
global-exclude *.py[co]
recursive-exclude tests *
prune contrib/opentimelineio_contrib/adapters/tests
prune tests
prune src/deps/pybind11/tools/clang
prune src/deps/rapidjson/thirdparty
10 changes: 5 additions & 5 deletions Makefile
Expand Up @@ -42,15 +42,15 @@ test-core: python-version

test-contrib: python-version
@echo "$(ccgreen)Running Contrib tests...$(ccend)"
@make -C opentimelineio_contrib/adapters test VERBOSE=$(VERBOSE)
@make -C contrib/opentimelineio_contrib/adapters test VERBOSE=$(VERBOSE)

python-version:
@python --version

coverage: coverage-core coverage-contrib coverage-report

coverage-report:
@${COV_PROG} combine .coverage opentimelineio_contrib/adapters/.coverage
@${COV_PROG} combine .coverage contrib/opentimelineio_contrib/adapters/.coverage
@${COV_PROG} report -m

coverage-core: python-version
Expand All @@ -62,7 +62,7 @@ endif
@${COV_PROG} run --source=opentimelineio -m unittest discover tests

coverage-contrib: python-version
@make -C opentimelineio_contrib/adapters coverage VERBOSE=$(VERBOSE)
@make -C contrib/opentimelineio_contrib/adapters coverage VERBOSE=$(VERBOSE)

# run all the unit tests, stopping at the first failure
test_first_fail: python-version
Expand Down Expand Up @@ -100,10 +100,10 @@ endif
@python -m flake8

doc-model:
@python opentimelineio/console/autogen_serialized_datamodel.py --dryrun
@python src/py-opentimelineio/opentimelineio/console/autogen_serialized_datamodel.py --dryrun

doc-model-update:
@python opentimelineio/console/autogen_serialized_datamodel.py -o docs/tutorials/otio-serialized-schema.md
@python src/py-opentimelineio/opentimelineio/console/autogen_serialized_datamodel.py -o docs/tutorials/otio-serialized-schema.md

# generate documentation in html
doc-html:
Expand Down
35 changes: 35 additions & 0 deletions README.md
@@ -1,3 +1,5 @@
OpenTimelineIO
=======
[![OpenTimelineIO](docs/_static/OpenTimelineIO@3xDark.png)](http://opentimeline.io)
==============

Expand Down Expand Up @@ -69,6 +71,39 @@ You can install OpenTimelineIO via

For more details, including how to run the included viewer program, see: https://opentimelineio.readthedocs.io/en/latest/tutorials/quickstart.html

C++ Installation Instructions
-----------------------------

0. Get the source and deal with submodules:
+ git clone git@github.com:PixarAnimationStudios/OpenTimelineIO.git
+ cd otio
+ git checkout cxx
+ git submodule init
+ git submodule update

1. If you want to only build for C++ development (i.e. produce the OTIO C++ libraries and header files), then use cmake:
+ mkdir build
+ cd build
+ ccmake ..
(configure PYTHON_EXECUTABLE, PYTHON_LIBRARY, and CMAKE_INSTALL_PREFIX)
+ make install

2. If you wish to build only for use with Python, run one of the following two commands:
+ pip install .
+ python setup.py install

3. However, if you want to build for Python but you also want to install the OTIO C++ headers and libraries, then run one of the following two commands
+ pip install . --install-option=“--cxx-install-root=/home/someone/cxx-otio-root"
+ python setup.py install --cxx-install-root=/home/someone/cxx-otio-root

To compile a C++ file, add the following -I flags:
+ c++ -c source.cpp -I/home/someone/cxx-otio-root/include -I/home/someone/cxx-otio-root/include/opentimelineio/deps

To link, add the following -L/-l flags:
+ c++ ... -L/home/someone/cxx-otio-root/lib -lopentimelineio

(If you are using only opentime, not opentimelineio, use -lopentime. Also, you could leave out the second -I flag.)

Example Usage
-------

Expand Down
@@ -1,6 +1,5 @@
# Makefile for the contrib area

export PYTHONPATH:=../../
TEST_ARGS=
COV_PROG := $(shell command -v coverage 2> /dev/null)

Expand Down
Expand Up @@ -111,13 +111,15 @@ def _unique_tapemob(self, otio_clip):
timecode_fps=timecode_fps,
drop_frame=(edit_rate != timecode_fps)
)
timecode_start = (
otio_clip.media_reference.available_range.start_time.value)
timecode_length = (
otio_clip.media_reference.available_range.duration.value)
timecode_start = int(
otio_clip.media_reference.available_range.start_time.value
)
timecode_length = int(
otio_clip.media_reference.available_range.duration.value
)

tape_timecode_slot.segment.start = timecode_start
tape_timecode_slot.segment.length = timecode_length
tape_timecode_slot.segment.start = int(timecode_start)
tape_timecode_slot.segment.length = int(timecode_length)
self.aaf_file.content.mobs.append(tapemob)
self._unique_tapemobs[mob_id] = tapemob
return tapemob
Expand Down Expand Up @@ -340,7 +342,7 @@ def _transition_parameters(self):

def aaf_filler(self, otio_gap):
"""Convert an otio Gap into an aaf Filler"""
length = otio_gap.visible_range().duration.value
length = int(otio_gap.visible_range().duration.value)
filler = self.aaf_file.create.Filler(self.media_kind, length)
return filler

Expand All @@ -362,9 +364,11 @@ def aaf_sourceclip(self, otio_clip):

compmob_clip = self.compositionmob.create_source_clip(
slot_id=self.timeline_mobslot.slot_id,
start=start,
length=length,
media_kind=self.media_kind)
# XXX: Python3 requires these to be passed as explicit ints
start=int(start),
length=int(length),
media_kind=self.media_kind
)
compmob_clip.mob = mastermob
compmob_clip.slot = mastermob_slot
compmob_clip.slot_id = mastermob_slot.slot_id
Expand All @@ -373,7 +377,7 @@ def aaf_sourceclip(self, otio_clip):
def aaf_transition(self, otio_transition):
"""Convert an otio Transition into an aaf Transition"""
if (otio_transition.transition_type !=
otio.schema.transition.TransitionTypes.SMPTE_Dissolve):
otio.schema.TransitionTypes.SMPTE_Dissolve):
print(
"Unsupported transition type: {}".format(
otio_transition.transition_type))
Expand Down Expand Up @@ -428,7 +432,7 @@ def aaf_transition(self, otio_transition):
op_def["Description"].value = str(description)

# Create OperationGroup
length = otio_transition.duration().value
length = int(otio_transition.duration().value)
operation_group = self.aaf_file.create.OperationGroup(op_def, length)
operation_group["DataDefinition"].value = datadef
operation_group["Parameters"].append(varying_value)
Expand Down Expand Up @@ -492,7 +496,7 @@ def _create_tapemob(self, otio_clip):
"""
tapemob = self.root_file_transcriber._unique_tapemob(otio_clip)
tapemob_slot = tapemob.create_empty_slot(self.edit_rate, self.media_kind)
tapemob_slot.segment.length = (
tapemob_slot.segment.length = int(
otio_clip.media_reference.available_range.duration.value)
return tapemob, tapemob_slot

Expand Down Expand Up @@ -526,7 +530,7 @@ def _create_mastermob(self, otio_clip, filemob, filemob_slot):
Returns a tuple of (MasterMob, MasterMobSlot)
"""
mastermob = self.root_file_transcriber._unique_mastermob(otio_clip)
timecode_length = otio_clip.media_reference.available_range.duration.value
timecode_length = int(otio_clip.media_reference.available_range.duration.value)

try:
mastermob_slot = mastermob.slot_at(self._master_mob_slot_id)
Expand Down Expand Up @@ -648,7 +652,7 @@ def aaf_sourceclip(self, otio_clip):
"LinearInterp")
self.aaf_file.dictionary.register_def(interp_def)
# PointList
length = otio_clip.duration().value
length = int(otio_clip.duration().value)
c1 = self.aaf_file.create.ControlPoint()
c1["ControlPointSource"].value = 2
c1["Time"].value = aaf2.rational.AAFRational("0/{}".format(length))
Expand Down Expand Up @@ -683,7 +687,7 @@ def _create_timeline_mobslot(self):
opdef["NumberInputs"].value = 1
self.aaf_file.dictionary.register_def(opdef)
# OperationGroup
total_length = sum([t.duration().value for t in self.otio_track])
total_length = int(sum([t.duration().value for t in self.otio_track]))
opgroup = self.aaf_file.create.OperationGroup(opdef)
opgroup.media_kind = self.media_kind
opgroup.length = total_length
Expand All @@ -702,8 +706,9 @@ def default_descriptor(self, otio_clip):
descriptor["AudioSamplingRate"].value = 48000
descriptor["Channels"].value = 1
descriptor["SampleRate"].value = 48000
descriptor["Length"].value = (
otio_clip.media_reference.available_range.duration.value)
descriptor["Length"].value = int(
otio_clip.media_reference.available_range.duration.value
)
return descriptor

def _transition_parameters(self):
Expand Down