• Welcome to SC4 Devotion Forum Archives.

SC4 Model Tweaker Development/Support thread

Started by cogeo, April 11, 2009, 02:54:33 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

cogeo

Well, the Find and Replace items should be of the same kind, or not? So, both the Find and Replace boxes should refer to the material ID, not the S3Ds ID (these can be selected from the list anyway - you can click on the columns' headers to re-sort them if you wish). And, of course, the filtering should be performed at material level, not S3D level. There is another reason for this, many puzzle pieces have composite models, often with one group (and its material) that's common across many puzzle pieces, and another one that's different for each puzzle piece (and typically uses a material that's by convention equal to the S3D IID - or at least a part of the ID is the same). This way you can limit the changes to certain materials, selectively.

Therefore, your example does not make much sense to me, that is change something that's fixed across models to something that's different per model, ummm... It will work, but it will change only the materials that are specifically 0x12345678 and change them to model-specific values. Don't know what this would be useful to.

As I said above, both the Find and Replace masks can accept wildcards. In the Find box, the # wildcard should enable changes for the materials that are equal to S3D ID, the ? wildcard means any value, and the hex literals (0..F) means specific values, and of course these can be used in combination. I think this does make sense.

I quess you have some specific operations in mind, could you explain it in some more detail, or give an example?

sithlrd98

Although I have been slightly inactive as of late , and am still recovering the majority of SC4 related things after 2 HDD crashes...I would love to provide any testing as I did before! If memory serves...under Win7 , I had a crash maybe 1 out of 5 or so times...and it was usually just random at that, meaning it did not matter if I was "batch"converting, ie..scale,rotate save , or rotate , scale then another function , save..or if I just did one procedure,then save. I don't know much at all about coding , but after all the testing on Vista and Win 7 , I think it may just be dumb luck and possible limitations of the .dll?

Anyway..I never did fully understand how the .dll worked so I'm not sure its possible limitations in implementing new features.

Just let me know if I can help!

Jayson

null45

#122
As for filling in the gaps in the s3d spec at http://www.simswiki.info/wiki.php?title=S3D  (It is the same as the one at http://old_wiki.modthesims2.com/S3D)

The MATS section seems to be:
MATS (4 bytes)

DWORD (size of mats area including header) DWORD (number of Materials groups)

(Materials group:) DWORD - Flags,  BYTE - Alpha Func,  BYTE - Depth Func,   BYTE - Source Blend Factor,  BYTE - Destination Blend Factor,  USHORT  - Material Class,  BYTE - Reserved,   BYTE - Texture count,   DWORD - Instance ID for this material,  BYTE - Wrap Mode U,  BYTE - Wrap Mode V, USHORT - Animation Rate,  USHORT Animation Mode ,  BYTE - Length of materials name including the 00 ending byte Material Name  BYTE - 00 (end materials name) 


Hope it helps.  :thumbsup:



Jonathan

What can't you do?? :D

I've added your MATs section to the wiki page here: http://www.wiki.sc4devotion.com/index.php?title=S3D/format

I think I was trying to say the same you just said, Cogeo. So just ignore my last posts and do what you were going to before I said anything :)

Jonathan

cogeo

Hi again,

I have started implementation of the texture replacer function. I think it's well specified and discussed in detail. If you need any extensions, pls post.

I would also accept another request now, but I have no idea. A "merge" function maybe? Merging models can prove extremely tedious, however I'm not sure about its usufulness (I mean how many people will use it). I have seen some merged models in bridges (adding the network texture to the bridge model), but most work with bridges is already done.

As for the crash thing, I'm going to send you test versions when the texture replacer is done. If there are still problems, we can try installing an MFC dll to see what happens.

superhands

#125
maybe a merge function in which two objects become one. So (instead of the "add s3d function" which I think we are talking about) when you have two s3d objects in one model file, you have the option of grouping them so in reader they are listed as the same group.
Another idea could be a user friendly way of showing the back and front faces of the polys. Or possibly the option of modifying objects on their own such as height.

Just some ideas and Cogeo, thanks again for this wonderful tool &apls

-Dave

Tarkus

