Forums: Forum d’aide (Thread #25481)

Welcome to Help (2010-02-19 22:00 by None #48740)

Welcome to Help

Problem with multiple models (2012-07-06 03:12 by urz9999 #64491)

Hi, first i would say thanks for this great library, i'm currently trying do do some tests, nut i've encounter a strange behaviour when trying to load more than one model like this:

Player.models = new MikuMikuDance.Core.Model.MMDModel[12];
for(int i=0; i < 12; i++)
{
Player.models[i] = MMDXCore.Instance.LoadModel("Models/" + CharacterDB.CharaList[i].MODEL + "/" + CharacterDB.CharaList[i].MODEL, Content);
}

it seems that with more than a model the physics engine goes crazy creating some sort of "wind" effect. I tried to search for all the property of both model and MMDXCore but apart from disabling physics i can't find a solution. Really hope for an help! :)

Thx from Italy

Alessandro
Répondre à #48740

RE: Problem with multiple models (2012-07-07 15:44 by wilfrem #64523)

What MMD model are you tring to read?
Répondre à #64491

RE: Welcome to Help (2012-07-07 22:33 by urz9999 #64528)

Hi, thx for responce. Currently i'm trying to load 4 different models:

ISAO summer Rin : http://polymelia.deviantart.com/art/ISAO-Summer-Kagamine-Rin-DL-197086468
Windows 100% Lily: http://www.youtube.com/watch?v=mEeyVmGk1UY
TDA Miku Append (Reconverted in pmd format): http://www.youtube.com/watch?v=eWu3z7tufX4&feature=related
GlaDOS: http://www.youtube.com/watch?v=RNZGQtwGoeA&feature=related

I've tried to load different combinations of models but the result is always some kind of gravity problem having clothes and hair moving up without motion or movement. I've also put a reference tu bulletX.dll in order to have access to the physics property of MMDXCore.Instance but apart from the possibility of change gravity like in MMD the problem remains.

Any hint would be much appreciated. Thx.
Répondre à #48740

RE: Welcome to Help (2012-07-08 00:49 by wilfrem #64531)

I get a pmd model file "ISAO summer Rin".
And I've tried to load it. So, it's work well.

your problem appear when you load more than two pmd models? or load one model too?

if this problem appear when you load two models, it may be caused by "two models are too close"? Hair rigids and other rigids may be collided.

if this problem appear when you load one model, please take a video and snapshot to tell me details.
Répondre à #64528

RE: Welcome to Help (2012-07-08 05:27 by urz9999 #64534)

Hi, the problem appear when i try to load in memory more than one model, as i show in this video:

http://dl.dropbox.com/u/15688892/Video.avi

if i load only one model the physics engine works correctly, if i load more model the weird effect appear.

I think the problem is not dipendent by the model.

Thx for the reply
Répondre à #48740

RE: Welcome to Help (2012-07-08 14:30 by wilfrem #64541)

When you display model, you place visible and invisible models same place?
Physics is also enable if you take models to invisible.

Please check "Rigid" position and behavior using PhysicsDebugDraw class. (Demo2 is How to use it)

Thanks.
Répondre à #64534

RE: Welcome to Help (2012-07-08 17:36 by urz9999 #64544)

Ah! that totally make sense! thx for the help! i'll try as soon as possible thank you very much
Répondre à #48740

RE: Welcome to Help (2012-07-09 21:28 by urz9999 #64558)

Hi, i've tried your suggestion and effectively i can see the bones of the other models even if they are not loaded into the scene! So this could be the cause of the problem, how can i disable physics for invible models?

Thx for the help.
Répondre à #48740

RE: Welcome to Help (2012-07-09 22:56 by urz9999 #64559)

Update: using model.Dispose(); partially resolves the problem but when i try to reload that model using Instance method ( MMDXCore.Instance.LoadModel() ) the program throws an Object Disposed Exception (obviously), also removing rigidBody from instance before loading a new model also partially works because if i return to the old model rigidBodies are gone and it has no physics.
Répondre à #48740

RE: Welcome to Help (2012-07-09 23:38 by urz9999 #64560)

Update 2: Problem Solved! It was actually a problem of Xna ContentManager caching data. Creating a separate contentManager for models and calling this code solved everything:

Player.model.Dispose();
Player.model = null;

this.game.modelContent.Unload(); // This was possible having a separate content manager because it unload everything

Player.model = MMDXCore.Instance.LoadModel("Models/" + CharacterDB.CharaList[d_i].MODEL + "/" + CharacterDB.CharaList[d_i].MODEL, this.game.modelContent);


Thank you very much for the support and the suggestion!
Alessandro
Répondre à #48740