Page MenuHome

Mesh Data Transfer
AbandonedPublic

Authored by Bastien Montagne (mont29) on Sep 26 2014, 3:44 PM.

Details

Summary

Mesh Transfer Data


Mesh transfer data (data here being either real CD layers, like e.g. skinning weights, UVs, etc., or 'fake' ones, like e.g. vgroups, shapekeys, but also edge crease, smooth/sharp/seam flags, etc.) is subdivided in several sub-modules:

  • Mapping between mesh elements (verts, edges, polys or loops), in BKE's mesh_mapping.
  • Mapping between data layers (for non-singleton data types), mostly handled in ED_object and BKE's customdata areas.
  • Transfer of single data layer, mostly handled in BKE's customdata area.

Additional possibilities (only relevant for a subset of data types) are barely sketched up currently:

  • A way to filter which elements of destination we actually want to affect (currently, all, also the possibility to only affect those below a given threshold - could also add e.g. vgroup-based selection, etc.).
  • A way to alter destination elements' data in other ways than mere replace (add/sub/mul/div/etc.).

All this is designed to be both easy to setup (code-wise) for simple types, and yet flexible enough to be usable by complex/weird data types like vgroups and shapekeys. For now, it is only expected to work in Object/modifier contexts, not quite sure whether having this in BMesh would be that much useful?

This patch is by no mean ready for review, it only has a few elements implemented (currently, basic edge sharp/seam flags, and crease values, as well as vgroups, are 'working'), and those who are are not really tested yet, so this is a mere proof of concept. The low-level design of the whole stuff should be rather OK, though.

Mesh Elements Mapping

This part is rather independent. Currently, vertices and edges mappings are implemented (but not really tested yet, think will have to write some gtests for that anyway). Note I'm not sure all proposed mapping modes are useful, and most likely we can imagine others too - but this is easy to add afterwards, so for now only plan to finish basic ampping for polys and loops.

Note mapping supports a distance threshold, to prevent geometry to far away from each other to match.

Data Layers Mapping

This is handled by a struct defined in BKE_customdata, but filled in ED_object code. Each instance of DataTransferLayerMapping contains all data needed to execute the data transfer for each element of the mesh mapping.

object_transfer_data.c handles the generation of those data layers mapping instance for basic types (usual CDLayers, but also bitflags and simple data like edge crease), complex types like vgroups and shapekeys are handled by dedicated helpers in there own files - trying to keep code well ordered.

Transfer of Single Data Layer

This is a low-level simple func in BKE_customdata, that executes the data transfer itself, including weighted interpolation if needed. It expects pre-computed inputs (mesh elements' and data layers' mappings).

High Level

ED_data_transfer is the high-level interface to all this, used by the OBJECT_OT_data_transfer operator. Once again, not all features are implemented yet, by far.

Diff Detail

Repository
rB Blender
Branch
mesh-transfer-data

Event Timeline

Bastien Montagne (mont29) retitled this revision from to Mesh Transfer Data ********** Mesh transfer data (data here being either real CD layers, like e.g. skinning weights, UVs, etc., or 'fake' ones, like e.g. vgroups, shapekeys, but also edge crease, smooth/sharp/seam flags, etc.) is subdivided in....Sep 26 2014, 3:44 PM
Bastien Montagne (mont29) updated this object.
Bastien Montagne (mont29) updated this revision to Diff 2619.
Bastien Montagne (mont29) retitled this revision from Mesh Transfer Data ********** Mesh transfer data (data here being either real CD layers, like e.g. skinning weights, UVs, etc., or 'fake' ones, like e.g. vgroups, shapekeys, but also edge crease, smooth/sharp/seam flags, etc.) is subdivided in... to Mesh Data Transfer.Sep 26 2014, 3:45 PM
Bastien Montagne (mont29) updated this object.

If you haven't already, I HIGHLY recommend looking at the docs for Softimage's GATOR module.

http://knowledge.autodesk.com/support/softimage/downloads/caas/mne-help/global/docs/softimage2013/en_us/userguide/files/property8064-htm.html

It's the gold standard of mesh transfer tools as far as I'm concerned in terms of ease of use and feature set.

Quick question:
Does this patch allow to work on multi user meshes with different/individual EdgeSplit- or Crease-Data?

If you haven't already, I HIGHLY recommend looking at the docs for Softimage's GATOR module.
http://knowledge.autodesk.com/support/softimage/downloads/caas/mne-help/global/docs/softimage2013/en_us/userguide/files/property8064-htm.html
It's the gold standard of mesh transfer tools as far as I'm concerned in terms of ease of use and feature set.

Yes, along with AttribTransfer from Houdini:
http://www.sidefx.com/docs/houdini13.0/nodes/sop/attribtransfer
http://vimeo.com/15923855

Btw. do sculpt masks fit somehow into this? It would be great to finally fit them into interface as a mesh customdata first class citizen with conversions from and to vertex groups.

0rAngE (undo) added a comment.EditedSep 30 2014, 4:27 PM

A couple of suggestions to be considered for this feature, in case you guys don't already have it covered.

Transferring as many mesh data types on geo-independent level. Meaning the Source and Target can have different vertex order and count! UV transfer would rate high on this geo-independent list. Also, the current weights transfer that is present should be integrated with this new tool, so everything mesh-transfer related is accessible from the same spot.

Another thing that I feel should be a part of this 'mesh transfer swiss knife tool' is a vertex reordering tool. Where you have 2 meshes with same vertex count but different vertex order, and you can match them up. That would round up most everything needed for handling mesh data!

Eeeek… Guys… Thanks for all the remarks and suggestions, but this place is not a forum for user requests, it’s mostly a working tool for developers. If you really want it, you can open a discussion e.g. on BA and report the link here, that will be enough.

Meeeh? Forgot I had done this one... :/ So now, new diff for this work is D889!