Forum Groups
  All forums
    Help & Feedback
      Questions
      Work in progress
      Finished Art
      Non-Max related
    Community
      Offtopic
      News
    Hardware
    Photography



Maxunderground news unavailable

[MAXScript] Copy the geo from one Editable Poly to an empty one?
show user profile  Nanne
I'm fiddling with MAXScript again, trying to learn something useful :)

I have a Editable Poly let's call it "oldGeo" and then I want to create a new empty Editable Poly object , "newGeo" and copy all the geometry from oldGeo to newGeo. But I can't really figure out how... any ideas?

I use this trick sometimes when cleaning up a scene where strange scaling and rigging are messing up the geometry when trying to change things, like the mesh getting skewed or similar when removing a animation controller or something like that.
What I usually do is I create a sphere, delete all the geo on that, and use the Attach function of Editable Poly to transfer the vertices from oldGeo to newGeo, but now I have a clean base node with no scaling or animation controllers attached.

I suppose something similar could be done here using MAXScript, but I thought one could just copy all the vertices, edges and normals from one object to the other. That's possible, no?

Kristoffer Helander
www.kristofferhelander.se
  :: Works ::   |  :: Resumé ::   |  :: Contact ::   |  :: CG Blog ::   |  :: Links ::     
read 408 times
1/30/2016 1:08:14 PM (last edit: 1/30/2016 1:08:14 PM)
show user profile  ccampbell
Sounds like a transform problem. Have you tried making a snapshot or edit poly then utilities > xform > reset xform then collapse the stack or convert to edit poly/mesh?


When you create a new sphere its transforms are un alterd and scale is 1:1 which is probably why the transfering old verts to the attached objects are working.

P.s. I'm writing this on the toilet 5 min after waking up so my instructions above could be a little off. I'll check back after breakfast




$Entrepreneur = if((Designer + Engineer)*Programmer){Problem Solver};



read 395 times
1/30/2016 5:24:32 PM (last edit: 1/30/2016 5:24:32 PM)
show user profile  ccampbell
So I never did look into this... Did this help?




$Entrepreneur = if((Designer + Engineer)*Programmer){Problem Solver};



read 353 times
2/1/2016 6:05:51 PM (last edit: 2/1/2016 6:05:51 PM)
show user profile  Nanne
Well, yes I'm sure that works. I already know how to fix the problem in Max. What I was really looking for to learn was how to copy vertices from one object to another via MAXScript :)

Kristoffer Helander
www.kristofferhelander.se
  :: Works ::   |  :: Resumé ::   |  :: Contact ::   |  :: CG Blog ::   |  :: Links ::     
read 346 times
2/1/2016 8:12:17 PM (last edit: 2/1/2016 8:12:17 PM)
show user profile  ccampbell
The simplest way is..

Select object > ResetXForm $ ; convertToPoly $ assuming this works for you( you haven't tried...)

Otherwise You you have two options.

1) Rebuild a new mesh vert by vert(not trivial). See link below for more info..
Meshops - Geomtry class / TriMeshs
https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2015/ENU/MAXScript-Help/files/GUID-0532C071-4401-4846-8450-3DA5510A3883-htm.html

2) create a new empty mesh then assign your current one into the new empty one but you'll have to invert your normal's because there wont be any normal info.

Learn about Maxscript and editable meshes http://help.autodesk.com/view/3DSMAX/2015/ENU/?guid=__files_GUID_4DBE932E_66E0_402B_B66F_D72A07E983FC_htm


Chris




$Entrepreneur = if((Designer + Engineer)*Programmer){Problem Solver};



read 341 times
2/1/2016 10:43:20 PM (last edit: 2/1/2016 10:55:50 PM)
show user profile  Garp
This should work:

x = $OldGeo
y = editable_mesh name:"NewGeo"
y.mesh = copy x.mesh
convertToPoly y





read 323 times
2/1/2016 11:19:10 PM (last edit: 2/1/2016 11:19:10 PM)
show user profile  Nanne
Thanks both of you, I'll look into that! :)

How come the "copy mesh"-thingy does not work on Editable Poly, only on the old school Editable Mesh?

Kristoffer Helander
www.kristofferhelander.se
  :: Works ::   |  :: Resumé ::   |  :: Contact ::   |  :: CG Blog ::   |  :: Links ::     
read 318 times
2/1/2016 11:48:46 PM (last edit: 2/1/2016 11:49:18 PM)
show user profile  Garp
Yes, that's weird. You can read the trimesh from an epoly but not set it directly.
An oversight maybe?




read 315 times
2/1/2016 11:59:44 PM (last edit: 2/1/2016 11:59:44 PM)
#Maxforums IRC
Open chat window


Support Maxforums.org