Quantcast

Jump to content

» «
Photo

[REL|BIN/SRC|Beta] SparkIV

910 replies to this topic
jjcoolj91
  • jjcoolj91

    "Snipin's a good job mate...Challenging Work."

  • Members
  • Joined: 13 Nov 2007

#481

Posted 28 February 2009 - 01:39 AM

QUOTE (aru @ Feb 27 2009, 18:10)
Some very nice work here guys... I'll try to see how much of this I can reintegrate back into the SparkIV codebase and also try to add bones/skeleton support.

QUOTE (uomoartificiale)
I don't know how to contact the author of this wonderful tool, so I post my contribution here hoping he could notice.


PM here, or my email is also available in the readme.txt file smile.gif

this is, THE BEST NEWS i have heard all day, i hope you can do that aru for us

solecist
  • solecist

    Player Hater

  • Members
  • Joined: 06 Dec 2008

#482

Posted 28 February 2009 - 07:23 AM

agh, when will we be able to import audio? the waiting is makin me crazy!

simkas
  • simkas

    That guy

  • Members
  • Joined: 13 Dec 2006

#483

Posted 28 February 2009 - 09:07 AM

Would it be possible to make that importer not import the whole model as one mesh? Because for example the multiplayer character models have all the different head models and all the hair/facial hair models in one part and you can't even seperate them by selecting seperate elements.

uomoartificiale
  • uomoartificiale

    Player Hater

  • Members
  • Joined: 24 Feb 2009

#484

Posted 28 February 2009 - 11:37 AM

1) Well, actually I suppose that the second version I posted (http://www.gtaforums...entry1059008508) should produce a smd file starting with:

CODE
version 1
nodes
0 model_bone -1
end
skeleton
time 0
0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
end


followed by the list of 3d vertices/faces:

CODE
triangles
LOWR_DIFF_001_A_UNI
0 -0.1582031 0.1806641 -0.9736328 0.8554688 -0.3359375 -0.390625 0.4984436 -0.3108063
0 -0.1801758 0.1079102 -0.9594727 0.8554688 -0.3359375 -0.390625 0.4974518 -0.3065338
0 -0.1914063 0.08349609 -0.9633789 0.8554688 -0.3359375 -0.390625 0.4968109 -0.3051605
LOWR_DIFF_001_A_UNI
0 -0.159668 0.1499023 -0.04492188 -0.1796875 -0.1171875 0.9765625 0.1687317 -0.006622314
0 -0.1967773 0.04052734 -0.07958984 -0.25 -0.25 0.9375 0.2462158 -0.0050354
0 0.006347656 0.02539063 -0.02978516 0 -0.2695313 0.9609375 0.2184601 -0.003845215
LOWR_DIFF_001_A_UNI
0 0.1704102 0.1811523 -0.9746094 -0.09375 -0.2304688 -0.96875 0.5062256 -0.3288879
0 0.2133789 0.09033203 -0.9570313 -0.09375 -0.2304688 -0.96875 0.5068054 -0.3235321
0 0.1923828 0.1079102 -0.9594727 -0.09375 -0.2304688 -0.96875 0.5058899 -0.3247681
LOWR_DIFF_001_A_UNI
0 0.06494141 0.06054688 -0.9589844 0.01171875 -0.1523438 -0.9882813 0.4968262 -0.3247681
0 0.08105469 0.1704102 -0.9755859 0.01171875 -0.1523438 -0.9882813 0.5003967 -0.3299713
0 0.08251953 0.1049805 -0.965332 0.01171875 -0.1523438 -0.9882813 0.4989777 -0.3266907

[[[... more and more stuff like this...]]]

end


Do your exported files follow this template?

I post the output of the first ped in the componentpeds.img archive, the one named: f_m_business_01.wdd (middle-age woman): http://rapidshare.co...5551/output.zip
please confront your output with mine.

2) In max you can select the model then go to the modifier tab (left panel); then select the edit_mesh block (a warning message will pop-up: ignore it); select "element"; then select the different parts.

3) sorry aru I was probably blinded by the deprivation of sleep. I'm writing you right now.

