Page 1 of 2

GTA V: Import/Export filter in ZModeler 3.1.0 (10.Aug.15)

Posted: Sun Aug 02, 2015 10:20 am
by Oleg
GTA V Import/Export filter is available in ZModeler 3.1.0


Pre-configuring ZModeler for proper import.

With regard to Scene hierarchy, compound objects and geometries guide you should set up proper compatibility and its options prior to importing. You should do it only once, then restart ZModeler so it saves your configuration.


Importing models

Current version of the filter allows you to import vehicle (car/bike/plane/boat) models into ZModeler. Model should be extracted from the game archive with OpenIV tool. Most of vehicle models you need are located either in DLC packages, or in x64e.rpf -> levels -> gta5 -> vehicles.rpf

Additionally, you should extract common textures pack which are:
vehshare.ytd, vehshare_worn.ytd, vehshare_army.ytd, vehshare_truck.ytd. Some vehicle models could reuse textures from different vehicles. For example, an interior of Buffalo2 model uses textures found in vehicle_schaf_interior.ytd and vehicle_poltax_interior.ytd.

When certain texture is missing, you will see the error message in a log window, but material and texture will be created. Texture will be replaced with a temporary placeholder, you can see them in textures browser in "Missing" group. You can locate missing textures manually and use Replace button to reload actual texture.

Materials could be created with environment reflection on ENVMAP slot which requires spherical reflection texture env.dds to be available. You can use any "spherical environment mapping" texture fond in google, it doesn't actually matter, just rename it to env.dds and ensure this texture is available for ZModeler (can be found in one of "texture serach paths" specified in Settings->Services->Textures page). I recommend to use dark environment texture, so your model will not look over-bright.

Also, with regard to Shaders and materials guide you should download and make available for ZModeler the compiled version of vehicle_genericmud_car.dds image, or use a repacked vehshare.ytd textures package.

The following image is a preferred settings I've used to import buffalo2 model. This is a bit specific to the vehicle itself, as mentioned above extra texture packages are specified to get all required textures loaded.

Note: you can specify as much texture packages to preload as you want. ZModeler will not load textures from these packages, the filter will be able to search for textures in these packages, so this is safe to use a lot of preloaded packs in terms of performance and memory usage.
Import settings
Import settings
LODs (Level of detail) components.

ZModeler3 scene setup and LODs usage is different to what you might have seen in ZModeler2. Objects are combined into compound components, so one object can hold several LODs at a time and, if desired, a collision too. This is a new fashion of designing the scene for mods, there will be no old-school scene setup available.

After you import a model, you should specify which scene state to show. Open Structure panel and press desired LOD button (L0, L1 ... L4) and/or toggle Collision COL state and/or toggle visual effects buttons Dirt, Dust, Burn.

Here's a draft explanation video I've created for you:
_x07ZDfq0BA


Exporting models

Your mod will require model.yft and model_hi.yft files to be created (preferable from the same scene) to replace original vehicle model (or to be installed as a DLC addon). If you have followed the Scene hierarchy and compound objects guide and watched the video above, you are expected to have a scene with compound geometry objects holding meshes for several LODs. It is allowed but strongly not recommended to use the same model for high-detailed version and for lower-detail version. Technically, you can have only one LOD and export your scene to model_hi.yft and export the same scene into model.yft file. This will work, but low performance will be a drawback of such a decision.

The game uses lower-detail model hardly. When your video settings are configured to use very high-detail models, you will see model_hi.yft geometry rendered, but the game will still use LODs from model.yft. At least, the scratches, blood and glass cracks reside on a lower-detail geometry. Additionally, a dynamic shadow is draw using a lower detail geometry than you currently see in game. In terms of L0, L1, L2 this will stand for: the game draws you a geometry of L0, scratches, blood effect and shadow under vehicle resides on L1. When you move away, the geometry will be drawn on L1 and effects on L2. The game will pin to L0 and L1 if you have no other LODs.

In order to export your scene into model_hi.yft and model.yft files, press Export button, pick a desired export format (or pick the file to overwrite). You will see the export options:
17_export_options.jpg
Most of *.yft files have to be exported in Skeletal mode meaning parts will be merged into single "object". When skeletal is Off, parts will be considered as sub-components or destruction stages of the very first hierarchy part. This mode is not used currently, so you should pin to "Skeletal". The second important option you should pay attention to is Export LODs.


Exporting LODs scenarios for your scene

The suggested scenario for an export is to use Autodetect mode for Export LODs option on export. When this mode is used, an exporter will:

Export only highest LOD if you export into a file containing _hi.yft in a tail. Exporter will take a scene root node named the same way as the destination file, or will try to locate the name with no "_hi" in a name. Literally, in attempt to export into my_model_hi.yft, an exporter will try to locate scene node named my_model_hi, or if not found a my_model scene node is the next candidate for export.

