[MaxScript] Is there any BipWorkBench.Close() command?

jejeparkPDJS9
Contributor
Contributor

[MaxScript] Is there any BipWorkBench.Close() command?

jejeparkPDJS9
Contributor
Contributor

Hi.

If I choose Biped and play the animation with motion panel open, there will be a delay(Frame drop).

So, I made a simple MaxScript to unselect object and play the animation before playing the animation.

 

There's no problem in general situations.
But if I open the Workbench window and play the animation,
3dsMax closes with an error.

 

I looked for a command to close the WorkBench window before playing the animation, but I couldn't find it.

Is there a another command to close the WorkBench window?
Or I was wondering if there is a command that can bypass the error.

20240522140918.png

 

==========================================================================

global SelObject_for_FastPlay = #()
 
fn PsKit_FastPlay =
(
SelObject_for_FastPlay = selection as array
clearSelection()
)
 
fn PsKit_PlayEnd =
(
if SelObject_For_FastPlay.count != 0 do select SelObject_for_FastPlay
)
 
callbacks.addScript #playbackStart "PsKit_FastPlay()" ID:#PsKit_FastPlay
 
callbacks.addScript #playbackEnd "PsKit_PlayEnd()" ID:#PsKit_FastPlayEnd
0 Likes
Reply
Accepted solutions (1)
981 Views
14 Replies
Replies (14)

denisT.MaxDoctor
Advisor
Advisor

 

(
	for hwnd in uiaccessor.GetPopupDialogs() where matchpattern (uiaccessor.GetWindowText hwnd) pattern:"*Workbench" do 
		uiaccessor.CloseDialog hwnd
)

 

 

But it's better to find what state of the Workbench is causing the crash. By default it's stable and doesn't crash.

0 Likes

jejeparkPDJS9
Contributor
Contributor

Wow. it works. thanks a lot

0 Likes

denisT.MaxDoctor
Advisor
Advisor

all together it could be:

 

callbacks.removescripts id:#qck_play

global QCK_PLAY_NODES_
global QCK_PLAY_WORKBENCH_

fn close_bip_workbench_dialog = 
(
	for hwnd in uiaccessor.GetPopupDialogs() where matchpattern (uiaccessor.GetWindowText hwnd) pattern:"*Workbench" do
	(
		uiaccessor.CloseDialog hwnd
		return true 
	)
	false
)

fn on_qck_play_start = 
(
	QCK_PLAY_WORKBENCH_ = close_bip_workbench_dialog()
	QCK_PLAY_NODES_ = selection as array
	clearNodeSelection()
)
fn on_qck_play_end = 
(
	try (select QCK_PLAY_NODES_) catch()
	if QCK_PLAY_WORKBENCH_ == true do BipWorkBench.Open()
)

callbacks.addScript #playbackStart "on_qck_play_start()" id:#qck_play
callbacks.addScript #playbackEnd "on_qck_play_end()" id:#qck_play

 

 

I prefer to use #matchpattern instead of direct (if text == "Animation Workbench") because of the possible name difference for different localizations. But it's up to you. Both should work.

0 Likes

denisT.MaxDoctor
Advisor
Advisor

@jejeparkPDJS9 wrote:

 

If I choose Biped and play the animation with motion panel open, there will be a delay(Frame drop).

 

 

It'd be good to understand what slows down the animation in the state of the selected nodes. It should be something specific. Perhaps switching to the "Create" panel will solve your problem.

0 Likes

jejeparkPDJS9
Contributor
Contributor

Thank you for your detailed answer.

When I play an animation
If Biped is selected and the motion panel is open,
The parameters of the motion panel are linked and changed.
The test results show a Frame Drop of about 50 fps due to the above.

-- The sentence is not smooth because I use a translator. Please understand.

0 Likes

jejeparkPDJS9
Contributor
Contributor

Oh. I understand your intentions now.
As you said, moving to the "Create" panel will solve the frame drop.

However, even when I stop playing and change to the Motion panel, there's a little bit of time delay

(It's not Frame Drop. It takes time for the Motion panel to open.)
So I have selected a method to unselect rather than move the another panel.

And the WorkBench window does not close automatically when I go to the Create panel with the WorkBench window open

0 Likes

denisT.MaxDoctor
Advisor
Advisor

I think it's not the Biped skeleton that causes the performance drop, but some modifiers (deformers) applied to the mesh. As I know the Biped automatically stops all UI updating messages during playback.

0 Likes

jejeparkPDJS9
Contributor
Contributor

I hope you're right.
But the framing drops actually happen, and it's not just happening to me.
I also reported this to the Autodesk a long time ago
It hasn't been fixed, even though several versions have been released.
I made the above script because of the demands of my team members.

I've been using Character Studio since 3ds Studio Max 1.

Biped is such an old technology,

So Autodesk no longer seems to bedeveloping Biped.

0 Likes

denisT.MaxDoctor
Advisor
Advisor

the Character Studio is in MAX since version 4...

 

But you're right. Biped loses playback performance when the motion panel is open. But we need to suspend messages to the panel... here's how it can be improved.

 

0 Likes

jejeparkPDJS9
Contributor
Contributor

You'll be right.

Now I'm not even sure when it changed from 3d studio to 3d Studio Max.
Maybe it's time for me to retire. 🙂

Anyway, really thank you for thinking about it with me.

0 Likes

denisT.MaxDoctor
Advisor
Advisor

@denisT.MaxDoctor wrote:

But you're right. Biped loses playback performance when the motion panel is open. But we need to suspend messages to the panel... 

 


here is how it works:

callbacks.removescripts id:#qck_play
fn on_qck_play_start = 
(
	suspendEditing which:#motion 
)
fn on_qck_play_end = 
(
	resumeEditing which:#motion 
)

callbacks.addScript #playbackStart "on_qck_play_start()" id:#qck_play
callbacks.addScript #playbackEnd "on_qck_play_end()" id:#qck_play

 

0 Likes

denisT.MaxDoctor
Advisor
Advisor

@jejeparkPDJS9 wrote:

Biped is such an old technology,

So Autodesk no longer seems to bedeveloping Biped.


Biped is still the best tool for editing character animation, especially for human animation done with Motion Capture. Motion Builder does a good job, but requires a longer learning curve, a more skilled team of artists, and more time to work in general. (IMHO)

0 Likes

jejeparkPDJS9
Contributor
Contributor

Wow. It works perfectly.

Simple and beautiful.
There is not even a workbench window error.

I want to wave your hand if you are in front of me. 🙂

Once again, I would like to say thank you.

 

0 Likes

denisT.MaxDoctor
Advisor
Advisor
Accepted solution

@jejeparkPDJS9 wrote:


I want to wave your hand if you are in front of me. 🙂

 


give me a #solution now 😁

 

callbacks.removescripts id:#qck_play

callbacks.addScript #playbackStart "suspendEditing which:#motion" id:#qck_play
callbacks.addScript #playbackEnd "resumeEditing which:#motion" id:#qck_play