cogeo, I'm just absolutely thrilled to see that you're making another version of the Model Tweaker--the initial one has proved extremely useful and you have my most sincere thanks! :thumbsup:

One possible feature request/idea that just came to mind: would it be possible to add some sort of "splicing" mechanism, perhaps just for True3D S3D files?  It could prove quite valuable for making puzzle pieces out of more complex models.

-Alex

Jonathan

QuoteOne possible feature request/idea that just came to mind: would it be possible to add some sort of "splicing" mechanism, perhaps just for True3D S3D files?  It could prove quite valuable for making puzzle pieces out of more complex models.
+1 from me, that you save quite a bit of time on puzzle pieces (although I don't make puzzle pieces for complex models :))

nerdly_dood

I'm sure I could find a way to use your Model Tweaker to merge models. It would be particularly useful for me to make sure I have the various parts of my automata models aligned properly, namely headlights and flashing light effects, which the game treats as separate models. I'd quite like for you to include a Merge function, even if i won't actually save merged models.
My days here are numbered. It's been great and I've had a lot of fun, but I've moved on to bigger and better things.
—   EGO  VOBIS  VADELICO   —
Glory be unto the modder and unto the fun and unto the city game!

cogeo

@superhands: Automating the "Add S3D" function is what I was talking about. Fusing groups into one is not possible, I'm afraid, as each group can only use one material (or I'm wrong?); if two models/groups use different materials (and they usually do), merging them is impossible then.

@Alex: Thanks for the nice comments! I don't quite understand you, is this anything different to the "merge" function we are talking about? Looked at some dictionaries and "splicing" basically means uniting/joining. Or you mean "slicing"?

@nerdly_dood: A merge (or any other), without save, function in model tweaker would make no sense, as it doesn't have a preview capability. Or I didn't understand you?

Tarkus

Quote from: cogeo on February 18, 2010, 10:36:28 AM
Or you mean "slicing"?

Yes, that's what I meant.  :)  I don't know why I said "splicing". :D  Been one of those weeks.

-Alex

cogeo

Hi again,

Implementation of the texture replace function is almost done, I hope it's gonna be ready wihtin the upcoming weekend. Then I'm going to give away a test/evaluation version.

I don't know if I will have the time to make the merge function too. Is this really needed now that most NAM and bridges development is already done?

As for the "slicing" function, this is going to be used in spliting a (large) model into smaller (up to 16x16m) models, for intersections, or not? Btw I have never understood why this restriction applies (couldn't one just use the "big" model in ONE of the intersection's tiles, and use nothing in the rest ones?) but I have to accept it. Still, someone should write a specification of the algorithm. I'm not sure if this can be done, and have the models working as expected. Any ideas?

Jonathan

They can exceed 16mx16m but its best only to have a small overhang (liek the tiny corner of the FAR curves work better as an overhang than taking up a whole tile for a tiny triangle.

But we can't put the entire puzzle piece in one model because the terrain is not always flat.

I think the slicing function would work best in 16mx16m as it would mean only the preview model would have to be created and then we could just run that through the Model Tweaker, which cut out quite a bit of time :)

Jonathan

choco

Quote from: cogeo on February 16, 2010, 02:11:53 PM
Hi again,

I have started implementation of the texture replacer function. I think it's well specified and discussed in detail. If you need any extensions, pls post.
oh my, you just made me one happy man!  :thumbsup:

QuoteI would also accept another request now, but I have no idea. A "merge" function maybe? Merging models can prove extremely tedious, however I'm not sure about its usufulness (I mean how many people will use it). I have seen some merged models in bridges (adding the network texture to the bridge model), but most work with bridges is already done.
if you can make this happen, im sure you know how much i'll be using it.

ive completely changed my bridge construction process on bridges with complicated LODs.  basically, im constructing the BAT's in a few simple pieces, applying new IID's and material ID's manually, then merging the models....for each zoom and rotation. 

so, the texture replacer would be pivotal for me, since BAT cannot change the 5th IID digit (i do this in reader).  a batch merge function would be absolutely priceless for bridge creation.  not only new bridge creation, but modding existing maxis bridges (which typically have more than 3 models) would be soooooo much quicker.

