- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Im trying to batch delete the SME in multiple maxfiles with Pen Tools - Batch it all. Im truggling with some crashes after everything from 5-100 maxfiles or so, sometimes more sometimes less.
When I start over at the same file that caused the crash then its working so its hard to figure out what it is.
Most of the crash occur without even a CER or not possible to access the listener.
Im used to crashes in batches after a couple of 100 maxfiles but not after 5 or so, its getting a bit annoying.
Could it have to do if there are 0 views or 0 materials in the slate?
This is the batch code that im running together with sme global rendering off
fn sme_deleteAllViews open:off delNodes:on delRef:on delView:on = undo off
(
if open then sme.open() else sme.close()
k0 = sme.getnumviews()
for k = sme.getnumviews() to 1 by -1 do
(
v = sme.getview k
format "%:\n" v.name
if delNodes do
(
n0 = v.getnumnodes()
v.selectall()
v.deleteselection()
n1 = v.getnumnodes()
format "\t% > nodes: %(%)\n" k n1 n0
)
if delRef do
(
r0 = refs.getreference trackViewNodes[#sme] k
refs.replacereference trackViewNodes[#sme] k undefined
r1 = refs.getreference trackViewNodes[#sme] k
format "\t% > reference: %(%)\n" k r1 r0
)
if delView do
(
sme.deleteview k off
k1 = sme.getnumviews()
format "\t% > views: %(%)\n" k k1 k0
)
)
(k0 - sme.getnumviews())
)
sme_deleteAllViews open:on delNodes:on delRef:on delView:on
for i = 1 to 24 do meditmaterials[i] = vraymtl()
clearListener()
gc()
This is the latest error Im getting, not always able to catch a CER for some reason.
View5:
5 > nodes: 0(10)
5 > reference: undefined(<Deleted trackview node>)
5 > views: 4(5)
View4:
-- Error occurred in anonymous codeblock; filename: D:\Scripts\DeleteSME_Fn.ms; position: 758; line: 32
-- MAXScript Rollout Handler Exception:
-- Known system exception
-- ########################################################################
-- Address: 0x395d4783; nCode: 0x00000000C0000005
-- Desc: EXCEPTION_ACCESS_VIOLATION The thread tried to read from or write to a virtual address for which it does not have the appropriate access.
-- Read of Address: 0x000006D100000687
-- ########################################################################
-- MAXScript callstack:
-- thread data: threadID:21968
-- ------------------------------------------------------
-- [stack level: 0]
-- In k loop; filename: D:\Scripts\DeleteSME_Fn.ms; position: 334; line: 15
-- Parameters:
-- k: 4
-- Locals:
-- r0: undefined
-- n0: 407
-- V: <IObject:IFP_NodeViewImp>
-- n1: undefined
-- k1: undefined
-- k: 4
-- r1: undefined
-- Externals:
-- trackViewNodes: SystemGlobal:trackViewNodes : TrackviewNode:root
-- k0: Free:k0 : 5
-- delRef: Free:delRef : true
-- owner: undefined
-- delView: Free:delView : true
-- delNodes: Free:delNodes : true
-- ------------------------------------------------------
-- [stack level: 1]
-- called from sme_deleteAllViews(); filename: D:\Scripts\DeleteSME_Fn.ms; position: 759; line: 32
-- Parameters:
-- open: true
-- delNodes: true
-- delRef: true
-- delView: true
-- Locals:
-- k0: 5
-- delRef: true
-- delView: true
-- open: true
-- delNodes: true
-- Externals:
-- owner: undefined
-- ------------------------------------------------------
-- [stack level: 2]
-- called from s loop; filename: D:\Scripts\DeleteSME_Fn.ms; position: 827; line: 35
-- Parameters:
-- s: 2
-- Locals:
-- s: 2
-- Externals:
-- batchList_mlb: RolloutControl:batchList_mlb in rollout:batchUtil_R : MultiListBoxControl:batchList_mlb
-- scriptsIn: Free:scriptsIn : #()
-- batchDir_et: RolloutControl:batchDir_et in rollout:batchUtil_R : EditTextControl:batchDir_et
-- owner: undefined
-- ------------------------------------------------------
-- [stack level: 3]
-- called from x loop; filename: C:\Program Files\Autodesk\3ds Max 2021\stdplugs\stdscripts\PEN_batchItMax.ms; position: 11546; line: 376
-- Parameters:
-- x: 52
-- Locals:
-- file: undefined
-- scriptsIn: #()
-- x: 52
-- path: undefined
-- Externals:
-- batchList_mlb: RolloutControl:batchList_mlb in rollout:batchUtil_R : MultiListBoxControl:batchList_mlb
-- dontSaveFilesCb: RolloutControl:dontSaveFilesCb in rollout:batchUtil_R : CheckBoxControl:dontSaveFilesCb
-- owner: undefined
-- getBatchIni_fn: getBatchIni_fn()
-- logFile_fn: logFile_fn()
-- progBar_pb: RolloutControl:progBar_pb in rollout:batchUtil_R : ProgressBar:progBar_pb
-- fileSel: Free:fileSel : 899
-- setLogPath_fn: setLogPath_fn()
-- saveFolder_et: RolloutControl:saveFolder_et in rollout:batchUtil_R : EditTextControl:saveFolder_et
-- maxFiles_mlb: RolloutControl:maxFiles_mlb in rollout:batchUtil_R : MultiListBoxControl:maxFiles_mlb
-- num: Free:num : 51
-- overWrite_cb: RolloutControl:overWrite_cb in rollout:batchUtil_R : CheckBoxControl:overWrite_cb
-- ------------------------------------------------------
-- [stack level: 4]
-- called from process_bt.pressed(); filename: C:\Program Files\Autodesk\3ds Max 2021\stdplugs\stdscripts\PEN_batchItMax.ms; position: 12502; line: 411
-- member of: Rollout:batchUtil_R
-- Locals:
-- fileSel: 899
-- num: 51
-- scriptSel: 1
-- Externals:
-- batchList_mlb: RolloutControl:batchList_mlb in rollout:batchUtil_R : MultiListBoxControl:batchList_mlb
-- batchUtil_R: Rollout:batchUtil_R
-- owner: Rollout:batchUtil_R
-- progBar_pb: RolloutControl:progBar_pb in rollout:batchUtil_R : ProgressBar:progBar_pb
-- maxFiles_mlb: RolloutControl:maxFiles_mlb in rollout:batchUtil_R : MultiListBoxControl:maxFiles_mlb
-- escapeEnable: SystemGlobal:escapeEnable : true
-- ------------------------------------------------------
-- [stack level: 5]
-- called from top-level
-- ########################################################################
-- C++ callstack:
-- (SME): (filename not available): ConfigManager::__autoclassinit2
-- (SME): (filename not available): ConfigManager::__autoclassinit2
-- (core): (filename not available): ReferenceMaker::DeleteReference
-- (SME): (filename not available): ConfigManager::__autoclassinit2
-- (SME): (filename not available): ConfigManager::operator=
-- (SME): (filename not available): ConfigManager::__autoclassinit2
-- (SME): (filename not available): ConfigManager::__autoclassinit2
-- (MAXScrpt): (filename not available): Generic::apply
-- (MAXScrpt): (filename not available): CodeTree::eval
-- (MAXScrpt): (filename not available): Primitive::apply
-- (MAXScrpt): (filename not available): CodeTree::eval
-- (MAXScrpt): (filename not available): clear_error_source_data
-- (MAXScrpt): (filename not available): Primitive::apply
-- (MAXScrpt): (filename not available): CodeTree::eval
-- (MAXScrpt): (filename not available): Primitive::apply
-- (MAXScrpt): (filename not available): CodeTree::eval
-- (MAXScrpt): (filename not available): Primitive::apply
-- (MAXScrpt): (filename not available): clear_error_source_data
-- (MAXScrpt): (filename not available): Primitive::apply
-- (MAXScrpt): (filename not available): CodeTree::eval
-- (MAXScrpt): (filename not available): Primitive::apply
-- (MAXScrpt): (filename not available): CodeTree::eval
-- (MAXScrpt): (filename not available): save_error_source_data
-- (MAXScrpt): (filename not available): Primitive::apply
-- (MAXScrpt): (filename not available): CodeTree::eval
-- (MAXScrpt): (filename not available): SourceFileWrapper::eval
-- (MAXScrpt): (filename not available): Generic::apply
-- (MAXScrpt): (filename not available): CodeTree::eval
-- (MAXScrpt): (filename not available): SourceFileWrapper::eval
-- (MAXScrpt): (filename not available): MAXScript::SetMAXScriptListenerLogFile
-- (MAXScrpt): (filename not available): MAXScript::SetMAXScriptListenerLogFile
-- (MAXScrpt): (filename not available): Primitive::apply
-- (MAXScrpt): (filename not available): CodeTree::eval
-- (MAXScrpt): (filename not available): Primitive::apply
-- (MAXScrpt): (filename not available): CodeTree::eval
-- (MAXScrpt): (filename not available): Primitive::apply
-- (MAXScrpt): (filename not available): BitArrayValue::map
-- (MAXScrpt): (filename not available): clear_error_source_data
-- (MAXScrpt): (filename not available): Primitive::apply
-- (MAXScrpt): (filename not available): CodeTree::eval
-- (MAXScrpt): (filename not available): Primitive::apply
-- (MAXScrpt): (filename not available): CodeTree::eval
-- (MAXScrpt): (filename not available): Primitive::apply
-- (MAXScrpt): (filename not available): BitArrayValue::map
-- (MAXScrpt): (filename not available): clear_error_source_data
-- (MAXScrpt): (filename not available): Primitive::apply
-- (MAXScrpt): (filename not available): CodeTree::eval
-- (MAXScrpt): (filename not available): Primitive::apply
-- (MAXScrpt): (filename not available): CodeTree::eval
-- (MAXScrpt): (filename not available): clear_error_source_data
-- (MAXScrpt): (filename not available): Primitive::apply
-- (MAXScrpt): (filename not available): CodeTree::eval
-- (MAXScrpt): (filename not available): Primitive::apply
-- (MAXScrpt): (filename not available): CodeTree::eval
-- (MAXScrpt): (filename not available): Generic::apply
-- (MAXScrpt): (filename not available): SourceFileWrapper::apply
-- (MAXScrpt): (filename not available): RolloutControl::call_event_handler
-- (MAXScrpt): (filename not available): RolloutControl::get_wrapped_event_handler
-- (MAXScrpt): (filename not available): InitMacroScriptDir
-- (MAXScrpt): (filename not available): InitMacroScriptDir
-- (USER32): (filename not available): CallWindowProcW
-- (USER32): (filename not available): DispatchMessageW
-- (USER32): (filename not available): SendMessageTimeoutW
-- (ntdll): (filename not available): KiUserCallbackDispatcher
-- (win32u): (filename not available): NtUserMessageCall
-- (USER32): (filename not available): SendMessageW
-- (USER32): (filename not available): SendMessageW
-- (core): (filename not available): GetICustButton
-- (core): (filename not available): CustomControl::WindowProc
-- (core): (filename not available): AncestorIsCUIToolbarWindow
-- (USER32): (filename not available): CallWindowProcW
-- (USER32): (filename not available): DispatchMessageW
-- (USER32): (filename not available): IsDialogMessageW
-- (3dsmax): (filename not available): NodeAndAnims::SetNode
-- ########################################################################
Solved! Go to Solution.