By the way, yes I'm italian. colgate.gif

simkas
  • simkas

    That guy

  • Members
  • Joined: 13 Dec 2006

#485

Posted 28 February 2009 - 03:33 PM

QUOTE (uomoartificiale @ Feb 28 2009, 11:37)
2) In max you can select the model then go to the modifier tab (left panel); then select the edit_mesh block (a warning message will pop-up: ignore it); select "element"; then select the different parts.

I said in my post that I can't even select the seperate heads in the MP character mesh even when using the element selection.

simkas
  • simkas

    That guy

  • Members
  • Joined: 13 Dec 2006

#486

Posted 28 February 2009 - 05:57 PM

By the way, aru, could you add in something similar to the "change levels" function in OpenIV in the next version?

Crap, double post.

mcal9909
  • mcal9909

    Player Hater

  • Members
  • Joined: 23 Feb 2009

#487

Posted 02 March 2009 - 11:25 PM

Hmm i got a problem with spark 0.6.2, it wont load anymore! sad.gif
it used to work as i used to it import the fual pump icons for the fuel mod thats on here, that was a week or so ago.
now when i click the icon it crashes straight away confused.gif

this is the only info i could copy from the error report
CODE
EventType : clr20r3     P1 : sparkiv.exe     P2 : 0.6.2.0     P3 : 49a24ac6
P4 : mscorlib     P5 : 2.0.0.0     P6 : 4889dc80     P7 : 343f     P8 : 119
P9 : system.io.directorynotfound


any ideas? i tried redownloading it and extracting again but no joy.

aru
  • aru

    *poof*

  • Members
  • Joined: 20 Jun 2005

#488

Posted 03 March 2009 - 08:13 AM

@solecist... no ETA on audio import.

@simkas... should be able to seperate WDD models into separate export.. wouldn't be that hard.

Changing levels is really an odd feature that I don't want to support because it assumes that space is allocated for the extra levels if increasing (and its not always true), and it wastes memory space anyway when decreasing levels because all the existing data is still there. Changing levels should mean regenerating the entire texture memory data, which is better suited to an app like G-Texture.

@mcal9909.. did you delete/reinstall GTAIV recently? It looks like its trying to find some directory and failing. I'd think its trying to find your GTAIV directory from your registry and failing. Try putting a gtaiv.exe in the same directory as SparkIV.

mcal9909
  • mcal9909

    Player Hater

  • Members
  • Joined: 23 Feb 2009

#489

Posted 03 March 2009 - 01:09 PM Edited by mcal9909, 03 March 2009 - 01:20 PM.

QUOTE (aru @ Mar 3 2009, 08:13)
@mcal9909.. did you delete/reinstall GTAIV recently? It looks like its trying to find some directory and failing. I'd think its trying to find your GTAIV directory from your registry and failing. Try putting a gtaiv.exe in the same directory as SparkIV.

Thanks dude it worked, didnt reinstall it tho my hdd did fail a few days ago and decided to change drive letter so i guess that was the problem. but all is working now smile.gif

found the reg entry and yeah.. was showing f: instead of d: changed it and now works without the exe in the folder

DerPlaya78
  • DerPlaya78

    Player Hater

  • Members
  • Joined: 04 Jan 2009

#490

Posted 05 March 2009 - 08:16 PM

I coded a basic COLLADA exporter for SparkIV.

Here's the source for a modified RageLib.Models.dll

http://rapidshare.co....Models.7z.html

The new files are in the COLLADA subdir + export button code in ModelViewController and ModelView...

This is not really finished, just a proof-of-concept (and won't be, don't have much time).

For anyone who's interested here is what i did:
- downloaded the COLLADA schema from http://www.collada.o...1/COLLADASchema
- removed some stuff from xsd file until the VS included xsd.exe could produce a CS classes file
- cleaned the .cs and removed probably unused classes
- wrote Exporter class which takes the data from a ModelNode and its Children and creates a COLLADA object, serializes this object with XMLSerializer into dae file and exports textures

