Radiator Springs Racing

Would you like to react to this message? Create an account in a few clicks or log in to continue.

Online Sim Racing netKar PRO


    Merge Materials

    Andrea Lojelo
    Andrea Lojelo
    ---
    ---


    Posts : 12576
    Join date : 2009-04-26
    Age : 45
    Location : Den Haag

    Merge Materials Empty Merge Materials

    Post by Andrea Lojelo Mon Jul 19, 2010 3:28 pm

    this new feature allow you to load settings (light/shaders/trasparencies...) from a previous version of your track.
    For example you can use this method when want to do a fix on your track. Previously, in the early not public release of KofEdit, you should have to do all the settings once more each time you build a new package. This feature is saving a lot of time during development.

    1)import the new track from .ase
    2)save it in kto (myTrackNew.kto)
    3)open the new kto (myTrackNew.kto)
    4)select tool->merge materials and point to the old .kto (myTrackOld.kto)
    5)save the merged kto (myTrack.kto)


    Merge Materials Mergematerials

    NOTE: the new .kto needs to be in your track folder, otherwise it will fail loading. The name could be even a temporary name (myTrackNew.kto).

    How does it work and problem fixing

    This method copy setting from the old kto to the new, based on the name of the object.
    For each object in the new kto will load the settings from objects with the same name on the old kto.


    This will lead to problems in case there are 2 objects on the old kto with the same name but different materials.
    For this reason, be careful with the naming of your objects. Object should be always unique to avoid problems.
    here an example of a merge error
    Merge Materials Mergematerialserr

    in this case in the old kto there were 2 objects called 10Road07. One was with the correct road texture, the other was with a texture of the kerbstone.
    Once the merge is done settings for 10Road07 are done twice, and the last (the kerbstone) will be showed.
    This problem needs to be fixed in the 3d model removing all the duplicates.


    In case your old kto has duplicate objects follow this procedure to fix it:
    1)fix the problem in your 3d model (either renaming or deleting one of he dups. careful not to leave holes.) taking notes of what you are doing (keep track of objects and textures).
    2)export in YourTrackNoDups.kto.
    3)do merge material with YourTrackWithDups.kto
    this will still show the problem because in the YourTrackWithDups.kto settings for the fixed object are still substituted twice (so overwritten).
    4) change manually the settings (texture/shaders and so on)for the objects you fixed.
    5) save the new kto YourTrack.kto. This new kto will contain 1 object with the correct setting, so will not generate problems for the following merge materials.


    Last edited by Andrea Lojelo on Wed Jul 21, 2010 6:12 pm; edited 2 times in total
    Andrea Lojelo
    Andrea Lojelo
    ---
    ---


    Posts : 12576
    Join date : 2009-04-26
    Age : 45
    Location : Den Haag

    Merge Materials Empty Re: Merge Materials

    Post by Andrea Lojelo Mon Jul 19, 2010 5:03 pm

    How to find all duplicates (at least this is how I did it Razz)

    1)open your .kto with koflite.
    2)open the file {nkpro main folder}\loglite.txt
    almost at the end you will find a list of object like

    Compiling wall0728_ID_1 666 T 633 V 1 SC FVF: D3DFVF_DRSVERTEX ( 75516000)
    Compiling wall0729_ID_1 666 T 633 V 1 SC FVF: D3DFVF_DRSVERTEX ( 75516000)
    Compiling wall0730_ID_1 666 T 633 V 1 SC FVF: D3DFVF_DRSVERTEX ( 75516000)

    3)copy those lines in a new file trackObject.txt
    4)open it with excel. choose "delimited" data type, "TAB" "SPACE" delimiters
    5)sort for the column with the object (column B)
    6)create a formula that checks if an object is equal to the following
    =IF(AND(B1=B2,C1<>C2),"dup","ok")

    7)filter for "dup"


    there might be tons of better methods, but this is the one I could think of in 1 minute Razz
    Andrea Lojelo
    Andrea Lojelo
    ---
    ---


    Posts : 12576
    Join date : 2009-04-26
    Age : 45
    Location : Den Haag

    Merge Materials Empty Re: Merge Materials

    Post by Andrea Lojelo Wed Jul 21, 2010 6:11 pm

    Apparently there is a bug (yet to be confirmed by Kunos) on the save kto after the merging. It saves all the settings except shaders.

    What I found out is that, although you can see shaders correctly merged after the Merge Materials operation, once you open once the merged kto (myTrack.kto) again, you will find out that all shaders settings were not saved.


    Luckily, I found a workaround: (EDIT...seems to work, but it's actually not! step 3 is not executed, so at the end it save the old kto)

    1)import the new track from .ase
    2)save it in kto (myTrackNew.kto)
    2.1) close KofLite and open it again
    2.2) open the old kto (myTrackOld.kto)

    3) open the new kto (myTrackNew.kto)
    4) select tool->merge materials and point to the old .kto (myTrackOld.kto)
    5) save the merged kto (myTrack.kto)

    This is working because apparently shaders are saved always from the first kto opened.
    I hope this will help to fix the bug (if present)

    Sponsored content


    Merge Materials Empty Re: Merge Materials

    Post by Sponsored content


      Current date/time is Fri Mar 29, 2024 11:42 am