re-arrange modules, preparing for python-package-index

This commit is contained in:
2014-12-19 00:28:47 +01:00
parent 54ef179788
commit 871600312c
31 changed files with 37 additions and 332 deletions

276
doc/source/conf.py Normal file
View File

@@ -0,0 +1,276 @@
# -*- coding: utf-8 -*-
#
# BAM - Blender Asset Manager documentation build configuration file, created by
# sphinx-quickstart on Thu Oct 16 16:24:43 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys
import os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.todo',
]
if 1:
extensions += ['sphinxarg.ext']
sys.path.extend([
# to import 'bam.py'
os.path.join(os.path.dirname(__file__), "..", ".."),
# to access the 'sphinxarg' extension
os.path.abspath(os.path.join("..", "exts"))
])
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix of source filenames.
source_suffix = '.rst'
# The encoding of source files.
#source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = u'BAM - Blender Asset Manager'
copyright = u'2014, Blender Institute'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.0.1'
# The full version, including alpha/beta/rc tags.
release = '0.0.1 alpha'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = []
# The reST default role (used for this markup: `text`) to use for all
# documents.
#default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
# If true, keep warnings as "system message" paragraphs in the built documents.
#keep_warnings = False
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
try:
import sphinx_rtd_theme
except ImportError:
sphinx_rtd_theme = None
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}
if sphinx_rtd_theme:
html_theme = 'sphinx_rtd_theme'
# Add any paths that contain custom themes here, relative to this directory.
if sphinx_rtd_theme:
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
#html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#html_logo = None
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#html_favicon = None
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = []
# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
# directly to the root of the documentation.
#html_extra_path = []
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
#html_last_updated_fmt = '%b %d, %Y'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}
# If false, no module index is generated.
#html_domain_indices = True
# If false, no index is generated.
#html_use_index = True
# If true, the index is split into individual pages for each letter.
#html_split_index = False
# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
html_show_copyright = False
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = None
# Output file base name for HTML help builder.
htmlhelp_basename = 'BAM-BlenderAssetManagerdoc'
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#'preamble': '',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
('index', 'BAM-BlenderAssetManager.tex', u'BAM - Blender Asset Manager Documentation',
u'Blender Institute', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False
# If true, show page references after internal links.
#latex_show_pagerefs = False
# If true, show URL addresses after external links.
#latex_show_urls = False
# Documents to append as an appendix to all manuals.
#latex_appendices = []
# If false, no module index is generated.
#latex_domain_indices = True
# -- Options for manual page output ---------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'bam-blenderassetmanager', u'BAM - Blender Asset Manager Documentation',
[u'Blender Institute'], 1)
]
# If true, show URL addresses after external links.
#man_show_urls = False
# -- Options for Texinfo output -------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'BAM-BlenderAssetManager', u'BAM - Blender Asset Manager Documentation',
u'Blender Institute', 'BAM-BlenderAssetManager', 'One line description of project.',
'Miscellaneous'),
]
# Documents to append as an appendix to all manuals.
#texinfo_appendices = []
# If false, no module index is generated.
#texinfo_domain_indices = True
# How to display URL addresses: 'footnote', 'no', or 'inline'.
#texinfo_show_urls = 'footnote'
# If true, do not generate a @detailmenu in the "Top" node's menu.
#texinfo_no_detailmenu = False

View File