I only tested vehicle files...
Normal map info is not exported because COLLADA format seems to have no standard format for normal maps and the proper way would be using the same shaders as the game. (i'm just using the first texture param for material...)

Switch_Designs
  • Switch_Designs

    WWW.GTAFORLIFE.COM

  • BUSTED!
  • Joined: 18 Aug 2003

#491

Posted 06 March 2009 - 06:13 PM Edited by Switch_Designs, 06 March 2009 - 06:15 PM.

I need the ability to delete textures from a wtd file or to add new ones or at least the ability to rename a texture in a wtd file. My reason for needing this is for an example i could take a ped model and say replace it with a ped stripper model but say the ped model has 10 variations of model parts to the model if i can delete textures then certian model parts for the different model variations will not show up leaving me with just the parts i wanna see... I know this sounds complicated but thru testing I have seen that this will work and as modding gtaiv advances we will need an ability to delete rename and add textures to wtd files not just replace.....

As of right now I would just be happy with a delete option in the edit function for wtd files in spark iv.... I NEED TO DELETE TEXTURES.

I have made this work so far by taking a wtd file from a different model and loading the textures into it.... Actually never mind me tring to explain how I made a custom texture file or why I want too it will hurt my brain too much to explain.

I sent a pm about this request but did not get a reply hope you see this!

Again I need to delete textures from a wtd file please help! (as in completely remove the texture and texture name from the wtd file.)

Gforce
  • Gforce

    "Segregate and Rearrange" "The Hills"

  • Feroci Racing
  • Joined: 17 Sep 2003
  • United-Kingdom

#492

Posted 07 March 2009 - 02:32 AM

i've been asking him for weeks (2 months !!! ) on irc for add/delete/rename features in SparkIV.

doing any kind of real modding experiments in IV is pretty much impossible without them and flicking between OpenIV and SparkIV is too much of a headache, so i just don't bother trying confused.gif

Rich246
  • Rich246

    A Custom What?

  • Members
  • Joined: 20 May 2008
  • United-States

#493

Posted 07 March 2009 - 01:26 PM Edited by Rich246, 07 March 2009 - 01:31 PM.

I am getting this error pretty much out of the blue:

I have the newest SparkIV, with Windows Vista Home Premium X64, no problems up untill now

I get this error when I try to view any kind of model.

CODE
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.TypeInitializationException: The type initializer for 'System.Windows.Media.Animation.Storyboard' threw an exception. ---> System.TypeLoadException: Could not load type 'System.Windows.FreezeValueCallback' from assembly 'WindowsBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
  at System.Windows.Media.Animation.Storyboard..cctor()
  --- End of inner exception stack trace ---
  at System.Windows.Media.Animation.Storyboard.GetComplexPathValue(DependencyObject targetObject, DependencyProperty targetProperty, EffectiveValueEntry& entry, PropertyMetadata metadata)
  at System.Windows.FrameworkElement.EvaluateBaseValueCore(DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry& newEntry)
  at System.Windows.DependencyObject.EvaluateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry newEntry, OperationType operationType)
  at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, OperationType operationType)
  at System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp)
  at System.Windows.FrameworkElement.UpdateStyleProperty()
  at System.Windows.FrameworkElement.OnInitialized(EventArgs e)
  at System.Windows.FrameworkElement.TryFireInitialized()
  at System.Windows.FrameworkElement.AddLogicalChild(Object child)
  at System.Windows.Controls.Decorator.set_Child(UIElement value)
  at System.Windows.Documents.AdornerDecorator.set_Child(UIElement value)
  at System.Windows.Forms.Integration.ElementHost..ctor()
  at RageLib.Models.ModelView.InitializeComponent()
  at RageLib.Models.ModelView..ctor()
  at SparkIV.Viewer.Models.ModelViewer.CreateControl(File file, IModelFile modelfile)
  at SparkIV.Viewer.Models.ModelViewer.GetView(File file)
  at SparkIV.Viewer.Viewers.GetControl(File file)
  at SparkIV.MainForm.PreviewFile(File file)
  at SparkIV.MainForm.PreviewOrEditFile(File file)
  at SparkIV.MainForm.lvFiles_MouseDoubleClick(Object sender, MouseEventArgs e)
  at System.Windows.Forms.Control.OnMouseDoubleClick(MouseEventArgs e)
  at System.Windows.Forms.ListView.WndProc(Message& m)
  at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
  at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
  at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
   Assembly Version: 2.0.0.0
   Win32 Version: 2.0.50727.3074 (QFE.050727-3000)
   CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
