Jump to content


Photo

RE GMModelEx.gmk(GMModelEx.dll)


  • Please log in to reply
2 replies to this topic

#1 pac1jpsnet

pac1jpsnet

    GMC Member

  • GMC Member
  • 32 posts

Posted 16 June 2012 - 01:06 AM

I tried importing the scripts and inserting the script to import parts of a model but only get the same model despite renaming the tmp files.

In the Create Event are two files:
model=d3d_model_load("dinHead.obj","t.tmp");
model=d3d_model_load(""dinFrArm.obj","b.tmp");)

I just get two of the same object. I am uncertain how to use the code outside of the GMModelEx program. I tried using one of the script functions in the Create Event but created errors(sample below). Any help would be awesome!. Thanks. pac1

f = get_open_filename("OBJ Models|*.obj","*.obj");

if (f <> "")
{
var m; m = GMModelEx_ModelImport(f,0);
if(m)
{
GMModelEx_ModelSave(m,"t.tmp", 1);
d3d_model_clear(gmmodel)
d3d_model_load(gmmodel,"t.tmp")
modelex = m;
}
else
show_message("Failed to load the model")
}

//To avoid opening up a window in the start of the game, tried to change from > f = get_open_filename("OBJ Models|*.obj","*.obj"); to
f = ("dinHead.obj,""*.obj") and left the rest alone but that didn't work.
  • 0

#2 pac1jpsnet

pac1jpsnet

    GMC Member

  • GMC Member
  • 32 posts

Posted 17 June 2012 - 02:17 AM

Praise God I just figured it out!

I used GMModex to convert the obj model to d3d then I used Model Creator.exe and created GML script and selected "GML model functions? and for Output "Show in Textbox". I copied the create script and made a script name to create the d3d model, then copied and pasted the draw_event code in the textbox and created the second draw script. Then just using like so made the model load superfast and is much better than a wavefront obj that takes longer to load. Note on the fourth line that reads "dinBkleg_draw();" is where I put the script. Hope this helps someone else. I can also reuse the same script repeatedly to duplicate the model. So wish I found this out sooner!


d3d_transform_add_rotation_x(90+372+229);
d3d_transform_add_rotation_y(direction);
d3d_transform_add_rotation_z(90+482+0);
d3d_transform_add_scaling(1-5*.5,1,1);
d3d_transform_add_translation(x1,y1-140+75,6.5-3*.5-10+16-nillY-9);
dinBkleg_draw();
d3d_transform_set_identity();
direction=180+28+278;
  • 0

#3 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Global Moderators
  • 14397 posts
  • Version:GM:Studio

Posted 17 June 2012 - 04:49 AM

You should post extension specific questions on the extension topic in question. anyway, glad you figured your stuff out.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users