headus 3D tools headus 3D tools / 3D scans
Support Forums
 
 FAQFAQ   SearchSearch    UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
headus 3D scans

UVLayout Send to 3ds Max problem!

 
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
HolaBlackDavy



Posts: 1
Joined: 12 Sep 2014

PostPosted: Fri Sep 12, 2014 3:20 pm    Post subject: UVLayout Send to 3ds Max problem! Reply with quote

Hello, i just installed UVLayout and i was doing some test and this problem came up!

When im done with UVs and pack them, i press Send and the UVs transfer to 3ds Max but they are distorted. Any ideas how can i solve this ?
Back to top
View user's profile Send private message Send e-mail
headus
Site Admin


Posts: 2894
Joined: 24 Mar 2005
Location: Perth, Australia

PostPosted: Fri Sep 12, 2014 4:56 pm    Post subject: Reply with quote

I dont use 3ds, but the UVs in the UV edit window look fine, so I'm wondering if you have two cylinders on top of each other? Or maybe multiple UV sets/layers, and the distorted one is being viewed on the mesh but not the good ones as seen in the UV view.

Phil
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Asimov



Posts: 18
Joined: 03 Apr 2015

PostPosted: Sun Apr 05, 2015 5:25 pm    Post subject: Reply with quote

I too am having the same problem. I haven't actually got headus but I am trying it out at my friends house.

I want to buy headus because I like it, but this problem is a big problem.

If I export to obj first and load that into headus and then load the obj into max the uvs are fine, and not distorted, apart from the fact the model comes in lying on it's back.

So I am guessing this problem is to doing with the max script to send the headus to max.

My friend is using 3ds max 2015 and the uvpipe mod by miauu.

I am wondering if it is because the script has not been updated when max 2015 came out.

Please let me know if anyone has a solution. I don't want to buy this product if it can't send to max.

Plus the other problem is that I can't unwrap my 90000 poly model. Headus just crashes on load.
Back to top
View user's profile Send private message
Asimov



Posts: 18
Joined: 03 Apr 2015

PostPosted: Sun Apr 05, 2015 8:03 pm    Post subject: Reply with quote

Hi,

I found out that if I use a different script then I can send the uvs back to max ok.
The only problem is I have downloaded a few and don't know who I got this one from.

I will try and find out and let you know. The script I found only lets you send one object to headus though.

I had a look in the file to see who wrote it, but all it say is rt_uvpipe
Back to top
View user's profile Send private message
Asimov



Posts: 18
Joined: 03 Apr 2015

PostPosted: Mon Apr 06, 2015 2:23 am    Post subject: Can't find which script I used Reply with quote

Hi all,

As I said in my last post I have tried a few scripts to get max working correctly with uvlayout and I know which script works, but it does not identify in the script who wrote it. Perhaps if I paste the script here someone will recognise it. This script only works with single objects though, and not multiple.

The ones that don't work in max 2015 are the HamLT one and the miauu. When I say they don't work they go through the actions but some how stretch all the materials. I wish I could learn how to modify these scripts. I know C++ but not how the script language works.

Code:

macroScript rt_uvpipe
   category:"rt uv tools"
   tooltip: "Headus Uvlayout bridge"
   Icon:#("uvpipe",1)

