Delete all SME views Script cause scene crash

Delete all SME views Script cause scene crash

calberto.cart
Advocate Advocate
3,730 Views
12 Replies
Message 1 of 13

Delete all SME views Script cause scene crash

calberto.cart
Advocate
Advocate

Hi there, a couple of days I tried an script from this Post

There, one of the Scripts really worked for me in Max 2024, but theres an issue with scenes with more than 10 View tabs, the script clean all the viewtabs but then the scene crashes.

But if I run the script directly from Maxscript, sometimes works ok, at least in some scenes, meanwhile saving the script in file or macro produces the scene to crash, its really weird. 

 

Im attaching 2 sample scenes in Max 21 and the Script mentioned.

Also a video example 

0 Likes
3,731 Views
12 Replies
Replies (12)
Message 2 of 13

denisT.MaxDoctor
Advisor
Advisor

I don't have MAX 2024 to play... could you please convert the scenes to 2023?

 

0 Likes
Message 3 of 13

calberto.cart
Advocate
Advocate
Ouch sorry, I totally forgot, I have already reupload the zip file with max files in 21 version
0 Likes
Message 4 of 13

denisT.MaxDoctor
Advisor
Advisor

I can't reproduce the problem of crashing while deleting sme views, working with the files you attached.

Perhaps someone else can find the situation where the scene crashes.

I use the code below to delete all views:

 

(
	if sme.GetMainframe() == undefined do sme.Open() 
	num = sme.GetNumViews()
	while sme.GetNumViews() do sme.DeleteView 1 false
	num
)	

 

The code deletes all views as expected. No warnings, no errors, no crash...

0 Likes
Message 5 of 13

calberto.cart
Advocate
Advocate

Thanks, that didnt work for me 😓

I have tried in Max 2021 and 2024 and the error occurs everytime

0 Likes
Message 6 of 13

denisT.MaxDoctor
Advisor
Advisor

Send the error message you get 

0 Likes
Message 7 of 13

MehdiZangenehBar
Advocate
Advocate

This happen for me sometimes, You should keep at-least one view to prevent the crash.

Message 8 of 13

denisT.MaxDoctor
Advisor
Advisor

@MehdiZangenehBar wrote:

This happen for me sometimes, You should keep at-least one view to prevent the crash.



Interesting find... sometimes it makes sense. 

In any case, I'd be interested to understand the exact cause of the crash.

Message 9 of 13

MehdiZangenehBar
Advocate
Advocate

Yea, and if I need to clear ALL, I will add the default view first, then delete the rest. 

0 Likes
Message 10 of 13

denisT.MaxDoctor
Advisor
Advisor

Could you make a minimal sample file where we could reproduce the crash?

0 Likes
Message 11 of 13

MehdiZangenehBar
Advocate
Advocate
Rarely happen, I will get back to this topic as soon as I got that again.
Message 12 of 13

calberto.cart
Advocate
Advocate

for me this is only happening in some cases, curiously only when im having more than 10 view tabs, I need to do more tests, at least in the samples that I upload its always crashing, 1 of them cleans, left 1 tab and then crash

0 Likes
Message 13 of 13

calberto.cart
Advocate
Advocate

Ok after some time, this issue is solved for me, the problem was from V-Ray, they have  updated version 6 and 7 in the nightlies, now I can clean the SME when there are more than 10 tabs.

 

0056825a-f8b1-4709-bf8c-d4657d323c6f.jpg

0 Likes