chand81 / Deformation-Transfer

Transfer deformations from source mesh to target mesh, keeping the identity of target intact.
MIT License
124 stars 34 forks source link

instruction needed #1

Open kenculate opened 5 years ago

kenculate commented 5 years ago

this need some instruction or cmakelist file to build, please provide some.

ArashHosseini commented 5 years ago

+1

kenculate commented 5 years ago

here is the cmakelist

cmake_minimum_required(VERSION 2.8) include($ENV{DEVKIT_LOCATION}/cmake/pluginEntry.cmake) include_directories( ${PROJECT_SOURCE_DIR}/src ${PROJECT_SOURCE_DIR}/src/eigen ) set(PROJECT_NAME Cmd_DefTransf) set(SOURCE_FILES ${PROJECT_SOURCE_DIR}/src/Cmd_DefTransf.cpp ${PROJECT_SOURCE_DIR}/src/DeformationTransferManager.cpp ${PROJECT_SOURCE_DIR}/src/DeformationTransferManager.h ) set(LIBRARIES OpenMaya OpenMayaAnim Foundation ) build_plugin()

kenculate commented 5 years ago

here is the maya scrip with UI

import maya.cmds as cmds import maya.mel as mel class TransferUI: def init(self): self.sources = [] self.targets = [] self.ui()

def ui(self):
    self.window_name = "transferui"
    if cmds.window(self.window_name, ex=1):
        cmds.deleteUI(self.window_name)
    self.window = cmds.window(self.window_name)
    cmds.columnLayout(adj=1)
    #row = cmds.rowLayout(nc=2)
    cmds.separator(h=10)
    cmds.button(l='Add Sources', c=self.add_sources)
    self.list_src = cmds.textScrollList()
    #cmds.setParent('..')
    cmds.separator(h=10)
    cmds.button(l='Add Targets', c=self.add_targets)
    self.list_tgt = cmds.textScrollList()

    cmds.separator(h=10)
    cmds.button(l='Transfer', c=self.transfer)

    cmds.showWindow(self.window)
def add_sources(self, *args):
    sl = cmds.ls(sl=1)
    cmds.textScrollList(self.list_src, e=1, a=sl)
    self.sources += sl

def add_targets(self, *args):
    sl = cmds.ls(sl=1)
    cmds.textScrollList(self.list_tgt, e=1, a=sl)
    self.targets += sl

def transfer(self, *args):
    src = ','.join(self.sources)
    tgt = ','.join(self.targets)
    mel.eval('defTransfer -src "{}" -tgt "{}";'.format(src ,tgt))

TransferUI()

ArashHosseini commented 5 years ago

@kenculate thanks a lot. A question, how is the workflow with different vertex count or not vertex wise correspondence? the page is addressing it with a non-rigid-registration....is that already included?

kenculate commented 5 years ago

It is not working as expected, for example I couldn’t find the proper implementation of markers in the source code.

ArashHosseini commented 5 years ago

@kenculate, did you used mesh with vertex wise correspondence?

ArashHosseini commented 5 years ago

@kenculate, thank you i found it out.....

the method requirespoint-wise correspondences between source and target shapes. Localshape deformation is then represented using deformation gradients,which are transferred from the source to the target shapes.

ArashHosseini commented 5 years ago

@kenculate do you have the ".mll" file?

kenculate commented 5 years ago

yap, I will upload somewhere.

ArashHosseini commented 5 years ago

@kenculate thank you

kenculate commented 5 years ago

https://srv-file2.gofile.io/download/sRCE8k/Cmd_DefTransf.mll

ArashHosseini commented 5 years ago

@kenculate thanks a lot but i am not authorized to download this file....

kenculate commented 5 years ago

https://drive.google.com/open?id=1fOT8OU2ErJ9jO7hCB0Ncg2jBYSZ025RX

ArashHosseini commented 5 years ago

@kenculate agha merci

kenculate commented 5 years ago

moteasefane natunestam contacti az shoma peida konam, ye dusti dare talash mikone ye hamchin kari ro anjam bede va hamchenan movafagh nabude, age momkene contactetun ro baraye man beferestin ta baham connectetun konam shayad be rah hal moshtarak beresin!