Code Monkey home page Code Monkey logo

cask's Introduction

-------------------------------------------------------------------------------
- Alembic
-
- Copyright 2009-2021 Sony Pictures Imageworks, Inc. and
- Industrial Light and Magic, a division of Lucasfilm Entertainment Company Ltd.
-------------------------------------------------------------------------------

Installation instructions for Alembic


0) Before Alembic can be built, you will need to satisfy its external
dependencies:

Required:

    CMake (3.13+) www.cmake.org
    C++ compiler that supports C++11
    Imath 3 https://github.com/AcademySoftwareFoundation/Imath
    OR
    OpenEXR (2.2.0+) www.openexr.com (for Imath)

Optional:

    HDF5 (1.8.9) www.hdfgroup.org/HDF5
    Boost (1.55+) www.boost.org (to build the python bindings)
    PyImath 3 https://github.com/AcademySoftwareFoundation/Imath (to build the python bindings)
    OR
    pyilmbase (1.0.0+) (to build the python bindings)
    Arnold (3.3+)
    Pixar PRMan (15.x)
    Autodesk Maya (2012+)

Note that the versions given parenthetically above are minimum-tested
versions.  You may have good luck with later or earlier versions, but this is
what we've been building Alembic against.

They may be installed in their default system locations (typically somewhere
under /usr/local), or some other centralized directory at your discretion; it's
best not to install your dependencies under the Alembic source root.


1) Clone the Alembic repo source into your desired source root:

    $ git clone https://github.com/alembic/alembic [<source root>]

This will create your source root directory that contains the Alembic source
code.


2) Run the cmake command. You should create a separate build root and pass the
source root to cmake:

    $ cd <build root>
    $ cmake  [OPTIONS] <source root>

Some examples of OPTIONS you may want or need to use include:

    -DALEMBIC_SHARED_LIBS=OFF  If you want the primary Alembic library to be
    built as a static library, instead of a dynamic one.

    -DUSE_HDF5=ON
    Specify this if you want to include optional HDF5 support.
    -DHDF_ROOT=HDF5Path may need to be specified if HDF5 is not installed in
    a standard location.

    -DUSE_MAYA=ON If you want to build AbcExport and AbcImport.
    -DMAYA_ROOT=MayaPath may need to be specified to point at a specific
    installation of Maya.

    -G "Visual Studio 15 2017 Win64"  If you want to create the project file for
    the 64 bit build of Alembic with the Visual Studio 2017 Community Edition.

    -DCMAKE_INSTALL_PREFIX=customPath  If you want to install the Alembic into
    an arbitrary location.

    -DUSE_PYALEMBIC=ON Whether you want to build the boost python bindings for Alembic.

    -DPYALEMBIC_PYTHON_MAJOR=2  If you want to look for python 2 (or python 3) via find_package.
    See the [CMake module documentation](https://cmake.org/cmake/help/latest/module/FindPython3.html).

    -DDOCS_PATH=customDocPath  If you have Doxygen installed this will create and install the doxygen
    generated doc (WIP) to customDocPath when you run: cmake doxygen

3)  To build: cmake -build .

4) To test: ctest
   Note:  On Windows you may need to add the path to your Alembic dlls.
   PATH=%PATH%;location of Alembic dlls (and OpenExr if not in a standard place)

If you get stuck, contact us on the alembic-discussion mailing list. You can
view the mailing list archives and join the mailing list:

http://groups.google.com/group/alembic-discussion

cask's People

Contributors

efthymisb avatar lamiller0 avatar narann avatar petershinners avatar rsgalloway avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cask's Issues

ReferenceError: weakly-referenced object no longer exists

Wrapping a cask object from a PyAlembic IObject without creating a cask.Archive first can cause reference errors, e.g.

>>> iarch = alembic.Abc.IArchive(filepath)
>>> iobj = iarch.getTop().children[0]
>>> obj = cask.Xform(iobj)
>>> obj.is_animated()
...
    return self.parent.time_sampling_id
ReferenceError: weakly-referenced object no longer exists

