View Full Version : Help need GC() script Please Script THis!
bernieLomax 04-08-2005, 01:07 PM Select File > Merge and merge in all elements of your problematic scene
Go to the file menu > XRef Objects > Close
Go to the file menu > XRef Scene > Close
Now type: "gc()" into the white pane of the MAXScript Mini Listener (single white text field at the bottom left) and select "Enter". This will invoke the garbage collector (be aware that this function also empties the undo/redo buffer)
Save the file
CAN ANYONE SCRIPT THIS! to a single button... I use this alot but REALLY alot of times for my company works... please help!
huighs
BERNARDO
|
|
Conny
04-08-2005, 02:06 PM
Have you tried the MaxScript Listener and the Macro recorder?
It record all your actions into script text.
Then select the text from the listener and drag'n drop to a new button.
Conny
Matt-Clark
04-08-2005, 03:09 PM
Moved to the Maxscript forum.
bernieLomax
04-08-2005, 03:37 PM
yes i did
but the xref scene dialog has a close button that i must press for it to work...
still trying
soshiant
04-08-2005, 05:18 PM
yes i did
but the xref scene dialog has a close button that i must press for it to work...
still trying
this is what i designed for one of projects.hope its sefull, though its not handeling XRef.Also its not saving ur file, but u can add it.(may be if i had time I add it myself).Sorry for my eng.Also im not an experinced script writer, so it is not the best u can find.use it till u find a better one.
-**********************************************************************
--***************************************************************************************
--Abdolreza Shirvani
--e_mail: abdolreza82@yahoo.com
--merge file v0.0
--coded in 3ds max 7.0
--***************************************************************************************
/*
mergeMaxFile max_file #prompt #select #noRedraw\
#deleteOldDups #mergeDups #skipDups #promptDups\
#promptMtlDups #useMergedMtlDups #useSceneMtlDups #renameMtlDups\
#promptReparent #alwaysReparent #neverReparent\
quite: true
*/
--***************************************************************************************
macroscript merge_file category:"MAX Script Tools" buttonText:"merge" toolTip:"merges your file!" silentErrors: true --!!!
(
arg_lst_2 = #( #mergeDups, #promptDups
, #skipDups, #deleteOldDups )
arg_lst_3 = #( #renameMtlDups, #promptMtlDups, #useMergedMtlDups, #useSceneMtlDups )
arg_lst_4 = #( #neverReparent, #promptReparent, #alwaysReparent )
rollout test "merge diag v 0.0" width:160 height:256
(
dropdownList ddl1 "Obj Duplicate:" pos:[28,16] width:104 height:40 items:#("mergeDups", "promptDups", "skipDups", "deleteOldDups")
dropdownList ddl2 "Mat Dups:" pos:[28,64] width:104 height:40 items:#("renameMtlDups", "promptMtlDups", "useMergedMtlDups", "useSceneMtlDups")
dropdownList ddl3 "parent:" pos:[28,112] width:104 height:40 items:#("neverReparent", "promptReparent", "alwaysReparent")
checkbox chk2 "quiet open" pos:[24,184] width:72 height:16 checked:true
checkbox chk1 "prompt" pos:[24,160] width:52 height:16 checked:true
button btn1 "merge" pos:[72,216] width:72 height:24
GroupBox grp1 "" pos:[8,0] width:144 height:248
on test close do
(
DestroyDialog test
)
on btn1 pressed do
(
max_file = getOpenFileName caption: "file merge"
mergeMaxFile max_file \
arg_lst_2[ddl1.selection]\
arg_lst_3[ddl2.selection]\
arg_lst_4[ddl3.selection]\
quiet: chk2.checked
gc()-->>>added here
)
)
try createDialog test 160 250
catch messageBox"failed to create dialog!"
)--end of macro
bernieLomax
04-08-2005, 05:54 PM
thanks i´ll try that... still the main problem to me is to close the damm window that pops up when you xref...
bernieLomax
04-08-2005, 06:02 PM
by the way i´m using max 6.0 and vray...
hugs bern
HELP BOBO!!
JayCMiller
04-10-2005, 08:03 AM
I read once on the discreet board that it can't be scripted :sad:
hope it's not true
bernieLomax
04-14-2005, 03:30 PM
still Wayting..
please help
going to try this...
:
XRefScene()
XRefObject()
gc()
help!
soshiant
04-15-2005, 07:21 AM
Can u uplaod a sample file, May be this way i can help u.
bernieLomax
04-15-2005, 10:53 AM
-- Xref Objects
actionMan.executeAction 0 "40376" -- File: XRef Objects
-- Xref Scenes
actionMan.executeAction 0 "40368" -- File: XRef Scenes
-- Garbage Collector
gc()
---thanks!
MikeOwen
04-28-2005, 03:44 PM
fn MAXFileSize_Cruncher =
(
-- MAX File Size GC Cruncher Pre-SAVE Script written by Mike Owen, 3D Technical Animator, Burrows Nvisage 2005
-- Version 1.0
--
-- This script fixes the Discreet MAX file size increasing problem during the #prefilesave callback flag
-------------------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------------------------------
--
max file xref object -- open xref object dialog
xro_hwnd = windows.getChildHWND 0 "XRef Objects" parent:#max -- find xref object dialog
if xro_hwnd != undefined do windows.sendMessage xro_hwnd[1] 0x0010 0 0 -- if found, send close message
max file xref scene -- open xref sceen dialog
xrs_hwnd = windows.getChildHWND 0 "XRef Scenes" parent:#max -- find xref scene dialog
if xrs_hwnd != undefined do windows.sendMessage xrs_hwnd[1] 0x0010 0 0 -- if found, send close message
gc() -- garbage collection
)
-- stick this in a callback #prefilesave handle.
-- Mike
bernieLomax
05-16-2005, 12:27 PM
big big thankx mike...
ill try it...
can i run it from a mcr script to put it in quad menu?
thankx
JayCMiller
05-17-2005, 04:34 AM
awsome Mike great work:D
bernieLomax: not shure about adding to a quad, but you can drag the text into a toolbar to get it as a button. quad would be nice though.
CGTalk Moderation
05-17-2005, 04:34 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.