Author Topic: Reset Xref/Collapse/Edit Poly  (Read 3217 times)

2023-01-26, 11:12:55
Reply #15

aaouviz

  • Active Users
  • **
  • Posts: 881
    • View Profile
    • Another Angle 3D
Quote
Doesn't seem to work with 2023 unfortunately.

(Or, it is crashing for me, at least).

works fine in 2023.1 here...

Damn... obviously something up with my max then. Very curious infuriating...

Thanks for the suggestion and follow-up.
Nicolas Pratt
Another Angle 3D
https://www.instagram.com/anotherangle3d/

2023-01-26, 11:17:18
Reply #16

James Vella

  • Active Users
  • **
  • Posts: 542
    • View Profile
Hm, I was just reading that the convert editable poly could have different syntax in 2023, you could try this but its a long shot.

Code: [Select]
for obj in selection do
(
  resetXForm obj
  convert obj #editable_poly
)

I think someone using 3dsmax 2023 could debug this one better than I could at this stage.

edit:
I had #polymesh before, I updated it to editable_poly, apparently you can use these... 'polymesh','editable_mesh','editable_poly' etc.
The reset xform could also be different in 3dsmax 2023...
« Last Edit: 2023-01-26, 11:33:28 by James Vella »

2023-01-26, 16:13:20
Reply #17

Ink Visual

  • Active Users
  • **
  • Posts: 158
    • View Profile
This won't help you with writing your own script, but in case you're also looking for a solution to this, Assembly Tool Plugin (free) has a function that does exactly what you described.
It's called "Prepare Models for Work"


2023-01-26, 16:32:26
Reply #18

Aram Avetisyan

  • Corona Team
  • Active Users
  • ****
  • Posts: 543
    • View Profile
If it is not working, you are most probably missing the "on execute" line.
Here is the script I wrote for exactly this, it also brings the pivot to XY center and Z min:

macroscript My_macro category:"Aram Avetisyan" tooltip:"Xform, Poly, Pivot XY Center Z Min"
(
 on execute do
 (
    for _ in $ do
    (
       resetxform _
       convertTo _ EditablePolyMesh
       _.pivot = [_.center.x, _.center.y, _.min.z]
    )
 )
max modify mode
)


You can then assign a hotkey for it in Hotkey manager.

Cheers.
Aram Avetisyan | chaos-corona.com
Chaos Corona Support Representative | contact us

2023-01-26, 19:32:40
Reply #19

aaouviz

  • Active Users
  • **
  • Posts: 881
    • View Profile
    • Another Angle 3D
If it is not working, you are most probably missing the "on execute" line.
Here is the script I wrote for exactly this, it also brings the pivot to XY center and Z min:

macroscript My_macro category:"Aram Avetisyan" tooltip:"Xform, Poly, Pivot XY Center Z Min"
(
 on execute do
 (
    for _ in $ do
    (
       resetxform _
       convertTo _ EditablePolyMesh
       _.pivot = [_.center.x, _.center.y, _.min.z]
    )
 )
max modify mode
)


You can then assign a hotkey for it in Hotkey manager.

Cheers.

Wow, this one works. Thanks mate.

One issue; it doesn't to the Collapse of multiple objects though. Do you think this is somehow possible?
Nicolas Pratt
Another Angle 3D
https://www.instagram.com/anotherangle3d/

2023-01-27, 15:59:13
Reply #20

Aram Avetisyan

  • Corona Team
  • Active Users
  • ****
  • Posts: 543
    • View Profile
The script above is intended not quite for what you are saying. Imagine you want to Reset Xform and center the pivot for 100 objects, but you don't need to attach them.
I would suggest doing the attaching separately, there are already good native tools for it.

I will try to test the attaching functionality for the script when I have time. But you would really need to have this functionality separately.
Aram Avetisyan | chaos-corona.com
Chaos Corona Support Representative | contact us

2023-10-10, 11:41:29
Reply #21

aaouviz

  • Active Users
  • **
  • Posts: 881
    • View Profile
    • Another Angle 3D
Man, I suck at maxscript...

I want to make a simple "Save and then Exit" script (via toolbar button).

This is what I have, but I can't quite get it to work as intended. Any helpers out there? Many thanks!

Code: [Select]
--Original script by: aaouviz
------

macroscript SaveAndExit
category: "AAScripts"
buttonText: "Save and Exit"
tooltip: "Save and Exit"
Icon:#("AAGen_01",1)


(
saveMaxFile
)
quitmax #noprompt
Nicolas Pratt
Another Angle 3D
https://www.instagram.com/anotherangle3d/

2024-01-04, 23:51:12
Reply #22

Okmijun

  • Active Users
  • **
  • Posts: 25
    • View Profile
Hi,
I am SO sorry to be one of those annoying-people-you're-helping-with-nothing-in-return... BUT
Please see attached screencapture.
Either I'm doing something wrong, or something buggy is up with my max. Either is very likely...
Can you spot a problem? Thanks again James you're skills are impressive

Do not worry, me too!
I have some ideas for scripting, to speed up workflow

1. use some batch merge script /there are a few of them/
2. explode and attach every file imported via batch merge script.

Basically, we should combine functionality of 2 scripts, merging, and attaching into poly.

merge
https://www.scriptspot.com/3ds-max/scripts/batch-merge
and soulburns attachselectedobjects
with pivot in center base, ofcourse!
furher more, we could incorporate multialign script to align them into raws...
and with few clicks, you have whole afternoon of work.

I hope I was clear enough what did I want to explain.