SparkIV
   Assembly Version: 0.6.2.0
   Win32 Version: 0.6.2.0
   CodeBase: file:///C:/Users/Rich/Desktop/GTA%20IV%20Tools/SparkIV/SparkIV.exe
----------------------------------------
System.Windows.Forms
   Assembly Version: 2.0.0.0
   Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
   CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
   Assembly Version: 2.0.0.0
   Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
   CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
   Assembly Version: 2.0.0.0
   Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
   CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
RageLib.Common
   Assembly Version: 0.6.2.0
   Win32 Version: 0.6.2.0
   CodeBase: file:///C:/Users/Rich/Desktop/GTA%20IV%20Tools/SparkIV/RageLib.Common.DLL
----------------------------------------
RageLib.FileSystem
   Assembly Version: 0.6.2.0
   Win32 Version: 0.6.2.0
   CodeBase: file:///C:/Users/Rich/Desktop/GTA%20IV%20Tools/SparkIV/RageLib.FileSystem.DLL
----------------------------------------
System.Xml
   Assembly Version: 2.0.0.0
   Win32 Version: 2.0.50727.3074 (QFE.050727-3000)
   CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Configuration
   Assembly Version: 2.0.0.0
   Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
   CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
xfvo4q0o
   Assembly Version: 0.6.2.0
   Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
   CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
RageLib.Models
   Assembly Version: 0.6.2.0
   Win32 Version: 0.6.2.0
   CodeBase: file:///C:/Users/Rich/Desktop/GTA%20IV%20Tools/SparkIV/RageLib.Models.DLL
----------------------------------------
ICSharpCode.SharpZipLib
   Assembly Version: 0.85.5.452
   Win32 Version: 0.85.5.452
   CodeBase: file:///C:/Users/Rich/Desktop/GTA%20IV%20Tools/SparkIV/ICSharpCode.SharpZipLib.DLL
----------------------------------------
RageLib.Textures
   Assembly Version: 0.6.2.0
   Win32 Version: 0.6.2.0
   CodeBase: file:///C:/Users/Rich/Desktop/GTA%20IV%20Tools/SparkIV/RageLib.Textures.DLL
----------------------------------------
PresentationFramework
   Assembly Version: 3.0.0.0
   Win32 Version: 3.0.6920.1500 built by: QFE
   CodeBase: file:///C:/Windows/assembly/GAC_MSIL/PresentationFramework/3.0.0.0__31bf3856ad364e35/PresentationFramework.dll
----------------------------------------
PresentationCore
   Assembly Version: 3.0.0.0
   Win32 Version: 3.0.6920.1500 built by: QFE
   CodeBase: file:///C:/Windows/assembly/GAC_32/PresentationCore/3.0.0.0__31bf3856ad364e35/PresentationCore.dll
----------------------------------------
WindowsBase
   Assembly Version: 3.0.0.0
   Win32 Version: 3.0.6920.1109 (lh_tools_devdiv_wpf.071009-1109)
   CodeBase: file:///C:/Windows/assembly/GAC_MSIL/WindowsBase/3.0.0.0__31bf3856ad364e35/WindowsBase.dll
----------------------------------------
WindowsFormsIntegration
   Assembly Version: 3.0.0.0
   Win32 Version: 3.0.6920.1109 (lh_tools_devdiv_wpf.071009-1109)
   CodeBase: file:///C:/Windows/assembly/GAC_MSIL/WindowsFormsIntegration/3.0.0.0__31bf3856ad364e35/WindowsFormsIntegration.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
   <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.



I pasted it all, because I do not know what is important and what is not

Switch_Designs
  • Switch_Designs

    WWW.GTAFORLIFE.COM

  • BUSTED!
  • Joined: 18 Aug 2003