@@ -0,0 +1,62 @@
############
Milestones
############
Minimum Viable Product
======================
Get existing project migrated to asset manager as soon as possible.
- No Client-side-SVN.
- Checkout/Commit assets.
- Basic UI.
- ZIP file access (as an example, users wouldn't have to notice)
- Testing (basic testing framework)
Performance
===========
- Parallel downloads
- Cache (avoid re-downloading files)
Interface
=========
- BAM project definition.
- Blender Addon (UI for performing basic actions)
- *Maybe* extend GUI client.
- Web UI
- Download Zipfiles
Scaling/Project
===============
- Consistency checks (correct library linking)
Basic Automated Tasks
=====================
- Generated Previews (basic automated tasks hooked up to asset manager)
- Baking (physics)
- Web UI (create/view/manage jobs)
Story Tool
==========
- Establish connection between sequencer and 'shot' assets *(abstract concept)*
- Integrate into Addon
- Connect automated tasks on edit updates, (sync sequence with shot assets)
- Expose the edit outside of Blender *(web based UI, reviews, comment, feedback, tasks...)*
Project Management
==================
- Web UI
- Connect basic communication tools to assets, commits.

View File

@@ -0,0 +1,262 @@
##########
Pipeline
##########
**The Story Tool**
*This is the over arching goal of the project.*
- Asset Management *Manage Files & Content*
- Project Management *Manage People & Tasks*
- Automated Tasks *Manage Geneated Content*
.. note::
Design Goals
...this is a tool, not a framework,
for anyone making animation(s) with Blender.
- Handle multiple projects.
- Foresee use of other tools (as well as Blender), in the work-flow.
- Support multi-site/distributed work-flow.
- Support **some** of the functionality in the Blender-Cloud.
- Design to **allow** for swappable modular components, even if we end up sticking with single technologies.
Asset Managment
===============
- Assets <-> Users
- Revisions
- Variations
Architecture Overview
---------------------
Server
^^^^^^
- File asset
- Tools (blend file packer, evaluate sequencer, visualize deps, automated tasks ...)
- Public API (web service), *communicates with client.*
Client
^^^^^^
- Interface GUI/CLI (Blender/Web-UI also)
- Tools (manage files on the client, cache.)
- Local files (models, images)
User Stories
------------
Layout Artist
^^^^^^^^^^^^^
Mathieu has to update the camera motion in an existing shot in layout stage.
Since he's in the middle of the project, he loads Blender and accesses the 'Recent Projects Menu'
Which shows an interface to open the file he's looking for.
In this case someone modified a prop, giving the message "Shader changed, by Pablo".
Which he updates because it only takes a few seconds.
Now he's able to edit the camera and save his work (exit Blender, reopen...etc)
When he's happy with the changes he opens the file menu **File -> BAM -> Commit Changes**
This prompts him with a dialog showing a list of the changed files.
He enters a commit message explaining the change and presses **Commit**.
a progress bar appears while the data is being uploaded.
He finally receives confirmation that the commit uploaded correctly.
Animator
^^^^^^^^
Hjalti opens the project management web site and finds he's been assigned a new shot to animate.
He opens Blender and selects **File -> BAM -> Load**,
this prompts him with a browser which he uses to locate the shot,
which he can easily identify by the name: ``shot_012_anim.blend``
He confirms the action, which shows a download progress bar which immediately loads the file in Blender.
He is presented with a low poly scene containing rigs with the characters in the shot and the props they interact with.
as well as a low resolution version of the environment.
He can work on the animation, and modify the file, and commit... *as Mathieu did*
Editor
^^^^^^
Mathieu is going through his daily review of the edit in Blender,
He opens the edit blend **File -> BAM -> Recent Files -> Edit**,
This shows the sequencer view with each shot as a strip,
He can add a new shot into the edit **Sequencer Header -> Add -> BAM Shot**
.. note::
exactly how this is done is yet to be decieded,
however the shots will be created and managed on the server (likely via a web-ui)
A popup will appear with a list of shots which can be selected to add.
At this point the sequencer can be used as usual,
**However** the clip in the sequencer is now **the** reference for length/timing of the shot,
its values are propagated to the server (*once committed*).
Implementation Details
----------------------
This document describes the layout for Blender pipeline.
Overview
^^^^^^^^
- Use SVN for internal storage.
- SVN repository is for internal storage (but keep usable as *last resort*)
- Support extracting single ``.blend`` file, and committing it back (without a full checkout),
useful for remote artists.
SVN Commit Abstraction
^^^^^^^^^^^^^^^^^^^^^^
Motivation:
Artists need to be able to work on jobs without downloading entire repository.
Workflow:
- Select an asset to *checkout* (Likely via a web-ui/blender-ui).
- Download the asset and its dependencies (web/cli/blender-ui).
- Modify data locally (images, 3d... text... etc).
- Submit task back with commit log (blender-ui/cli/web?).
(Server handles commit).
Technical details:
- Server handles SVN integration which is hidden from the client.
- The job submission and editing workflow is handled by client/server,
Server creates binary blobs for the bundles,
client handles download and create a usable directory for editing.
- Path remapping of ``.blend`` files must be handled
(in both directions, likely using ``blendfile.py``).
- Use cache on client to avoid re-downloading the same resources.
Components
----------
Client
^^^^^^
- UI (list + checkout (remote assets), edit + commit (local assets))
- CLI (command line tool for low level access, scripts TD can use... etc)
- Blender/Integrated UI
- Web-UI (browse assets, limited access).
- Tools
- browse remote repo
- downloader (simple zip)
- checkout/commit workflow (check what to download, commit whats changed, manage cache internally avoid re-download)
- Data
- Files/Assets (blend files, textures)
- Cache (physics assets which can be regenerated on the server)
Server
^^^^^^
- Write blend file extractor / packager.
- Write online SVN browser.
- ... TODO
Project Management
==================
Use phabricator! DONE :D
Automated Tasks
===============
Components
----------
There are 2 types of tasks to be automated.
* User submitted tasks.
* Tasks generated by events such as commit hooks, finished rendering... etc.
Automated tasks are broken into 3 steps.
* Creation (API/CLI/GUI)
* Scheduling/queueing (Managed by the server)
* Execution/job management (Controlled via the server, though API's & UI's)
User Stories
------------
Heres a list of tasks we would expect the system to support
- Generating Renderfarm Preview
- Low resolution textures for animation
- High Resolution Simulation (hair, smoke)
- Final Render a Scene
- OpenGL Preview Every Shot
- Bundle a Blend file into a ZIP
- Synchronizing Data (SVN/Database... repositories... backups)
- Consistency checks (automated tasks to validate the state of the project)
- Blend file hygiene/lint (unused datablocks, images not used anywhere)
- Building Blender
Implementation
--------------
We plan to develop a very simple system leveraging existing technologies.
Dashboard
^^^^^^^^^
UI (web based), allows manual creation of tasks.
Server
^^^^^^
Backend connected to database and scheduler, managing & assigning jobs to workers.
Worker
^^^^^^
Simple client, exposes control of the machine via an API.

22
doc/source/index.rst Normal file
View File

@@ -0,0 +1,22 @@
BAM - Blender Asset Manager's documentation
===========================================
Contents:
.. toctree::
:maxdepth: 2
manual/index.rst
reference/index.rst
install/index.rst
design/planning.rst
design/milestones.rst
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

View File

@@ -0,0 +1,29 @@
Installation and requirements
#############################
How to get the system up and running.
Webservice
==========
The web-service is a simple web app based on the Flask framework, plus a few extensions.
In order to get it up and running.
- Create a virtual environment
- Activate the virtual environment
- Install dependencies with ``pip3 install -r requirements.txt``
- Run the service
To learn about the web-service usage, check out the proper (non existing) section.
Client
======
In order to use the `bam` command in your terminal, you can add this file in any of
your BIN paths and call it `bam`. Don't forget to give it +x permissions. ::
#!/bin/sh
exec python /absolute/path/to/bam/client/cli/bam.py "$@"
As you can see, the file links to your bam.py file, so make sure that one is right!

101
doc/source/manual/index.rst Normal file
View File

@@ -0,0 +1,101 @@
User manual
###########
Using BAM is easy and fun! Provided that:
- you know how to use the command line of your os
- have some experience of how versioning systems work
Actually, this is not true, and in this guide we will explain to use BAM client from scracth.
.. hint:: Do not try to follow this page as a step-by-step tutorial, since its content might
be not completely coherent. The purpose of this manual is simply to explain the bam
workflow from the artist point of view.
Project Initialization
======================
In order to start working, we need to initialize a *project folder*. This operation should
be done only once. To create a project folder we need to open our terminal, and go to the
location where we want to store the project folder. Then we can type::
bam init http://bam:5000/gooseberry
This command creates a ``gooseberry`` folder, containing information about the project. If
we enter the folder and use the ``ls`` comand command, we notice that it is empty, but if
we use the ``bam ls`` command we see a directory listing. This listing is provided by the
project server on the fly and it allows us to browse its content without having a local copy
on our machine.
The project folder can be moved anywhere, at any time. The exact ``bam init`` syntax is
available in the reference section.
Session creation
================
Once the project has been initialized and we are able to browse it remotely, we can proceed
checking out a file from it. For example we can type::
bam co libs/envs/jungle/jungle_opening.blend
This creates a ``jungle_opening`` folder inside of our ``gooseberry`` project folder, which
will contain the ``jungle_opening.blend``, along with all its dependencies (library files,
textures, etc.) organized as follows. ::
jungle_opening.blend
relative/maps/path/map.png
_absolute/maps/path/map.png
As we can see, folders starting with the ``_`` character map to an absolute path on the server,
while the other folders are relative to the file that was used to create the session.
Editing
=======
At this point we can edit any file in the session, and the system will keep track of our changes.
Currently we can:
- add new files to the session
- delete files
- edit files
We can not:
- rename files
In order to check what is the status of our edits, we can use ``bam st``, which will print a list
of edited, added and deleted files.
.. note:: Sessions are meant to create a contained and controlled working environment. We should
never, ever refer to content that is outside of a session folder.
Committing changes
==================
Once we are happy with the changes we made to the session, we can sent id back to the server, which
will take care of versioning and merging it back into the project.
To commit a change, simply type::
bam ci -m 'Updated trees'
If you are outside the session folder, you have to specify it::
bam ci jungle_opening -m 'Updated trees'
After committing, we can keep working in the same session, and do further commits.
Updatding and existing session
==============================
It is possible to update and existing session by running::
bam update
Make sure you have committed your files before updating.

View File

@@ -0,0 +1,9 @@
Client Reference
################
Here is a reference of all the BAM cli commands.
.. argparse::
:module: bam.cli
:func: create_argparse
:prog: bam