Menu

LEX File Exchange
EA Support Files
SC4 Wikipedia
Network Addon Mod
Dependencies
Chat
Welcome, Guest. Please login or register.
Did you miss your activation email?

December 08, 2021, 01:08:10 PM

Login with username, password and session length

Author Topic: SC4 Model Tweaker Development/Support thread  (Read 86221 times)

0 Members and 1 Guest are viewing this topic.

Offline cogeo

  • Moderator
  • Forums Parliamentarian
  • *
  • Posts: 1160
  • Total likes: 38
  • Reputation: 18
  • CL:
    SC4 Station Master
Re: SC4 Model Tweaker Development/Support thread
« Reply #120 on: February 14, 2010, 04:14:39 PM »
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?

Offline sithlrd98

Re: SC4 Model Tweaker Development/Support thread
« Reply #121 on: February 14, 2010, 04:42:59 PM »
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

Offline null45

  • Lex Certified
  • Forums Mayor
  • *
  • Posts: 221
  • Total likes: 27
  • Reputation: 18
  • CL:
    All formats lead to FSH
Re: SC4 Model Tweaker Development/Support thread
« Reply #122 on: February 14, 2010, 11:11:20 PM »
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:
Code: [Select]
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:


« Last Edit: February 15, 2010, 05:22:11 PM by null45 »

Offline Jonathan

  • NAM Team
  • Forums Guru
  • *
  • Posts: 2609
  • Total likes: 6
  • Reputation: 25
  • CL: Einstein, Jr. &scl()
Re: SC4 Model Tweaker Development/Support thread
« Reply #123 on: February 15, 2010, 05:57:05 AM »
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

Offline cogeo

  • Moderator
  • Forums Parliamentarian
  • *
  • Posts: 1160
  • Total likes: 38
  • Reputation: 18
  • CL:
    SC4 Station Master
Re: SC4 Model Tweaker Development/Support thread
« Reply #124 on: February 16, 2010, 04: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.

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.

Offline superhands

  • NAM Team
  • Forums Senator
  • *
  • Posts: 928
  • Total likes: 1
  • Reputation: 12
  • was bighead99
    • f u t u r e  p e r t h
  • CL: One Track Mind
Re: SC4 Model Tweaker Development/Support thread
« Reply #125 on: February 16, 2010, 07:48:43 PM »
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
« Last Edit: February 16, 2010, 07:50:41 PM by superhands »

Offline Tarkus

  • Administrator
  • Forums Legend
  • *
  • Posts: 11731
  • Total likes: 6046
  • Reputation: 75
  • NAM Team Tankadillo
    • NAM HQ
  • CL: Dr. PuzzlePiece
Re: SC4 Model Tweaker Development/Support thread
« Reply #126 on: February 17, 2010, 03:50:11 PM »
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

Offline Jonathan

  • NAM Team
  • Forums Guru
  • *
  • Posts: 2609
  • Total likes: 6
  • Reputation: 25
  • CL: Einstein, Jr. &scl()
Re: SC4 Model Tweaker Development/Support thread
« Reply #127 on: February 17, 2010, 03:51:58 PM »
Quote
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.
+1 from me, that you save quite a bit of time on puzzle pieces (although I don't make puzzle pieces for complex models :))

Offline nerdly_dood

Re: SC4 Model Tweaker Development/Support thread
« Reply #128 on: February 17, 2010, 06:07:32 PM »
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!

Offline cogeo

  • Moderator
  • Forums Parliamentarian
  • *
  • Posts: 1160
  • Total likes: 38
  • Reputation: 18
  • CL:
    SC4 Station Master
Re: SC4 Model Tweaker Development/Support thread
« Reply #129 on: February 18, 2010, 12:36:28 PM »
@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?

Offline Tarkus

  • Administrator
  • Forums Legend
  • *
  • Posts: 11731
  • Total likes: 6046
  • Reputation: 75
  • NAM Team Tankadillo
    • NAM HQ
  • CL: Dr. PuzzlePiece
Re: SC4 Model Tweaker Development/Support thread
« Reply #130 on: February 18, 2010, 12:53:42 PM »
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

Offline cogeo

  • Moderator
  • Forums Parliamentarian
  • *
  • Posts: 1160
  • Total likes: 38
  • Reputation: 18
  • CL:
    SC4 Station Master
Re: SC4 Model Tweaker Development/Support thread
« Reply #131 on: February 25, 2010, 02:03:43 PM »
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?

Offline Jonathan

  • NAM Team
  • Forums Guru
  • *
  • Posts: 2609
  • Total likes: 6
  • Reputation: 25
  • CL: Einstein, Jr. &scl()
Re: SC4 Model Tweaker Development/Support thread
« Reply #132 on: February 25, 2010, 02:25:00 PM »
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

Offline choco

  • NAM Team
  • Forums Senator
  • *
  • Posts: 783
  • Total likes: 19
  • Reputation: 10
  • "bridge" engineer...
  • CL: SC4 Bridgemeister
Re: SC4 Model Tweaker Development/Support thread
« Reply #133 on: March 01, 2010, 07:18:55 AM »
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:

Quote
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.
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.   :)

Offline cogeo

  • Moderator
  • Forums Parliamentarian
  • *
  • Posts: 1160
  • Total likes: 38
  • Reputation: 18
  • CL:
    SC4 Station Master
Re: SC4 Model Tweaker Development/Support thread
« Reply #134 on: March 14, 2010, 06:06:51 PM »
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
« Last Edit: March 21, 2010, 02:24:24 PM by cogeo »

Offline Jonathan

  • NAM Team
  • Forums Guru
  • *
  • Posts: 2609
  • Total likes: 6
  • Reputation: 25
  • CL: Einstein, Jr. &scl()
Re: SC4 Model Tweaker Development/Support thread
« Reply #135 on: March 15, 2010, 02:50:11 AM »
The replace texture feature looks exactly like what I need, it is perfect  :thumbsup:

But the program still crashes on windows 7.

Jonathan

Offline cogeo

  • Moderator
  • Forums Parliamentarian
  • *
  • Posts: 1160
  • Total likes: 38
  • Reputation: 18
  • CL:
    SC4 Station Master
Re: SC4 Model Tweaker Development/Support thread
« Reply #136 on: March 21, 2010, 02:29:53 PM »
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
« Last Edit: June 09, 2010, 03:38:37 PM by cogeo »

Offline cogeo

  • Moderator
  • Forums Parliamentarian
  • *
  • Posts: 1160
  • Total likes: 38
  • Reputation: 18
  • CL:
    SC4 Station Master
Re: SC4 Model Tweaker Development/Support thread
« Reply #137 on: March 26, 2010, 01:47:08 PM »
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).

Offline Jonathan

  • NAM Team
  • Forums Guru
  • *
  • Posts: 2609
  • Total likes: 6
  • Reputation: 25
  • CL: Einstein, Jr. &scl()
Re: SC4 Model Tweaker Development/Support thread
« Reply #138 on: March 26, 2010, 01:54:17 PM »
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.

Offline cogeo

  • Moderator
  • Forums Parliamentarian
  • *
  • Posts: 1160
  • Total likes: 38
  • Reputation: 18
  • CL:
    SC4 Station Master
Re: SC4 Model Tweaker Development/Support thread
« Reply #139 on: March 26, 2010, 02:02:06 PM »
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).