#494

Posted 07 March 2009 - 11:04 PM Edited by Switch_Designs, 07 March 2009 - 11:04 PM.

QUOTE (Gforce @ Mar 7 2009, 02:32)
i've been asking him for weeks (2 months !!! ) on irc for add/delete/rename features in SparkIV.

doing any kind of real modding experiments in IV is pretty much impossible without them and flicking between OpenIV and SparkIV is too much of a headache, so i just don't bother trying confused.gif

Well I have some really great mods waiting on an add/delete/rename feature and all i need now is to have the ability!

the hubster
  • the hubster

    Sup Homies

  • Members
  • Joined: 03 May 2005

#495

Posted 08 March 2009 - 12:30 PM

QUOTE (Switch_Designs @ Mar 6 2009, 18:13)
I need the ability to delete textures from a wtd file or to add new ones or at least the ability to rename a texture in a wtd file. My reason for needing this is for an example i could take a ped model and say replace it with a ped stripper model but say the ped model has 10 variations of model parts to the model if i can delete textures then certian model parts for the different model variations will not show up leaving me with just the parts i wanna see... I know this sounds complicated but thru testing I have seen that this will work and as modding gtaiv advances we will need an ability to delete rename and add textures to wtd files not just replace.....

As of right now I would just be happy with a delete option in the edit function for wtd files in spark iv.... I NEED TO DELETE TEXTURES.

I have made this work so far by taking a wtd file from a different model and loading the textures into it.... Actually never mind me tring to explain how I made a custom texture file or why I want too it will hurt my brain too much to explain.

I sent a pm about this request but did not get a reply hope you see this!

Again I need to delete textures from a wtd file please help! (as in completely remove the texture and texture name from the wtd file.)

The tool G-Texture posted in this forum can do this for wtd

bbydino05
  • bbydino05

    Player Hater

  • Members
  • Joined: 05 Nov 2008

#496

Posted 08 March 2009 - 02:05 PM

yes is there a way i can mod with the latest patch cause i used the new york mod and it worked fine but if i want to do a suit mod it wont let me please respond

gtaps2modder
  • gtaps2modder

    Crackhead

  • Members
  • Joined: 13 Feb 2009

#497

Posted 08 March 2009 - 07:19 PM

aru, can you help me a bit?

I know that PC resources has got Zlib compression, but what about Xbox360 resources? What is compression type?

gamerzworld
  • gamerzworld

    Why did I move here? I guess it was to bounce.

  • Members
  • Joined: 29 Nov 2005

#498

Posted 08 March 2009 - 07:20 PM

QUOTE (gtaps2modder @ Mar 8 2009, 14:19)
aru, can you help me a bit?

I know that PC resources has got Zlib compression, but what about Xbox360 resources? What is compression type?

Zlib as well I believe.

gtaps2modder
  • gtaps2modder

    Crackhead

  • Members
  • Joined: 13 Feb 2009

#499

Posted 09 March 2009 - 04:42 AM

Zlib is used on PC... On Xbox360 compresion is different.

I started work on XTD viewer. Pixel format differentses between Xbox360 and PC textures writen in SparkIV sources. But there is no info about RES compression...

Millenia
  • Millenia

    Gunz 'R Us

  • Members
  • Joined: 12 Aug 2005

#500

Posted 09 March 2009 - 05:57 AM

QUOTE (Switch_Designs @ Mar 6 2009, 18:13)
I need the ability to delete textures from a wtd file or to add new ones or at least the ability to rename a texture in a wtd file. My reason for needing this is for an example i could take a ped model and say replace it with a ped stripper model but say the ped model has 10 variations of model parts to the model if i can delete textures then certian model parts for the different model variations will not show up leaving me with just the parts i wanna see... I know this sounds complicated but thru testing I have seen that this will work and as modding gtaiv advances we will need an ability to delete rename and add textures to wtd files not just replace.....

As of right now I would just be happy with a delete option in the edit function for wtd files in spark iv.... I NEED TO DELETE TEXTURES.