im not sure why you feel "most work with bridges is already done.", but i assure you it is not.  i've a few more bridges to finish/finalize, then its back to the BAT for some more.  if you find the time to complete the merge function, i cannot fully explain my gratitude.   :)

cogeo

#134
Hi again,

I have made a new TEST version of Model Tweaker (V2.10-TEST). The changes include:
- Implemented the Replace Texture function
- Compiled with Visual Studio 10.

This version still uses the old S3D.DLL. However, the MFC version used by the program is newer. Chances are that using the newer MFC version will solve the crashes-under-Vista/Win7 problem (it could be a problem specific to VStudio/MFC 9). But it may as well not.

Alain (Ilive) has sent me the source code of the S3D library (special thanks!). If the crashes problem has not been solved in this version, I will attempt incorporating the code in the program, instead of using it as an external library. This should be expected to solve the problem for good and all.

Here is the download link: <Link Removed>

There is currently no installer, and the documentation has not yet been updated, but you experts, should be able to cope with this with no problem!  :)

Installation: In an existing installation of Version 2.00, replace the executable (overwrite) with the one in the download link. If the (new) menu item, toolbar icon, key shortcut etc are not available/visible, try resetting your usage data (click the little down arrow on the toolbar and select Customize). If this doesn't work, try uninstalling the (old) installation first (on your Windows Taskbar select Start->Control Panel->Add or Remove Programs), install V2.00 anew, and overwrite the executable BEFORE running the program for the first time (so that no usage data will be recorded).

What to test:
- Replace materials for 1-Z/R and 20-Z/R files.
- Replace Textures dialog: the two edit-boxes use the system fixed-pitch font (instead of the dialog font), and are dynamically sized, so as to accommodate the find/replace masks (10 characters) exactly. Do they look right? Are they sized correctly (no blank space should be left, and no text wrapping should take place).

I hope you find the new features useful, and I'm awaiting your feedback.

Regards

Jonathan

The replace texture feature looks exactly like what I need, it is perfect  :thumbsup:

But the program still crashes on windows 7.

Jonathan

cogeo

#136
Hi again,

I have just made a newer version of the tool (V2.20).

The updates in this version are:
- The program no longer uses S3D.DLL as a dependency. Instead, it has the code included in the program (thanks again Alain!). As a result, I would expect a different behaviour under Vista/Win7 (no crashes maybe?).
- Fixed a bug in the "Scale" operation (X-only & Y-only scaling for 20-Z/R models, ie "deforming").
- Fixed some linguistic errors (eg Nominator changed to Numerator).
- Added a Warning dialog and updated the About dialog accordingly (both state that the program was made with a pre-release version od the development tool - required by Microsoft).

Pls download and test this new version. The download link is <Link removed. Get V2.20 from the LEX>

Installation: In an existing installation of Version 2.00, replace the executable (overwrite) with the one in the download link. If the (new) menu item, toolbar icon, key shortcut etc are not available/visible, try resetting your usage data (click the little down arrow on the toolbar and select Customize). If this doesn't work, try uninstalling the (old) installation first (on your Windows Taskbar select Start->Control Panel->Add or Remove Programs), install V2.00 anew, and overwrite the executable BEFORE running the program for the first time (so that no usage data will be recorded). As this version no longer requires S3D.DLL, remove this file from the program's folder (it should run without it).

Hope it works now.

Regards

cogeo

Sorry for bumping, but I have not yet got any feedback about operation under Vista/Win7 (and there have been quite a few downloads).

The Merge models operation is currently being implemented. As it is by far the most complex operation, it is the most likely to crash (if the general crashing problem hasn't been solved yet).

Jonathan

Sorry, I looked at this on my phone coming home, then when I got home I forgot to check again and it had been marked unread.

Sorry, but it still crashes I can't give you the error message though as it keeps wanting to debug, so you'll have to get that from someone without Visual Studio installed.

cogeo

Jonathan, I'm talking about V2.20 (see my post above). Pls make sure that you are running this version (check the about box).

The good thing is that I have the source code now, so I can trace it more easily (to see where exactly the crashes occur).