Hi,
WrapX has some great features but as my python skills are not so good, it would be nice, if there was a GUI available to do the batch process without having to use python.
Hi,
WrapX has some great features but as my python skills are not so good, it would be nice, if there was a GUI available to do the batch process without having to use python.
Hey! That makes a lot of sense and we definitly will add GUI-tools to WrapX. It’s just a matter of time.
Until than we would be glad to create and provide you with any common Python scenarios.
With WrapX it is possible to create a “wizard” of dialogs where user only need to select models, polygons and points and click Ok, no coding at all.
If you can provide your use-case in form:
[ol]- Select a set of wrapped models
we will create a script for you and post it here.
wow that would be cool! ![]()
it would be nice to have a script which uses folders outside of the DemoModels folder
for example: paths like these;
Z:/wrapX files/Scans+Textures
Z:/wrapX files/Basemeshes
Z:/wrapX files/Results
For users an extremely useful python scenario would be to have GOZ for WrapX with ZBrush and Blender.
you select the Wrap option you want, export the files from ZBrush or Blender (Scans+textures, Basemeshes) to folders
and Wrap gets started, loads the files from the folders and does its thing and of course saves them in the results folder.
Hi myclay!
I’ve made a set of scripts for batch wrapping without doing scripting as you suggested:
https://github.com/Russian3DScanner/WrapXScripts/tree/master/BatchWizard
You can download it with sample from here: https://github.com/Russian3DScanner/WrapXScripts/archive/v1.0.1.zip
Sample contains two objects and basemeshes - torso and head, you can use any number you want.
Now it only covers wrapping operations with default parameters, soon I will add fine-control abilities to it. Try it please and if you will face any difficulties please let me know.
thanks for the scripts those are exactly what I wanted to have ![]()
Hi,
For the “Goz like” thing, You may have a look at python socket functions.
Lets do something with Maya
(I don’t know blender, but since it has Python support, I guess you can do similar things)
On the maya side, open a port to recieve commands :
#open a port for WrapX
import maya.cmds as cmds
cmds.commandPort(name=":7894", sourceType="python")
Then in WrapX, you can create a function to send command to maya :
import socket
HOST = '127.0.0.1'
PORT = 7894
ADDR=(HOST,PORT)
def SendToMaya(command):
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect(ADDR)
MyMessage = command
client.send(MyMessage)
client.close()
SendToMaya("import maya.cmds as cmds; cmds.polyCube()")
Hit play in wrap and… ;D polyCube’s here !
http://img.myzupics.com/ac/f7l.jpg
So basicly, GoZ exports an OBJ in a temp directory, then the software load it. (you can add textures, multiples files support etc…)
Here’s a quick test, I have modified the Decimation demo script, to send mesh to maya at the end (to be clean, the SendToMaya function should be done in another .py file and imported here) :
import wrap
import socket
HOST = '127.0.0.1'
PORT = 7894
ADDR=(HOST,PORT)
# 1. Loading scan
print "Loading scan..."
scan = wrap.Geom(wrap.demoModelsPath + "/AlexNeutral_3DHumanity.obj",scaleFactor = 1000)
scan.wireframe = False
scan.shaded = False
scan.texture = wrap.Image(wrap.demoModelsPath + "/AlexNeutral_3DHumanity.jpg")
print "Done"
# 2. Decimation
print "Decimation"
scanDec = wrap.decimate(scan,50000,preserveTexCoords = True)
scanDec.translate(scanDec.boundingBoxSize[0] * 1.0,0,0)
# 3. Displaying result
scanCopy = scan.copy()
scanCopy.texture = None
scanCopy.shaded = True
scanCopy.translate(0,-scan.boundingBoxSize[0] * 1.0,0)
scanDecCopy = scanDec.copy()
scanDecCopy.wireframe = True
scanDecCopy.shaded = True
scanDecCopy.texture = None
scanDecCopy.translate(0,-scanDec.boundingBoxSize[0] * 1.0,0)
wrap.fitToView()
#Send mesh to maya
tempPath = 'D:/tmp/Wrap2MayaTmp.obj'
scanDec.save(tempPath,scaleFactor = 1.0/1000)
SendToMaya("import maya.cmds as cmds; cmds.file('D:/tmp/Wrap2MayaTmp.obj', i=True)")
def SendToMaya(command):
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect(ADDR)
MyMessage = command
client.send(MyMessage)
client.close()
http://img.myzupics.com/ac/j0m.jpg
You can have a look at Goz source scripts (most things aren’t crypted/compiled), it doesn’t look that complicated to do a WrapX ↔ Zbrush GoZ.
Still hoping that one day, Zbrush will support Python :-\
Hi,
great example for Maya, thank for for showing it.
I tried to dive into python and Zscript but no luck yet in getting more than the UI part.