This is because cask walks to the top to get the time smapling information, and the iarchive doesn't exist, or is weakly referenced.

A temporary fix is to pass in the time sampling id when instantiation the object, e.g.

>>> obj = cask.Xform(iobj, time_sampling_id=2)

A better fix might be to instantiate the archive on demand, or create a strong reference to the archive, if possible. I'm labeling this as an enhancement because this is an unexpected workflow in cask, but it'd be good to support.

No "_sample_class" in cask.Points ?

Hello and thanks for cask.

I try to generate an abc file from scrach.

It’s supposed to represent a Root/particleShape node of type Points (with two points in my example).

import alembic
import cask
import imath

b = cask.Archive()
root = cask.Xform(name='Root')
root.parent = b.top

assert b.top.children['Root']

pts = cask.Points(name='particleShape')
pts.parent = root

assert root.children['particleShape']
assert b.top.children['Root/particleShape']

point_count = 2

id_array = imath.IntArray(point_count)
id_array[0] = 0
id_array[1] = 1

pos_array = imath.V3fArray(point_count)
pos_array[0] = imath.V3f(0.0, 0.0, 0.0)
pos_array[1] = imath.V3f(10.0, 0.0, 0.0)

# uncomment to fix
# cask.Points._sample_class = alembic.AbcGeom.OPointsSchemaSample

pts_sample = alembic.AbcGeom.OPointsSchemaSample()
pts_sample.setIds(id_array)
pts_sample.setPositions(pos_array)

pts.set_sample(pts_sample)

b.write_to_file("test.abc")

This code raise an assert :

Traceback (most recent call last):
  File "/code.py", line 138, in <module>
    pts.set_sample(pts_sample)
  File "/cask.py", line 1434, in set_sample
    "Can not set %s on %s object" % (sample.__class__.__name__, self.type())
AssertionError: Can not set OPointsSchemaSample on Points object

After some digging into cask code, I thing there is missing _sample_class property , from Points class : https://github.com/alembic/cask/blob/master/cask.py#L1684

Maybe it’s a bug, maybe there is good reason for this (don’t hesitate to justified in tho Points class docstring).

Adding the property (uncomment the line) seems to work. I say seems as abcls prints the same output between my fresh abc and my reference one.

What are you thought about this ?

Thanks in advance !

Add arbGeomParams to newly created object

Hi,

I'm trying to add properties under .geom/.arbGeomParams on an Archive i create from scratch, but it seems that my properties do not get saved. Also, if i query the properties of my object I get an empty list.

Is this supported at all ?

Thanks !

Where is issue #23?

I am having a problem that issue #23 should resolve: not preserving properties. This error is occurring in cask version 1.0.2. I would like to know if the version I am on has the fix for issue #23. I didn't see any info on this issue, so logging to confirm.

Thanks!

Python 3 support

I have been able to compile PyAlembic for Python 3.7 on Linux and have a Python 3.7 testing environment.

We are slowly moving our tools to Python 3 and one of them use alembic/cask to generate Alembic file from scratch.

My proposition is that I do it myself and submit a PR. The plan is that cask would be Python 2/3 compatible. I will try to rely on builtins:

from __future__ import (absolute_import,
                        division,
                        print_function,
                        unicode_literals)

And nothing more do don't add new dependencies (no six or future).

Is there any interest in this? Are you already working on it?

Thanks in advance!

merge two abc material files

i've been trying to use cask to merge two alembic files that contain only materials in.

def run(fileA, fileB, fileOut):
	a = cask.Archive(fileA)
	b = cask.Archive(fileB)
	
	o = cask.Archive()
	o.top.children["materials"] = cask.Material()

	for i in a.top.children['materials'].children:
		o.top.children['materials'].children[i] = a.top.children['materials'].children[i]

	for i in b.top.children['materials'].children:
		o.top.children['materials'].children[i] = b.top.children['materials'].children[i]

	o.write_to_file(fileOut)

when executing this, it errors with:

Error setting value on .terminals: <imath.StringArray object at 0x23143d0> <class 'alembic.Abc.OArrayProperty'>
No registered converter was able to produce a C++ rvalue of type std::tr1::shared_ptr<Alembic::Abc::v7::TypedArraySampleAlembic::Abc::v7::StringTPTraits > from this Python object of type StringArray
Error setting value on aov_names: <imath.StringArray object at 0x2393ec0> <class 'alembic.Abc.OArrayProperty'>
No registered converter was able to produce a C++ rvalue of type std::tr1::shared_ptr<Alembic::Abc::v7::TypedArraySampleAlembic::Abc::v7::StringTPTraits > from this Python object of type StringArray
Error setting value on .connections: <imath.StringArray object at 0x2390130> <class 'alembic.Abc.OArrayProperty'>
No registered converter was able to produce a C++ rvalue of type std::tr1::shared_ptr<Alembic::Abc::v7::TypedArraySampleAlembic::Abc::v7::StringTPTraits > from this Python object of type StringArray
Error setting value on .interface: <imath.StringArray object at 0x2390130> <class 'alembic.Abc.OArrayProperty'>
No registered converter was able to produce a C++ rvalue of type std::tr1::shared_ptr<Alembic::Abc::v7::TypedArraySampleAlembic::Abc::v7::StringTPTraits > from this Python object of type StringArray
Error setting value on .terminals: <imath.StringArray object at 0x2390130> <class 'alembic.Abc.OArrayProperty'>
No registered converter was able to produce a C++ rvalue of type std::tr1::shared_ptr<Alembic::Abc::v7::TypedArraySampleAlembic::Abc::v7::StringTPTraits > from this Python object of type StringArray
Error setting value on aov_names: <imath.StringArray object at 0x2398d00> <class 'alembic.Abc.OArrayProperty'>
No registered converter was able to produce a C++ rvalue of type std::tr1::shared_ptr<Alembic::Abc::v7::TypedArraySampleAlembic::Abc::v7::StringTPTraits > from this Python object of type StringArray
Error setting value on .connections: <imath.StringArray object at 0x2398f30> <class 'alembic.Abc.OArrayProperty'>
No registered converter was able to produce a C++ rvalue of type std::tr1::shared_ptr<Alembic::Abc::v7::TypedArraySampleAlembic::Abc::v7::StringTPTraits > from this Python object of type StringArray
Error setting value on .interface: <imath.StringArray object at 0x7f596a88c280> <class 'alembic.Abc.OArrayProperty'>
No registered converter was able to produce a C++ rvalue of type std::tr1::shared_ptr<Alembic::Abc::v7::TypedArraySampleAlembic::Abc::v7::StringTPTraits > from this Python object of type StringArray

further down the line, when i try to use the merged file, arnold errors with:

Invalid sample index: -1, should be between 0 and 4294967295

im using alembic 1.5.8 and the default branch of cask.

any ideas how i can resolve these errors?

many thanks,

elliott

get_value() by frame has integer div truncation

We're (me and @mdecaria) playing round with cask at the office right now, and I noticed what looks like an edge case in get_sample, which seems to be from __get_sample_index under the hood.

Basically, the default Archive constructor sets an fps of (int) 24 which is used as the divisor in __get_sample_index, so the getNearIndex call will be fed steppy numbers from the integer division.

Not sure if it's just us or the function is working as intended (the simple fix was to set the archive fps to 24.0) so I've thrown in a bit of a trivial PR for it since it looks like the rest of functions that rely on archive.fps have a float wrapper

Making an Archive from scratch makes invalid Alembic files that crash Maya and abcecho

Hi again !

Here's an example :
`
import cask

arch = cask.Archive(fps=24)
arch.set_start_frame(14)

arch.write_to_file("D:/TestTS.abc")

saved = cask.Archive("D:/TestTS.abc")
print saved.start_frame()
print saved.end_frame()
`

Running this, in my case, makes and Archive that starts at frame 14, but ends at frame 13. The archive is invalid, it will crash Maya and AbcEcho. Any ideas ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.