I have made this work so far by taking a wtd file from a different model and loading the textures into it.... Actually never mind me tring to explain how I made a custom texture file or why I want too it will hurt my brain too much to explain.

I sent a pm about this request but did not get a reply hope you see this!

Again I need to delete textures from a wtd file please help! (as in completely remove the texture and texture name from the wtd file.)

Use G-Texture to delete stuff from the WTD.

Rich246
  • Rich246

    A Custom What?

  • Members
  • Joined: 20 May 2008
  • United-States

#501

Posted 10 March 2009 - 01:36 AM

Sorry to bump, but I am having a problem with SparkIV, I posted in this thead...

here is a link to the post
http://www.gtaforums...st&p=1059038313

Thanks,
Rich

DerPlaya78
  • DerPlaya78

    Player Hater

  • Members
  • Joined: 04 Jan 2009

#502

Posted 10 March 2009 - 11:27 PM Edited by DerPlaya78, 11 March 2009 - 06:30 PM.

@aru:

...little info on wft model hierachy:

Add RageLib.Models.HierachyNode
CODE

using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using RageLib.Common;
using RageLib.Common.Resources;

namespace RageLib.Models
{
   public class HierachyNode : IFileAccess
   {
       public uint Offset { get; private set; }
       public uint NameOffset { get; private set; }
       public string Name { get; private set; }
       public uint Unknown { get;private set; }
       public HierachyNode Sibling { get; private set; }
       public HierachyNode FirstChild { get; private set; }
       public HierachyNode Parent { get; private set; }

       public HierachyNode(BinaryReader br) {
           Read(br);
       }

       public HierachyNode(BinaryReader br, HierachyNode parent)
       {
           Parent = parent;
           Read(br);
       }

       #region IFileAccess Members

       public void Read(BinaryReader br)
       {
           Offset = (uint)br.BaseStream.Position;
           NameOffset = ResourceUtil.ReadOffset(br);
           long _position = br.BaseStream.Position;
           br.BaseStream.Seek(NameOffset, SeekOrigin.Begin);
           Name = ResourceUtil.ReadNullTerminatedString(br);
           br.BaseStream.Position = _position;

           Unknown = br.ReadUInt32();

           uint _siblingOffset = ResourceUtil.ReadOffset(br);
           if (_siblingOffset > 0)
           {
               _position = br.BaseStream.Position;
               br.BaseStream.Seek(_siblingOffset, SeekOrigin.Begin);
               Sibling = new HierachyNode(br);
               br.BaseStream.Position = _position;
           }

           uint _firstChildOffset = ResourceUtil.ReadOffset(br);
           if (_firstChildOffset > 0)
           {
               _position = br.BaseStream.Position;
               br.BaseStream.Seek(_firstChildOffset, SeekOrigin.Begin);
               FirstChild = new HierachyNode(br);
               FirstChild.Parent = this;
               br.BaseStream.Position = _position;
           }

           uint _parentOffset = ResourceUtil.ReadOffset(br);
           if (_parentOffset > 0 && Parent != null)
           {
               if (_parentOffset != Parent.Offset) throw new Exception("parent missmatch");
           }
       }

       public void Write(BinaryWriter bw)
       {
           throw new NotImplementedException();
       }

       #endregion
   }
}


replace UnDocInfo in DrawableModel...
CODE

           br.BaseStream.Seek(modelInfoOffset, SeekOrigin.Begin);
           uint HierachyOffset = ResourceUtil.ReadOffset(br);
           br.BaseStream.Seek(HierachyOffset, SeekOrigin.Begin);
           ModelInfo = new HierachyNode(br);


aru
  • aru

    *poof*

  • Members
  • Joined: 20 Jun 2005

#503

Posted 11 March 2009 - 09:45 PM

@DerPlaya78, thats the skeleton/bone hierarchy and it exists for any drawable (not just wfts). I have it implemented it into my local working copy already, just haven't checked it in yet smile.gif Its coming soon I suppose.. I'll try to merge in your Collada export as well as the audio changes as well.. thanks for them!

@Rich246... no idea what that bug is about... I'd suggest trying to reinstall .NET framework 3.5