Export all nodes except the highest LOD when export file does not contain _hi.yft and your scene has a _hi node in hierarchy. Literally, an export into my_model.yft will export all LODs except the highest one (L0) if your scene contains my_mode_hi node.

Export all LODs when export file does not contain _hi.yft and your scene has no _hi node in hierarchy. Literally, an export into my_model.yft will export all LODs as is (L0, L1...) if your scene contains my_mode node.

Or in short:
model -> model.yft (L0, L1, L2...)
model -> model_hi.yft (L0)
model_hi -> model.yft (L1, L2...)
model_hi -> model_hi.yft (L0)

As you see, it's preferable to have a root node named model_hi, so you have proper LODs stored in files on export.
For your convenience, an exporter will write in a log window which export mode have taken place.

You can explicitly force export scenario ("Export highest lod only", "Export all but highest" or "Export all available") by picking a desired mode in drop-down list in options window. In such a case, a file name you are exporting into must explicitly match the name of the scene node the filter will take for exporting.

An error of Can not locate scene node named "model" for export means the filter can not locate scene object named the same as the file you are exporting into. Rename the node and retry exporting.

With respect to Glass crash data guide, put required *.cwgv files into the folder you will export into. You can use files created by importer in an import folder. You can take these files from a completely different model and can mix files from different models. The exporter will refine data contained in to ensure this will fit into an exported scene setup. When no glass crash data avail, your vehicle glass might suffer of inaccurate drawing of crashed glass with no glass fragments on boundaries. It is Ok for the game, but does not look good.

When everything is read, specify the file name to export into or pick the file to overwrite and press Export. Check the log window for errors or other important messages.

Exported model causing game crash.
Discussed and explained here.


Locking model to prevent re-importing.
As a result of discussion in this topic, a model locking feature is made available. Limitations discussed in a topic are still apply. The locking will prevent a model to be re-imported into ZModeler, it will not save your model from being imported into any other tool. Do not consider this to be a safe/protection/encryption method.

Put the attached XML file into "Install" folder of ZModeler to enable locking feature.

