Skip to content

Commit

Permalink
Rename main module from tiltbrush to openbrush
Browse files Browse the repository at this point in the history
  • Loading branch information
andybak committed Jul 14, 2024
1 parent a931603 commit ca10550
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ This code was previously part of the Tilt Brush Toolkit and was originally writt
Python 3.9 code and scripts for advanced Open Brush data manipulation.

* `bin` - command-line tools
* `dump_tilt.py` - Sample code that uses the tiltbrush.tilt module to view raw Open Brush data.
* `dump_tilt.py` - Sample code that uses the openbrush.tilt module to view raw Open Brush data.
* `geometry_json_to_fbx.py` - Sample code that shows how to postprocess the raw per-stroke geometry in various ways that might be needed for more-sophisticated workflows involving DCC tools and raytracers. This variant packages the result as a .fbx file.
* `geometry_json_to_obj.py` - Sample code that shows how to postprocess the raw per-stroke geometry in various ways that might be needed for more-sophisticated workflows involving DCC tools and raytracers. This variant packages the result as a .obj file.
* `tilt_to_strokes_dae.py` - Converts .tilt files to a Collada .dae containing spline data.
* `unpack_tilt.py` - Converts .tilt files from packed format (zip) to unpacked format (directory) and vice versa, optionally applying compression.
* `Python` - Put this in your `PYTHONPATH`
* `tiltbrush` - Python package for manipulating Open Brush data.
* `openbrush` - Python package for manipulating Open Brush data.
* `export.py` - Parse the legacy .json export format. This format contains the raw per-stroke geometry in a form intended to be easy to postprocess.
* `tilt.py` - Read and write .tilt files. This format contains no geometry, but does contain timestamps, pressure, controller position and orientation, metadata, and so on -- everything Open Brush needs to regenerate the geometry.
* `unpack.py` - Convert .tilt files from packed format to unpacked format and vice versa.
4 changes: 2 additions & 2 deletions bin/analyze_tilt.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import sys
from pprint import pprint

import tiltbrush.tilt
import openbrush.tilt

if __name__ == '__main__':
path = " ".join(sys.argv[1:])
try:
tilt = tiltbrush.tilt.Tilt(path)
tilt = openbrush.tilt.Tilt(path)
pprint(tilt.metadata['CameraPaths'])
except Exception as e:
print("ERROR: %s" % e)
6 changes: 3 additions & 3 deletions bin/dump_tilt.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

"""This is sample Python 2.7 code that uses the tiltbrush.tilt module
"""This is sample Python 2.7 code that uses the openbrush.tilt module
to view raw Tilt Brush data."""

import os
Expand All @@ -24,15 +24,15 @@
try:
sys.path.append(os.path.join(os.path.dirname(os.path.dirname(
os.path.abspath(__file__))), 'Python'))
from tiltbrush.tilt import Tilt
from openbrush.tilt import Tilt
except ImportError:
print("Please put the 'Python' directory in your PYTHONPATH", file=sys.stderr)
sys.exit(1)


def dump_sketch(sketch):
"""Prints out some rough information about the strokes.
Pass a tiltbrush.tilt.Sketch instance."""
Pass a openbrush.tilt.Sketch instance."""
cooky, version, unused = sketch.header[0:3]
print('Cooky:0x%08x Version:%s Unused:%s Extra:(%d bytes)' % (
cooky, version, unused, len(sketch.additional_header)))
Expand Down
2 changes: 1 addition & 1 deletion bin/geometry_json_to_fbx.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
try:
sys.path.append(os.path.join(os.path.dirname(os.path.dirname(
os.path.abspath(__file__))), 'Python'))
from tiltbrush.export import iter_meshes, TiltBrushMesh, SINGLE_SIDED_FLAT_BRUSH
from openbrush.export import iter_meshes, TiltBrushMesh, SINGLE_SIDED_FLAT_BRUSH
except ImportError:
print("Please put the 'Python' directory in your PYTHONPATH", file=sys.stderr)
sys.exit(1)
Expand Down
2 changes: 1 addition & 1 deletion bin/geometry_json_to_obj.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
try:
sys.path.append(os.path.join(os.path.dirname(os.path.dirname(
os.path.abspath(__file__))), 'Python'))
from tiltbrush.export import iter_meshes, TiltBrushMesh, SINGLE_SIDED_FLAT_BRUSH
from openbrush.export import iter_meshes, TiltBrushMesh, SINGLE_SIDED_FLAT_BRUSH
except ImportError:
print("Please put the 'Python' directory in your PYTHONPATH", file=sys.stderr)
sys.exit(1)
Expand Down
4 changes: 2 additions & 2 deletions bin/normalize_sketch.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

"""This is sample Python 2.7 code that uses the tiltbrush.tilt module
"""This is sample Python 2.7 code that uses the openbrush.tilt module
to scale, rotate, and translate the sketch so that the resetting the
transform will bring you back to the initial size, orientation, and
position. But the environment size, orientation, and position will also
Expand All @@ -27,7 +27,7 @@
try:
sys.path.append(os.path.join(os.path.dirname(os.path.dirname(
os.path.abspath(__file__))), 'Python'))
from tiltbrush.tilt import Tilt
from openbrush.tilt import Tilt
except ImportError:
print("Please put the 'Python' directory in your PYTHONPATH", file=sys.stderr)
sys.exit(1)
Expand Down
2 changes: 1 addition & 1 deletion bin/tilt_to_strokes_dae.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
try:
sys.path.append(os.path.join(os.path.dirname(os.path.dirname(
os.path.abspath(__file__))), 'Python'))
from tiltbrush.tilt import Tilt
from openbrush.tilt import Tilt
except ImportError:
print("Please put the 'Python' directory in your PYTHONPATH", file=sys.stderr)
sys.exit(1)
Expand Down
10 changes: 5 additions & 5 deletions bin/unpack_tilt.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@
try:
sys.path.append(os.path.join(os.path.dirname(os.path.dirname(
os.path.abspath(__file__))), 'Python'))
import tiltbrush.unpack
import openbrush.unpack
except ImportError:
print("Please put the 'Python' directory in your PYTHONPATH", file=sys.stderr)
sys.exit(1)


def convert(in_name, compress):
if os.path.isdir(in_name):
tiltbrush.unpack.convert_dir_to_zip(in_name, compress)
openbrush.unpack.convert_dir_to_zip(in_name, compress)
print("Converted %s to zip format" % in_name)
elif os.path.isfile(in_name):
tiltbrush.unpack.convert_zip_to_dir(in_name)
openbrush.unpack.convert_zip_to_dir(in_name)
print("Converted %s to directory format" % in_name)
else:
raise tiltbrush.unpack.ConversionError("%s doesn't exist" % in_name)
raise openbrush.unpack.ConversionError("%s doesn't exist" % in_name)


def main():
Expand All @@ -49,7 +49,7 @@ def main():
for arg in args.files:
try:
convert(arg, args.compress)
except tiltbrush.unpack.ConversionError as e:
except openbrush.unpack.ConversionError as e:
print("ERROR: %s" % e)


Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tiltbrush/tilt.py → openbrush/tilt.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def as_directory(tilt_file):
if os.path.isdir(tilt_file):
yield Tilt(tilt_file)
else:
import tiltbrush.unpack as unpack
import openbrush.unpack as unpack
compressed = unpack.convert_zip_to_dir(tilt_file)
try:
yield Tilt(tilt_file)
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/test_tilt.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import shutil
import unittest

from tiltbrush.tilt import Tilt
from openbrush.tilt import Tilt


@contextlib.contextmanager
Expand Down

0 comments on commit ca10550

Please sign in to comment.