@Gforce/Switch_Designs... add/del/rename is in the plan as well... just too many feature requests, and too little people to code them smile.gif

Rich246
  • Rich246

    A Custom What?

  • Members
  • Joined: 20 May 2008
  • United-States

#504

Posted 12 March 2009 - 12:25 PM

@aru I already tried doing that, I even installed Sp1 for .net 3.5

DerPlaya78
  • DerPlaya78

    Player Hater

  • Members
  • Joined: 04 Jan 2009

#505

Posted 17 March 2009 - 10:42 PM Edited by DerPlaya78, 18 March 2009 - 09:03 PM.

@aru: some more stuff about models...

RageLib.Models.Resource.Shaders.ShaderParamNames.ShaderParamNames
- corresponds to the hash of names stored in fxc files

RageLib.Models.Resource.MaterialInfoDataID
- hashes are also in fxc files, there are many more possible texture types/names (dirtTexture, DamageTexture, etc)

RageLib.Models.Resource.Models.Geometry.Unknown9 is an offset (ResourceUtil)
- RageLib.Models.Resource.Models.Geometry.Unknown10 is the count of entries of the table at that offset
- the table consists of short values which seem to be indices into the bone structure (flattened)
- the blendindicies in VertexBuffers seem to be indexes into this table...

PROOF: http://img23.imagesh.../admiralwft.jpg

more stuff in FragTypeChild:
CODE

