| We hope you enjoy your visit. You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you are already a member please log in to your account to access all of our features: |
- Pages:
- 1
- 2
| selecting models | |
|---|---|
| Tweet Topic Started: Nov 17 2007, 07:19 PM (959 Views) | |
| MysteriXYZ | Nov 18 2007, 12:43 AM Post #16 |
|
Master Matrix Masher
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Please put the entire following code into the Left Pressed mouse event of the camera and see if you can select object instances by clicking on them:
And don't forget to replace "ModelObject" with the name of the object. |
| U3D is like candy; after extensive consumption, it's Best to brush. | |
![]() |
|
| spiff88 | Nov 18 2007, 01:01 AM Post #17 |
|
Advanced Member
![]() ![]() ![]() ![]() ![]()
|
i put it in the left pressed then put that one code u had before in the step to change the ambient if selected=true nothing happened |
![]() |
|
| MysteriXYZ | Nov 18 2007, 01:31 AM Post #18 |
|
Master Matrix Masher
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Sorry for the late reply, but anyway I just realized that you can't use the mouse events - yeah I'm getting a bit sleepy, :P. Change the event to a keypress event and also replace this:
with this:
Now it should really work (I just tested it). If you have more questions, I'll check them later. |
| U3D is like candy; after extensive consumption, it's Best to brush. | |
![]() |
|
| spiff88 | Nov 18 2007, 07:08 AM Post #19 |
|
Advanced Member
![]() ![]() ![]() ![]() ![]()
|
i have a question that goes off the subject, everything is going smooth now all i need to do is make it save into a model file of U3D format how do i do this, also will it also support lights if any are put in? |
![]() |
|
| MysteriXYZ | Nov 19 2007, 01:55 PM Post #20 |
|
Master Matrix Masher
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
You can only save one model object to a specific *.u3d file; lights cannot be included, or saved to separate *.u3d files. A model object can be exported to an *.u3d file by adding ExportToU3DFile(...) to your code. You should call this function only once (so don't add it to a Step Event or to a loop) and after the model is set up to look exactly the way you want it to be saved. Also keep in mind that certain properties can't be saved, namely those things that are defined by variables. Once you're happy with the exported result (you can check it with Dr. Best's model viewer or U3D Studio), you can remove the ExportToU3DFile(...) function from your project file. You could then continue working with the *.u3d file instead of the original model file. In that case you can also remove the code you used to set the appearance of the exported file, at least anything that's not set up through variables. |
| U3D is like candy; after extensive consumption, it's Best to brush. | |
![]() |
|
| spiff88 | Nov 20 2007, 12:21 AM Post #21 |
|
Advanced Member
![]() ![]() ![]() ![]() ![]()
|
where do i put this? also im not sure what output file means or export resources |
![]() |
|
| MysteriXYZ | Nov 20 2007, 01:02 PM Post #22 |
|
Master Matrix Masher
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
That depends on what you do with the model, to get it to look the way you want it to be saved. It could be as simple as loading the model and immediately exporting it; then you can place the call to ExportToU3DFile(...) right after LoadMesh(), usually in the Create Event. It could also be that you want to save differently coloured versions of the model. Suppose you do that when pressing a certain key, then you would have to call ExportToU3DFile(...) after the call to SetModelMaterial(...) and/or SetModelMaterialEmissive(...) in that key event. Have a look at the last piece of code of the Create Event of the object called "model" in the SDK (basicGM6.gm6/basic.gmd); if you applied this "Optional stuff" and called ExportToU3DFile(...) after those functions, the model would be saved with the resulting changes.
OutputFile is simply the name of the *.u3d file you want to save the model to. If you set ExportResources to true, then all the texture and shader files that your model uses at the moment of export will be included within that *.u3d file. You could then remove these external files from the folder where they currently reside. Be sure to back them up though, as you might need them again later. |
| U3D is like candy; after extensive consumption, it's Best to brush. | |
![]() |
|
| spiff88 | Nov 20 2007, 11:57 PM Post #23 |
|
Advanced Member
![]() ![]() ![]() ![]() ![]()
|
output file is what the model is saved to? or do u mean saved as such as just naming it. |
![]() |
|
| MysteriXYZ | Nov 21 2007, 01:10 PM Post #24 |
|
Master Matrix Masher
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Example: if you want to save the model of a car to a *.u3d file called "MyCar.u3d" (without password and not including external files), use this:
You should then find the file "MyCar.u3d" in the folder from where you ran your program. |
| U3D is like candy; after extensive consumption, it's Best to brush. | |
![]() |
|
| spiff88 | Nov 21 2007, 06:57 PM Post #25 |
|
Advanced Member
![]() ![]() ![]() ![]() ![]()
|
i did this and it made a u3d file so i went back into the program and loaded it up it only loaded one model when in fact i made 3 when saving it wats wrong |
![]() |
|
| MysteriXYZ | Nov 22 2007, 01:49 PM Post #26 |
|
Master Matrix Masher
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
As I stated a couple of posts back, you can only save ONE (1) model to a specific *.u3d file. If the 3 models you are trying to save are instances of the same object, then you need to make the OutputFile string different for each instance, or the output file would get overwritten twice and only contain the model that was exported last. So you need something like this:
The above code uses a local variable "count". It gets its value assigned when creating the instance it belongs to, like this for example:
Now you should find 3 *.u3d files: "MyModel001.u3d", "MyModel002.u3d" and "MyModel003.u3d". |
| U3D is like candy; after extensive consumption, it's Best to brush. | |
![]() |
|
| spiff88 | Nov 22 2007, 06:31 PM Post #27 |
|
Advanced Member
![]() ![]() ![]() ![]() ![]()
|
the point of this program is an object placement level editor where u load models up put them where u want since this would pretty hard in a normal model editor anyway and to where u can make pretty detailed placed levels so i dont want to export each model i want to export them all as one file so it could be like a level, and hay if u got an easier program to make levels and place entities that could be saved compatible with u3d please do tell because i dont have a clue where to find something like that exept by building ur own |
![]() |
|
| MysteriXYZ | Nov 22 2007, 06:53 PM Post #28 |
|
Master Matrix Masher
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Yes, I had already understood that and it's a good initiative.
It's not my fault that you cannot save more than 1 model to a *.u3d file. But you can make your own custom file format using GM's text file functions. You can save any variable data you want that way, and even include a string that you can execute when loading this text file, which in turn loads any number of different *.u3d files in sequence. Anyway, it's just an idea. |
| U3D is like candy; after extensive consumption, it's Best to brush. | |
![]() |
|
| spiff88 | Nov 22 2007, 08:28 PM Post #29 |
|
Advanced Member
![]() ![]() ![]() ![]() ![]()
|
and do u know how to do that? |
![]() |
|
| spiff88 | Nov 22 2007, 10:18 PM Post #30 |
|
Advanced Member
![]() ![]() ![]() ![]() ![]()
|
just had an idea would it be possible to group the models as one like they do in model editors that way theyd only be one model? |
![]() |
|
| « Previous Topic · Questions about Ultimate 3D · Next Topic » |
- Pages:
- 1
- 2





![]](http://z1.ifrm.com/static/1/pip_r.png)



9:38 PM Jul 11