Re: GTA V: Import/Export filter in ZModeler 3.1.0 (10.Aug.15

Posted: Sun Aug 16, 2015 8:36 am
by thegreathah
Will you be adding a lock tool on the modeler soon? Unfortunately people are unwilling to upload work because of this and the community is missing out on many awesome creations because of it.

Re: GTA V: Import/Export filter in ZModeler 3.1.0 (10.Aug.15

Posted: Sun Aug 16, 2015 8:42 am
by Oleg
.yft files can be easily read by OpenIV and a tool that was used months ago to rip models. There is no point in trying to "lock" model, as this can be bypassed in minutes. Sorry on this, but I've made a consideration that I'll not confuse users about a magic ability to "lock" file, while this is technically impossible.

Re: GTA V: Import/Export filter in ZModeler 3.1.0 (10.Aug.15

Posted: Sun Aug 16, 2015 9:06 am
by thegreathah
ok thanks for quick reply.

Re: GTA V: Import/Export filter in ZModeler 3.1.0 (10.Aug.15

Posted: Tue Aug 18, 2015 9:08 am
by victorexpert_
here is download of plugin????

Re: GTA V: Import/Export filter in ZModeler 3.1.0 (10.Aug.15

Posted: Tue Aug 18, 2015 9:36 am
by Oleg
it's included in ZModeler3 download package.

Re: GTA V: Import/Export filter in ZModeler 3.1.0 (10.Aug.15

Posted: Thu Aug 20, 2015 12:11 am
by Chasez
Oleg wrote:.yft files can be easily read by OpenIV and a tool that was used months ago to rip models. There is no point in trying to "lock" model, as this can be bypassed in minutes. Sorry on this, but I've made a consideration that I'll not confuse users about a magic ability to "lock" file, while this is technically impossible.
OpenIV can read V files but doesn't allow ripper to rip them only older version of OpenIV in which GTAV file reader is not available.

Re: GTA V: Import/Export filter in ZModeler 3.1.0 (10.Aug.15

Posted: Thu Aug 20, 2015 12:20 am
by Oleg
they will make .yft import/export soon and any bit of locking will vanish in a moment. with just "export open format", "import open format". 10 seconds at most.

Re: GTA V: Import/Export filter in ZModeler 3.1.0 (10.Aug.15

Posted: Thu Aug 20, 2015 1:43 am
by Chasez
Oleg wrote:they will make .yft import/export soon and any bit of locking will vanish in a moment. with just "export open format", "import open format". 10 seconds at most.
there's no import/export open format for custom .wft files that are locked. Like I said the only way for thieves to get GTA4 models is old OpenIV before security support was implemented. Best part is that if you lock .wft files in OpenIV you can't open them in 3DS Max and zmodeler can't even read them even if they are not locked.

Re: GTA V: Import/Export filter in ZModeler 3.1.0 (10.Aug.15

Posted: Thu Aug 20, 2015 11:46 am
by Oleg
Chasez wrote:there's no import/export open format for custom .wft files that are locked.
..that are locked by OpenIV, not by ZModeler. I guess they just ignore locking of ZModeler as I can't remember that I've specified anywhere how "locked" .wft file differs from "not locked". Or may be I have specified this somewhere...

Re: GTA V: Import/Export filter in ZModeler 3.1.0 (10.Aug.15

Posted: Fri Aug 21, 2015 4:12 pm
by Chasez
Oleg wrote:
Chasez wrote:there's no import/export open format for custom .wft files that are locked.
..that are locked by OpenIV, not by ZModeler. I guess they just ignore locking of ZModeler as I can't remember that I've specified anywhere how "locked" .wft file differs from "not locked". Or may be I have specified this somewhere...
No, if the file is locked in Zmodeler2 OpenFormats cannot open them in 3DS Max. At least I tried to test this and it did not work with my locked mods. except the old OpenIV that can open wft and also allow ripping tools to access it(newer version of OpenIV under ripping tool either crashes or shows a blank screen and doesn't give a ripping option) there is no other way to get locked files.

Re: GTA V: Import/Export filter in ZModeler 3.1.0 (10.Aug.15

Posted: Sat Oct 03, 2015 1:18 am
by _cp_
@Oleg
You should attach lights ID to Shader materials & Textures. And solution for windows tint.

Code: Select all

headlight_l ID = 1
headlight_r ID = 2
taillight_l ID = 3
taillight_r ID = 4
indicator_lf = 5
indicator_rf = 6
indicator_lr ID = 7
indicator_rr ID = 8
brakelight_l = 9
brakelight_r = 10
brakelight_m = 11
reverselight_l = 12
reverselight_r = 13

Re: GTA V: Import/Export filter in ZModeler 3.1.0 (10.Aug.15

Posted: Tue Oct 06, 2015 7:59 am
by RPUCorne
@Oleg Hello

I have an problem with exporting to GTA rage model yft,ydr:
This is the error i get: an not locate scene node named policeb for export. fileGTARageExport.cpp line106

How can i fix that?

Greets

Re: GTA V: Import/Export filter in ZModeler 3.1.0 (10.Aug.15

Posted: Tue Oct 06, 2015 8:07 am
by _cp_
@RPUCorne
Your exported file and dummy name have to be the same.
Image

Re: GTA V: Import/Export filter in ZModeler 3.1.0 (10.Aug.15

Posted: Mon Oct 12, 2015 11:41 am
by Oleg
any material used by geometry must be gta-compatible. materials are converted/prepared with a script that you can find in materials browser under a top-right button with "gears" drawn. there you can pick GTA5-> vehicle-> and the shader that suit your needs.

Default material should not be converted and it should not be used on a geometry you export. Literally, you should create (copy/new) materials, assign them onto your geometry and convert these materials before exporting.

Re: GTA V: Import/Export filter in ZModeler 3.1.0 (10.Aug.15

Posted: Wed Mar 09, 2016 1:27 am
by Oleg
As a response to posts indicating "car spawns duplicates" or when vehicle collisions or other parts get misplaced in game, that looks like a hierarchy bug, a quick fix should be tested first: you should supply a good parts identification database to the filter, so it writes correct part IDs on export. The filter will not report any error or warning when it writes bad IDs into file, as it has no idea whether it writes good or bad IDs. Bad IDs could come from a loading of invalid or buggy file. In order to fix IDs known by ZModeler, you should load several original game vehicles first.

Alternatively, you can use a script with some (most of known/used) predefined IDs. The script is attached to the guide topic here:
viewtopic.php?f=31&t=7343
The XML should be put into "Install" folder of ZModeler, then you start ZM and close it. From that moment on, ZM will use correct IDs on export unless you mess them by loading a bad/corrupt model file again.

Note, the script will clear all known IDs collected in your ZModeler's database, so you might get "Unknown part name..." warnings on export. If you do, locate any original vehicle that uses the parts you get a warning on, then load these original models and restart ZM, so it knows necessary parts too.

Re: GTA V: Import/Export filter in ZModeler 3.1.0 (10.Aug.15

Posted: Sun Mar 20, 2016 5:28 am
by jsjosh225
hey oleg

so I edited the oracle xs a put a lightbar on it and it looks great! but I don't want to keep the same name "oracle" I want to change it to "oraclec" "c" for "cop" and I've been testing it and I changed the texture file, and the .yft file to "oraclec" but when I load it the game crashes.

I've been trying to figure it out. the block of code down below is what I used to add the vehicle in the "vehicle.meta" file

<modelName>oraclec</modelName>
<txdName>oraclec</txdName>
<handlingId>police</handlingId>
<gameName>Oraclec</gameName>
<vehicleMakeName>POLICE</vehicleMakeName>


And I also renamed the files "oraclec.yft" and "oraclec_hi.yft" and "oraclec.ytd" both texuture and lo and hi model files

My game still crashes though. I got one of my older mods to work sum what but it wasn't dedicated to the police, I would be driving around and AI divers would be driving it. basically the mod that I'm making is a car with a light bar and I want it to be its own vehicle without is taking the main "oracle" vehicle place.

the link below is the extra car slots, instructions on hot to do it, and a YouTube tutorial on it - the only issue and me trying to figure it out and how to rename the vehicle or me putting stuff in the wrong slots. I've watched a tutorial on it and followed the instructions on it.

"Extra Vehicle Slots" - Link: https://www.gta5-mods.com/vehicles/more ... o-add-v1-2
"Adding new vehicles to the game" - Link: http://www.lcpdfr.com/forums/topic/5090 ... ow/?page=1
YouTube tutorial for extra vehicle slots - Link: https://www.youtube.com/watch?v=cU71inGhyBE

I've look at all of these and still can't figure it out.

Oleg - if you know anything please PM me or reply to this post -
it would be greatly appreciated!

Re: GTA V: Import/Export filter in ZModeler 3.1.2

Posted: Wed Feb 14, 2018 12:36 pm
by khhh
hi guys
problem my file yft org deleted.now re import file old locked my model
please help me how i can re-import my model locked yft in version zmodeler 3.1.2 build 1123

Re: GTA V: Import/Export filter in ZModeler 3.1.0 (10.Aug.15

Posted: Thu Feb 15, 2018 2:57 am
by Oleg
you can't, the file is locked.

Re: GTA V: Import/Export filter in ZModeler 3.1.0 (10.Aug.15

Posted: Sat Jul 14, 2018 12:53 pm
by Neos7
I've scanned all the bones of the skeletons from yft,ydr,ydd using a vanilla and updated (to mpassault) copy of the game
This is a list of all the bone ids I've found https://w.wew.wtf/exeuun.txt
format is:

Code: Select all

string id
Also a friend found this

Code: Select all

unsigned int ElfHash_Uppercased(const char* boneName)
{
    char c = *boneName;
    unsigned int hash = 0, high;
    while (c)
    {
        if ((unsigned char)(c - 'a') <= 25u) // to uppercase
            c -= 32;

        hash = (hash << 4) + c;
        if (high = hash & 0xF0000000)
            hash ^= high >> 24;
        hash &= ~high;

        ++boneName;
        c = *boneName;
    }
    return hash;
}
unsigned short CalculateBoneHash(const char* boneName)
{
    return ElfHash_Uppercased(boneName) % 0xFE8F + 0x170;
}
which should is how the bone ID is calculated from the name, although the SKEL_*, FB_* and RB_* bone IDs seems to be generated differently

Re: GTA V: Import/Export filter in ZModeler 3.1.0 (10.Aug.15

Posted: Sat Jul 14, 2018 2:20 pm
by Oleg
@Neos7, even thought your work on part names collection was significant and time consuming, the finding of your friend has even greater value. I've added bone hash generator into a filter and got rid of bone IDs collection routines (left them for specific cases like SKEL_*, FB_*, FACIAL_*, and some others).

Part names collection can be cleared in Settings->Profile->Editor->Preferences->Filters->GtaRage->parts >> "Delete selected branch".

Thanks!

Re: GTA V: Import/Export filter in ZModeler 3.1.0 (10.Aug.15

Posted: Sat Jul 14, 2018 8:32 pm
by Neos7
Don't worry I left it scanning while having a shower, anyway the list is still useful to get which aren't matching the hash like SKEL_* and the rest

Re: GTA V: Import/Export filter in ZModeler 3.1.0 (10.Aug.15

Posted: Tue Jul 17, 2018 10:20 pm
by Gta5KoRn
@Oleg where to find this generator? or is this an automatic process?

Re: GTA V: Import/Export filter in ZModeler 3.1.0 (10.Aug.15

Posted: Tue Jul 17, 2018 11:43 pm
by Neos7
I guess the exporter will handle this automatically on export.

Re: GTA V: Import/Export filter in ZModeler 3.1.0 (10.Aug.15

Posted: Wed Jul 18, 2018 2:13 am
by Oleg
yes this is an automatic. bone IDs will get generated automatically, unless their name starts with SKEL_*, FB_*, FACIAL_*, and some others.