This document aims to be a guide on creating new or authoring existing import patterns.
Import patterns are just normal canvas graphs which return specific data types. An Import Pattern represents a programmatic pipeline for importing / creating 3D data in supported target applications. Instead of compensating for incomplete / insufficient data pipelines with manual authoring in the target application Import Patterns provide a smart way of improving the pipeline constantly to be able to deal with the source data in a more efficient and complete way.
The relevant data types for import patterns are:
Import Patterns are also allowed to return arrays of the above data types. The data types are implemented in the GenericImporter extension, which ships with Fabric Engine since version 2.3.1.
Aside from the obvious "Import some data" Import Patterns can also be used to:
Most import patterns start by importing a source asset. The factory nodes for this purpose can be found under Fabric -> Compounds -> IO -> Importer -> File Formats. Third party extensions (such as the OpenNurbs extension for example) might provide the loader nodes in a different folder. In the case of OpenNurbs the loader node can be found under ThirdParty -> OpenNurbsImporter -> OpenNurbs.
When working on an import pattern it is critical to be able to see what you are doing. For this you can use the drawing nodes which ship with the import patterns extensions. These nodes can be found under Fabric -> Compounds -> IO -> Importer -> Drawing. For most cases you will want to rely on the DrawTraversed node, which is a higher level node that wraps the DrawObjects node.
The DrawTraversed node has a series of features including
Data sets often come with clutter - construction elements or simply unwanted objects. The Filtering nodes for import patterns used Fabric Engine's Blocks feature. This allows you to focus on one element at a time. The base filter node can be found under Fabric -> Compounds -> IO -> Importer -> Filters -> Filter. Based on the default Filter node we also provide a couple pre-canned filter nodes which you can use to filter based on the most common scenarios: Filter by type or path. Using the block on the default Filter node you can implement your very own filtering logic. To make something up: Filter by the original metadata storing the vendor's product name...
Below we see a custom filter based on the name of the object:
Aside from just filtering out elements you can also use import patterns to actively modify elements. You do this by setting properties on elements - changing properties changes the content of an object. For this you can use the Fabric -> Compounds -> IO -> Importer -> Properties -> SetProperty node. Of course you can use all of the getter nodes in that same category to first retrieve a value and then modify it. With this you can for example:
Since the Set Property node is polymorphic we'll list here all of the properties you can modify for each specific element. You can also find the properties by looking at the KL source code in the GenericImporter extension. Each specialized ImporterObject adds its very own properties. Note also that you can add custom properties as well. Integrations consuming the results of an import pattern (the Fabric for Maya plugin, for example) might, however, ignore these custom properties.
All elements (ImporterObject)
Elements with transforms (ImporterTransform)
The Fabric -> Compounds -> IO -> Importer -> Blocks -> Modify can be used as a basis for any higher level node that modifies a data set.
The image below shows a modify node changing the transform of each shape by scaling it down:
The image below shows a node setting the collisionEnabled Boolean property, which will be interpreted by Unity and Unreal to drive the collision settings.
In the Fabric -> Compounds -> IO -> Importer -> Shapes category you can find the AssignMaterials node. The block inside of the node is used to assign a new material to all of the given shapes in the provided element array. The Fabric -> Compounds -> IO -> Importer -> Importer -> getOrCreatePbsMaterial node can come in handy here. The settings for the physically based shader are used both for Unreal and Unity. This way you can quickly assign materials programmatically which are then reflected well in the target real-time environments.
The image below shows setting up a new material by picking a random color. This can be useful especially when working on geometry decimation / merging.
The Fabric -> Compounds -> IO -> Importer -> Shapes -> MergeShapes node can be used to combine multiple shapes. Currently this only supports shapes of type PolygonMesh. To use this node you need to define a key for each element inside of the node's block. The key is used to idenfity the group the shape belongs to. Then all shapes within the same group are merged / combined. So for example:
This open approach empowers you to implement the type of merge features you need for your project. See the factory OpenNurbs import pattern for an example.
The image below shows a merge setup where the first five characters of the name are used to define the group. The groups are colored.
The nodes inside of Fabric -> Compounds -> IO -> Importer -> MetaData allow you to interact with metadata which might be stored on each element. MetaData doesn't follow a schema, so it might exist or not - depending on the source file. You can however also set metadata to inform the target application or your own process about certain characteristics of an element, for example. Most of the importers will provide specific information, such as the source file's unique identifier per element as metadata.
The image below shows a modify node getting, reporting and setting a specific metadata value, in this case the original name of the material coming from OpenNurbs.
The node Fabric -> Compounds -> IO -> Importer -> Blocks -> Traverse can be used to traverse an element array. Traversing means unfolding of hierarchies and creating all of the leaf elements. There are only a few scenarios where this might be needed:
The Traverse node will create an element for all unfolded hierarchies. So, for example, if an ImporterInstance is referencing a ImporterShape master and we have 4 of these instances we might just have 5 elements (the shape + 4 instances). If you wanted to change the transform on each of 4 resulting cubes you will need to traverse the element array first. After the traverser has run you will result in 9 elements (the cube, 4 instances + 4 instanced cubes). Note that the system is smart about not duplicating heavy data such as the geometry, for example. Only the hierarchical MetaData containers are duplicated.
The DrawTraversed node mentioned in the Drawing Elements section above has the Traverse node built-in. It has a boolean toggle to enable or disable it. Feel free to experiment with the traverser that way and see its effects.
Aside from just modifying existing elements the import patterns can also create completely new content. Check the following nodes under Fabric -> Compounds -> IO -> Importer -> Importer, namely getOrCreateObject and getOrCreateObjectArray to accomplish this. There are also some convenience nodes for the specific element types, such as getOrCreateLight, getOrCreateCamera etc.
You can create new elements, and then modify their properties as you do with any other element. This can be particularly interesting to create instances of elements procedurally.
Note that the methods used for these nodes are also available in KL. Please see the documentation and the source code of the GenericImporter extension for this.
The image below shows instancing a mesh coming from an alembic source file 10 times.
Animation is represented as a specific type when building an import pattern. You can use the Fabric -> Compounds -> IO -> Importer -> Animation -> createSequence node for this. The resulting ImporterAnimationSequence can be piped to the output of the graph. Animation sequences contain all of the values for a changing property over time and are imported as native animation clips in the supported environments, such as Unity and Unreal. The most simple case to create an animation sequence is to pipe the results of an animated alembic file into a createSequence node. The transform and camera animation of the elements will become animation tracks in the target application.
The image below shows a very simple setup of driving an animation sequence with all of the content of an alembic source file.
Hello guys, it's me again trying to do machine learning with motion capture data in FE. I have created a Neural Network object so I can simulate networks directly in FE. The learning phase is still done off-line, outside Fabric.
I think this is an improvement over my existing pipeline because I can see results in real-time and also because I have more tools to manipulate/use/mix data.
I have created 2 videos. In the first video I do a brief overview of the applications of such extension. In the second video I show how one can actually setup up a network and bring learned parameters, in this case, from MATLAB. Of course you can bring learned parameters from anywhere (OpenNN, OpenCV, and so on) so long as you store them in the CSV format.
We’re delighted to introduce Fabric Engine 2.4. The headline features for this release are:
Our own Eric Mootz has put together this video tour of Fabric 2.4:
Kraken is now included by default with Fabric 2.4. Kraken is an Open Source character rigging solution for Fabric Engine that allows you to use and define rigs and solvers that produce identical results across different animation applications.
Some advantages to using Kraken include:
A Kraken solver running in Canvas
One of the more significant features of Kraken is the quick Biped workflow. We have fleshed out our built-in biped rig components and now have menu items to quickly create pre-built Biped guides and generate rigs from those guides too.
Kraken biped rig running inside Maya
Namespaces are now supported in Fabric Engine, helping to organize naming in large Fabric implementations. KL Namespaces work in the expected manner: providing the ability to avoid collisions of names in extensions by limiting their scope.
Curves are now natively supported in Fabric Engine, avoiding the need to write your own code to create and use various curve types and shapes.
Using curves to procedurally generate a pattern
Curves can be defined as NURBS up to degree 7 (open and closed) but will likely most commonly be used as linear, cubic or Beziers. Alembic and Maya Curves are properly handled. Curves can be drawn in the viewport (with curvature, normal and tangent attribute support) and several utility methods are provided to set curve length or get by percentage.
Using Canvas to generate grass with curves
There are samples showcasing curves for Canvas standalone and for Fabric for Maya in the release.
We have optimized how fast Fabric Engine runs inside Maya. In general cases we have seen a speedup of 6x to 8x for most Canvas Maya nodes (we added a single entry point in the Core API for all argument conversions and now use direct memory access instead of traversing the data members).
We have also added a new node - 'FabricConstraint' - which combines in one node the position, orientation, scale and parent constraint functionality available in Maya. This gives a signficant peformance improvement versus the generic node. For advanced users we added ‘CanvasFuncNode’ and ‘CanvasFuncDeformer’ nodes which are the equivalent of the regular CanvasNode and CanvasDeformer but faster (they only expose a KL Function editor instead of a graph).
We have also added useful features like the Text extension. Now you can draw text values in screen space to add on-screen information to your graph's output. You can also use this feature to display information in 3D space, using the attributes of a Geometry such as the vertex positions of a mesh or a curve. This is a key information when creating more complex graphs and it really helps to visualize abstract data directly in the viewport. Check the samples available in the Samples/Canvas/InlineDrawing folder.
We continue to make improvements to our UI and workflows. In this release, we have cleaned up and polished the user interface, unifying the styles with a common style sheet. On top of that, the Fabric style can now be overridden by a user-defined configuration file. This kind of work will be ongoing, so please post in our forums if you have any suggestions!
Less clutter and more consistency in the Fabric UI
We also include the ability to modify the viewport render options and added and improved workflows in the GraphView such as:
We have of course fixed several bugs, particularly in Fabric for Maya, Alembic, and Blocks.
Don’t forget that the Fabric Forums are a great place to share what you are doing and learn from others in the Fabric community. We pay a lot of attention to the suggestions and challenges reported there and hope that we are doing a good job in reflecting that feedback as we continue to improve the Fabric platform.
Wishing everyone a successful 2017!
I have long been looking for a Remesher Tool for using in my pipeline. So far I have not found anything better than this free program https://github.com/wjakob/instant-meshes . I compiled this program as Fabric node, and added all the basic functions (except Guides). And I also have builded two nodes to make symmetry asset. The first node deletes half of mesh, the one other rebuilds the second symmetry half after remeshing process. This program works pretty fast, but unfortunately not perfect, sometimes it admits the open holes in difficult places (I noticed the same problem in exe version).
But in general this tool is useful for me, it creates a regular mesh and can be useful for procedural assets.
PS: I also noticed that Canvas standalone computes much faster than the version under Maya
upd: v2 is actual. I have added checking of empty input arrays to avoid a crash if inMesh is disconnected
©Copyright 2017 Fabric Software Inc. All rights reserved. | Privacy