(
   local turnToPoly
   local uvLayoutBin
   local uvLayoutLaunchOptions = " -plugin"
   local uvLayoutTemp = "c:\\"
   local uvLayoutNode
   local uvLayoutDummyNode
   local uvLayoutMeshMode ="Poly"
   local uvLayoutUVMode = "Edit"
   local statusLine

   fn importObjUvs nNode fileName =
   (
      local mapChan = 1
      local mapVerts = #()
      local mapfaces = #()
      
      
      local file =openfile fileName
      
      if file !=undefined then
      (
         while (not (eof file)) do
         (
            cl = readline file
            tokens  = filterstring cl " "
            case tokens[1] of
            (
               "vt":
               (
               --   format "tvert:  %, %\n" tokens[2] tokens[3]
                  append mapVerts [tokens[2] as float,tokens[3] as float,0]
               )
               "f":
               (
                  tokens = deleteItem tokens 1
                  --format "face: %\n" tokens
                  local mapFace = #()
                  for i = 1 to tokens.count do
                  (
                     subToken = filterString tokens[i] "/"
                     append mapFace (subToken[2] as integer)
                  )
                  --print mapFace
                  append mapFaces mapFace
               )
            )
            
            
         )
         close file
         if (classof nNode == editable_poly) then
         (
            numFaces = polyop.getNumFaces nNode
            polyop.setMapSupport nNode mapChan true
            polyop.setNumMapVerts nNode mapChan mapVerts.count
            polyop.setNumMapFaces nNode mapChan mapFaces.count
            numVerts = mapVerts.count
            
            for i = 1 to numVerts do
            (
               polyOp.setMapVert nNode mapChan i mapVerts[i]
            )            
            for i = 1 to numFaces do
            (
               polyOp.setMapFace nNode mapChan i mapFaces[i]
            )
         )
      )
   )

   fn exportObj nNode fileName =
   (
      local mapChan = 1
      local numFaces = polyop.getNumFaces nNode
      local numVerts = polyop.getNumVerts nNode
      local numTVerts = polyop.getNumMapVerts nNode mapChan
      
      local matLib = #()
      local materialList =#()
      local numMaterials = 1
      local filenameStub = filterString filename "."
      local mtlFileName = filenameStub[1] + ".mtl"      
      local currentMtl = ""
      
      fn getMaterialByID nNode ID =
      (
         mat = nNode.Material
         
         if classof mat ==multiMaterial then
         (
            if ID > mat.materialList.count then
            (
               newIdx = mod ID mat.materialList.count
               return mat.materialList[newIdx]
            )
            else
            (
               return mat.materialList[ID]
            )
         )
         else
         (
            if mat == undefined then
            (               
               mat = standardmaterial()
               mat.name = nNode.name + "_mat"
            )
            
            return mat
         )
         
      )
      fn safeMatName matName =
      (
         filteredMatName = filterString matName " -"
         matName = ""
         for element in filteredMatName do
         (
            matName = MatName + element
         )
         matName
      )         
      
      local file = createfile fileName
      
      if file != undefined then
      (
         format "# RT_OBJ Exporter\n" to:file
         format "# % Verts\n" numVerts to:file
         format "# % T Verts\n" numTVerts to:file
         format "# % Faces\n" numFaces to:file
         format "mtlLib %.mtl\n" (getFilenameFile mtlFileName) to:file
         
         get_vert = polyop.getVert
         get_tVert = polyOp.getMapVert
         get_face_verts = polyOp.getFaceVerts
         get_map_face = polyOp.getMapFace
         get_face_ID = polyOp.getFaceMatID
         
         
         
         local pf = 100/(numVerts + numTVerts + numFaces)
         
         for i = 1 to numVerts do
         (
            vert = get_vert nNode i
            format "v % % %\n" vert[1] vert[2] vert[3] to:file
            
         )
         
         for i = 1 to numTVerts do
         (
            tVert = get_tVert nNode mapChan i
            format "vt % % %\n" tVert[1] tVert[2] tVert[3] to:file
            
         )
         
         
      
         format "g %\n" nNode.name to:file
         for i = 1 to numFaces do
         (
            faceVerts = get_face_verts nNode  i
            faceMapVerts = get_map_face nNode mapChan i
            faceVertCount = faceVerts.count
            faceMatID = get_face_ID nNode i
            faceMat = getMaterialByID nNode faceMatID
            
            if faceMat != currentMtl then
            (
               matName = safeMatName faceMat.name
               format "usemtl %\n"  matName to:file
               appendifUnique matLib matName
               currentMtl = faceMat
            )
            
            format "f" to:file
            
            for j = 1 to faceVertCount do
            (
               -- f v/vt/vn
               format " %/%" faceVerts[j] faceMapVerts[j] to:file
            )
            format "\n" to:file
            
         )
            
         
         close file      
      )
   

      --export the .mtl file
      
      file = createFile mtlFileName
      
      for mat in matlib do
      (
            format "newmtl %\n" mat to:file
            format "kd 1.0 1.0 1.0\n\n" to:file
      )
      close file
      
   )
   

   fn UvLayoutSend nNode =
   (
      local fileName =  (uvLayoutTemp + nNode.name +".obj")
      local uv_mod = unwrap_uvw()
      
      if  ((classof nNode) != editable_poly) and ((classof nNode) != polyMeshObject) then
      (
         ePolyMod = edit_poly()
         addModifier nNode ePolyMod
      )
      
      
      
      addModifier nNode uv_mod
      uvLayoutDummyNode =copy nNode      
      uvLayoutDummyNode = convertto uvLayoutDummyNode editable_poly
      deleteModifier nNode uv_mod
      
      
      exportObj uvLayoutDummyNode fileName
      
      uvLayoutLaunchOptions = " -plugin," + uvLayoutMeshMode + "," + uvLayoutUVMode
      shelllaunch uvLayoutBin  (uvLayoutLaunchOptions +" " +filename)
      
      
   )
   
   fn uvLayoutKill =
   (
      print "sending kill signal"
      file = createFile (uvLayoutTemp + uvLayoutNode.name + ".cmd")
      format "exit" to:file
      close file
   )
   
   fn uvLayoutRecieve nNode =
   (
      --import the uvs into the dummy node
      importObjUvs uvLayoutDummyNode (uvLayoutTemp + uvLayoutNode.name + ".out")
      
      --copy the imported uvs from the dummy to the stack of the working node.
      channelInfo.copyChannel uvLayoutDummyNode 3 1
      channelInfo.pasteChannel nNode 3 1
      uvLayoutNode.modifiers[1].name = "UVLayout UV's"
      
      uvLayoutKill()
      
      --deselect and reselect the working node. this will cause the stack display to refresh.
      select uvLayoutDummyNode
      select nNode
      
      delete uvLayoutDummyNode
      
   )
   fn uvPipeInit =
   (
      local scriptsDir = getDir #Scripts
      uvLayoutTemp = sysInfo.tempdir + "\\"
      
      if (doesFileExist (scriptsDir +"\\"+"uvpipe\\uvpipe.ini")) then
      (
         uvLayoutBin = getINISetting (scriptsDir +"\\"+"uvpipe\\uvpipe.ini") "Settings" "bin"
         print uvLayoutBin
      )
      else
      (
         uvLayoutBin = getOpenFileName caption:"uvlayout binary" filename:"uvlayout.exe" types:"Executable(*.exe)|*.exe"
         makeDir (scriptsDir +"\\"+"uvpipe")
         setINISetting (scriptsDir +"\\"+"uvpipe\\uvpipe.ini") "Settings" "bin" uvLayoutBin      
      )
      
   )
   
   
   rollout r_uvPipe "UV Pipe"
   (
      pickbutton pb_send "select object to start"
      radiobuttons rb_meshMode "Mode:" labels:#("Poly","SUBD") default:1
      radiobuttons rb_uvMode "UV Mode" labels:#("New","Edit") default:2
      timer tmr_checkForUvs "wait" interval:500 active:false
      
      on rb_meshMode changed mode do
      (
         mm = #("Poly","SUBD")
         uvLayoutMeshMode = mm[mode]
      )
      
      on rb_uvMode changed mode do
      (
         um = #("New","Edit")
         uvLayoutUVMode = um[mode]
      )
      
      on pb_send picked nNode do
      (
         
         uvLayoutNode = nNode
         UvLayoutSend uvLayoutNode
         tmr_checkForUvs.active = true
      )
      
      on tmr_checkForUvs tick do
      (
         if doesFileExist(uvLayoutTemp +uvLayoutNode.name+".out" ) then
         (
            tmr_checkForUvs.active = false
            uvLayoutRecieve uvLayoutNode
         )
      )
   )
   
   on execute do
   (
      uvPipeInit()
      createDialog r_uvPipe
   )
   

)
Back to top
View user's profile Send private message
Asimov



Posts: 18
Joined: 03 Apr 2015

PostPosted: Mon Apr 06, 2015 7:20 am    Post subject: Reply with quote

Hi all,

I believe the only script that works for me is the R. Knightly script.
It only loads in one object at a time unlike the newer ones, but it works well.

Like I said the newer ones screw up the uvs for some reason.

Here is a link
http://www.headus.com/phpbb/viewtopic.php?t=402

Sorry it took so long to find the one that worked. It's just I installed 3 or 4 scripts and they all sent back to max, but I found the link above is the only script that does it properly.

Took me a while. I downloaded all the scripts again, and then matched the one that was the same as the one I had in max.

So if you have max 2015 the older script works, whereas the new ones don't.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group