public void Read(BinaryReader br)
{
   br.BaseStream.Seek(0x90, SeekOrigin.Current);

   uint offset = ResourceUtil.ReadOffset(br);
   if (offset != 0)
   {
  /* unknown start */
  Unknown = br.ReadUInt32();
  UnknownOffsets1 = new uint[4];
  UnknownInts = new uint[4];
  for (int i = 0; i < 4; i++) {
      UnknownOffsets1[i] = ResourceUtil.ReadOffset(br);
  }
  for (int i = 0; i < 4; i++)
  {
      UnknownInts[i] = br.ReadUInt32();
  }
  UnknownOffset2 = ResourceUtil.ReadOffset(br);
 
  UnknownBytes1 = br.ReadBytes(200);
  UnknownOffset3 = ResourceUtil.ReadOffset(br);
 
  UnknownBytes2 = br.ReadBytes(200);
  UnknownOffset4 = ResourceUtil.ReadOffset(br);
  /* unknown end */
...


more stuff in FragTypeModel::Read()

CODE

   UnknownDamageData = new UnknownDamageData[childCount];
   br.BaseStream.Seek(208, SeekOrigin.Begin);
   uint unknownDamageDataOffset = ResourceUtil.ReadOffset(br);
   if (unknownDamageDataOffset > 0) {
       for (int i = 0; i < childCount; i++)
       {
           br.BaseStream.Seek(unknownDamageDataOffset + i * 4, SeekOrigin.Begin);
           UnknownDamageData[i] = new UnknownDamageData(br);
       }            
   }
...


and more

CODE

   public class UnknownDamageData : IFileAccess
   {
       public uint Offset { get; private set; }
       public byte[] UnknownBytes { get; private set; }    // 192
       public uint UnknownInt { get; private set; }
       public byte[] UnknownBytes2 { get; private set; }    // 12
       
       public float[] UnknownFloats { get; private set; } // [13] Weight ?
       public uint[] UnknownInts { get; private set; } // 2
       public float[] UnknownFloats2 { get; private set; } // 2
       public string Name { get; private set; }

       public UnknownDamageData(BinaryReader br) {
           Read(br);
       }
       
       #region IFileAccess Members

       public void Read(System.IO.BinaryReader br)
       {
           Offset = ResourceUtil.ReadOffset(br);
           br.BaseStream.Seek(Offset, SeekOrigin.Begin);

           UnknownBytes = br.ReadBytes(192);
           UnknownInt = br.ReadUInt32();
           UnknownBytes2 = br.ReadBytes(12);
           
           UnknownFloats = new float[15];
           for (int i = 0; i < 15; i++) UnknownFloats[i] = br.ReadSingle();

           UnknownInts = new uint[2];
           for (int i = 0; i < 2; i++) UnknownInts[i] = br.ReadUInt32();

           UnknownFloats2 = new float[2];
           for (int i = 0; i < 2; i++) UnknownFloats2[i] = br.ReadSingle();
           Name = ResourceUtil.ReadNullTerminatedString(br);
       }
...

JostVice
  • JostVice

    realtime, not prerendered

  • Feroci Racing
  • Joined: 30 Oct 2005
  • None

#506

Posted 17 March 2009 - 10:44 PM

QUOTE (DerPlaya78 @ Mar 17 2009, 23:42)

RageLib.Models.Resource.MaterialInfoDataID
- hashes are also in fxc files, there are many more possible texture types/names (dirtTexture, DamageTexture, etc)

That is pretty interesting, could you give more info about all the types/names of texture there are? Any example of model with them?

DerPlaya78
  • DerPlaya78

    Player Hater

  • Members
  • Joined: 04 Jan 2009

#507

Posted 17 March 2009 - 10:55 PM

these are just textures referenced in the shaders:
- some are ordinary textures contained in the wtd files and processed in a special way by vertex/pixel shaders (dirt texture + diffuse texture + dirt color = dirty car wink.gif
- others are generated dynamically by vertex shaders (damageTexture)

you can take a look at the shaders with this http://www.gtagarage...how.php?id=5793

until we can use the shaders this is pretty useless info...

jjcoolj91
  • jjcoolj91

    "Snipin's a good job mate...Challenging Work."

  • Members
  • Joined: 13 Nov 2007

#508

Posted 19 March 2009 - 12:20 AM

just a question for aru

I was wondering what you are starting to make as we havent heard much update from ya

DerPlaya78
  • DerPlaya78

    Player Hater

  • Members
  • Joined: 04 Jan 2009

#509

Posted 19 March 2009 - 04:27 PM

@aru:
small change to DrawableModel:
- add uint Offset Property to Resource.Skeletons
- make Drawable.Skeleton in FragTypeModel a static Member of FragTypeModel
- assign it to FragTypeChild.Drawable.Skeleton before FragTypeChild.Drawable.Read()

This way you read the skeleton just once if it is the same for all FragTypeChilds (which it is in vehicle files)
CODE

           if (Skeleton == null || Skeleton.Offset != skeletonOffset) {
               if (skeletonOffset != 0)
               {
                   br.BaseStream.Seek(skeletonOffset, SeekOrigin.Begin);
                   Skeleton = new Skeleton();
                   Skeleton.Offset = skeletonOffset;
                   Skeleton.Read(br);
               }
           }

this is only true for FragTypeModel and makes no difference for ModelFile and ModelDictionary...

jjcoolj91
  • jjcoolj91

    "Snipin's a good job mate...Challenging Work."

  • Members
  • Joined: 13 Nov 2007

#510

Posted 20 March 2009 - 07:44 PM

QUOTE (DerPlaya78 @ Mar 19 2009, 09:27)
@aru:
small change to DrawableModel:
- add uint Offset Property to Resource.Skeletons
- make Drawable.Skeleton in FragTypeModel a static Member of FragTypeModel
- assign it to FragTypeChild.Drawable.Skeleton before FragTypeChild.Drawable.Read()

This way you read the skeleton just once if it is the same for all FragTypeChilds (which it is in vehicle files)
CODE

           if (Skeleton == null || Skeleton.Offset != skeletonOffset) {
               if (skeletonOffset != 0)
               {
                   br.BaseStream.Seek(skeletonOffset, SeekOrigin.Begin);
                   Skeleton = new Skeleton();
                   Skeleton.Offset = skeletonOffset;
                   Skeleton.Read(br);
               }
           }

this is only true for FragTypeModel and makes no difference for ModelFile and ModelDictionary...

so i was wondering if you are going to plan to make anything for model import for simple things like weapons for a start seeing your the guy thats getting charge for the bigger picture of SparkIV




3 user(s) are reading this topic

0 members, 3 guests, 0 anonymous users