The rules have been updated, read them now: Rules!

Cyberpunk 2077 Noesis script

Post questions about game models here, or help out others!
lndrx
ultra-n00b
Posts: 4
Joined: Sat Jan 16, 2021 2:39 am
Been thanked: 1 time

Re: Cyberpunk 2077 Noesis script

Post by lndrx » Sat Jan 16, 2021 7:31 pm

lndrx wrote:
Sat Jan 16, 2021 7:16 pm
Ok, I'm not a great programmer, but I kinda sorted what is "wrong". The new version of CP77Tools (v1.0 at this time) doesn't have any buffer files. It cleans everything leaving only the mesh file. Joschka's script 1.2.1 needs these buffer files to work. I'm trying to update the python code to point the original file "as also the buffer file".
I did it and nope. It doesn't work this way.

crypt
ultra-n00b
Posts: 1
Joined: Mon Jan 25, 2021 2:33 am

Re: Cyberpunk 2077 Noesis script

Post by crypt » Mon Jan 25, 2021 5:46 pm

Hi, I'm trying to load the .mesh files in noesis and I can't, I extracted the files several times from several versions of cp77 and no problem, but with the noesis scrypt it doesn't work, I can't see the model and when exporting in fbx or obj says file buffer error, I don't understand what can happen, I hope you can advise me, a greeting.

jayaqua
ultra-n00b
Posts: 1
Joined: Wed Jan 20, 2021 7:35 pm

Re: Cyberpunk 2077 Noesis script

Post by jayaqua » Tue Feb 02, 2021 9:57 pm

so ripping the models is easy but how do you get textures from the buffer files?

alphaZ
ultra-n00b
Posts: 4
Joined: Thu Feb 06, 2020 9:23 am
Has thanked: 4 times
Been thanked: 5 times

Re: Cyberpunk 2077 Noesis script

Post by alphaZ » Fri Feb 05, 2021 9:04 pm

Thank you Joshcka for your amazing work on this. Sorry it took so long for me to post this here, but I have been developing a lot of new features for your plugin. I redubbed this new version "fmt_CP77mesh" to avoid confusion, since "mesh" is such a generic format name.

fmt_CP77mesh.py v1.44
Image

New / updated features:
Textures (Import and Export):
- Preview of .xbm and .mi textures (as extracted by the latest CP77Tools), including files with multiple images inside
- Preview of other textures embedded inside meshes, particle files, and wherever else if you rename the file's extension to ".cp77tex"
- Beta texture export support for encoding images as new .buffer files by exporting as .cp77tex

Model Import:
- Imported models are rotated upright and scaled to a user-set scaling value (default 100x, found at the top of the .py file)
- Corrected bone maps when using a .rig file
- Correctly rotated normals
- Support for .morphtarget meshes (import and export) and export support for static meshes

Model Export:
- Export FBX to .mesh, writing new model data to a new .mesh.buffer file
- Modify only the bone positions in a .mesh by exporting them with the advanced option " -bones". A copy of the picked model will be created using the bone positions from your FBX (no need to rebuild this since no .buffer file is made)
- Modify the bone positions and model data of a .mesh simultaneously by exporting with the advanced option " -meshbones"

About Model Export:
You can create a mesh mod by importing an original .mesh into Noesis and saving it as FBX, editing it in a 3d editor, then loading that FBX back into Noesis and exporting it back to .mesh over the model you originally extracted it from. Mesh editing seems to work well now as of v1.44; most of the issues with crashes and exploding verts have been fixed.

To get your mesh in-game, you need to reconstruct the .mesh file so that your new buffer is packed up and embedded inside it. The latest versions of CP77Tools can do this using the command:

Code: Select all

rebuild -p "MODDED FOLDER PATH" -b -t --keep --unsaferaw 
The following options are available at the top of the .py file and can be changed with a text editor:

Code: Select all

meshScale = 100					#scale model to this size
bOriginalTransform = False			#if put to true, the mesh will be imported where you can see its original "boneRigMatrices" transforms in a 3D editor (by checking the inverse of any bone's matrix)
bHighestLODOnly = False   	  		#if put to True, the low poly meshes won't be loaded
bLoadRigFile = False 	       		        #if put to True, enables selecting a paired rig file with the skeleton hierarchy info
bLoadSeveralRigFiles = False		        #if put to True, same as above but with several rig files and without validity check
bParentToRootIfNoParent = True		        #if put to True, unparented bones will be parented to Root
bReadTangents = False				#if put to True, tangents are read from the file and applied to the model
bWriteVerts = True				#if put to True, exported meshes will rewrite the entire .buffer file (instead of only rewriting verts within the original .buffer)

bFlipImage = False				#if put to True, images and UVs are flipped upright on imported textures and meshes
bManualDimensions = False			#if put to True, the user can set their own texture resolution on import
bManualCompression = False			#if put to True, the user can set their own texture compression on import	

If you want to follow the development of this version more closely, you can on the Cyberpunk Modding Discords:

Cyberpunk 2077 Modding (my home server):
https://discord.com/invite/2bT93CkA4B

CP77 Modding Community:
https://discord.gg/Epkq79kd96


Download Here:
http://www.mediafire.com/file/g1t443fj7 ... 8.zip/file
or
You do not have the required permissions to view the files attached to this post.
Last edited by alphaZ on Mon Mar 01, 2021 8:36 am, edited 6 times in total.

JKerman
ultra-n00b
Posts: 1
Joined: Sat Feb 06, 2021 12:02 am

Texture names

Post by JKerman » Sat Feb 06, 2021 12:05 am

When I extract the textures, I get png and dds files named whatever_maskset. Are they for individual RGB channels? How can I tell which are the specular, AO, metallic, etc?

choochoomomdad
ultra-n00b
Posts: 1
Joined: Sun Jan 24, 2021 9:59 am

Re: Cyberpunk 2077 Noesis script

Post by choochoomomdad » Sat Feb 06, 2021 8:10 pm

alphaZ wrote:
Fri Feb 05, 2021 9:04 pm
Thank you Joshcka for your amazing work on this. Sorry it took so long for me to post this here, but I have been developing a lot of new features for your plugin. I redubbed this new version "fmt_CP77mesh" to avoid confusion, since "mesh" is such a generic format name.

fmt_CP77mesh.py v1.43
Image

New / updated features:
Textures (Import and Export):
- Preview of .xbm and .mi textures (as extracted by the latest CP77Tools), including files with multiple images inside
- Preview of other textures embedded inside meshes, particle files, and wherever else if you rename the file's extension to ".cp77tex"
- Beta texture export support for encoding images as new .buffer files by exporting as .cp77tex

Model Import:
- Imported models are rotated upright and scaled to a user-set scaling value (default 100x, found at the top of the .py file)
- Corrected bone maps when using a .rig file
- Correctly rotated normals
- Support for .morphtarget meshes (import and export) and export support for static meshes

Model Export:
- Export FBX to .mesh, writing new model data to a new .mesh.buffer file
- Modify only the bone positions in a .mesh by exporting them with the advanced option " -bones". A copy of the picked model will be created using the bone positions from your FBX (no need to rebuild this since no .buffer file is made)
- Modify the bone positions and model data of a .mesh simultaneously by exporting with the advanced option " -meshbones"

About Model Export:
You can create a mesh mod by importing an original .mesh into Noesis and saving it as FBX, editing it in a 3d editor, then loading that FBX back into Noesis and exporting it back to .mesh over the model you originally extracted it from. Mesh editing is currently pretty finicky, however, and only guns, cars and hair meshes have had much success so far. Clothes and characters will often have issues with exploding faces, so that needs more research.
To get your mesh in-game, you need to reconstruct the .mesh file so that your new buffer is packed up and embedded inside it. The latest versions of CP77Tools can do this using the command:

Code: Select all

rebuild -p "MODDED FOLDER PATH" -b -t --keep --unsaferaw 
The following options are available at the top of the .py file and can be changed with a text editor:

Code: Select all

meshScale = 100					#scale model to this size
bOriginalTransform = False			#if put to true, the mesh will be imported where you can see its original "boneRigMatrices" transforms in a 3D editor (by checking the inverse of any bone's matrix)
bHighestLODOnly = False   	  		#if put to True, the low poly meshes won't be loaded
bLoadRigFile = False 	       		        #if put to True, enables selecting a paired rig file with the skeleton hierarchy info
bLoadSeveralRigFiles = False		        #if put to True, same as above but with several rig files and without validity check
bParentToRootIfNoParent = True		        #if put to True, unparented bones will be parented to Root
bReadTangents = False				#if put to True, tangents are read from the file and applied to the model
bWriteVerts = True				#if put to True, exported meshes will rewrite the entire .buffer file (instead of only rewriting verts within the original .buffer)

bFlipImage = False				#if put to True, images and UVs are flipped upright on imported textures and meshes
bManualDimensions = False			#if put to True, the user can set their own texture resolution on import
bManualCompression = False			#if put to True, the user can set their own texture compression on import	

If you want to follow the development of this version more closely, you can on the Cyberpunk Modding Discords:

Cyberpunk 2077 Modding (my home server):
https://discord.com/invite/2bT93CkA4B

CP77 Modding Community:
https://discord.gg/Epkq79kd96


Download Here:
https://www.mediafire.com/file/ks3qun82 ... 3.zip/file
or
How about error “wrong buffer file”?

truforza
ultra-n00b
Posts: 2
Joined: Thu Feb 04, 2021 10:36 pm
Has thanked: 1 time

Re: Cyberpunk 2077 Noesis script

Post by truforza » Wed Feb 10, 2021 10:49 pm

Hi people. I'm hoping someone can help me figure out what I'm missing because I'm stuck with this message for every mesh i try to preview.. and the exports are nonexistent as well

Image

I'm not sure if I missed something while extracting the game data, but I would highly apprecaiate any help. Thanks and my apologies for being a noesis noob

alphaZ
ultra-n00b
Posts: 4
Joined: Thu Feb 06, 2020 9:23 am
Has thanked: 4 times
Been thanked: 5 times

Re: Cyberpunk 2077 Noesis script

Post by alphaZ » Fri Feb 12, 2021 2:16 am

truforza wrote:
Wed Feb 10, 2021 10:49 pm
Hi people. I'm hoping someone can help me figure out what I'm missing because I'm stuck with this message for every mesh i try to preview.. and the exports are nonexistent as well

Image

I'm not sure if I missed something while extracting the game data, but I would highly apprecaiate any help. Thanks and my apologies for being a noesis noob
This happens because you haven't uncooked the mesh files when you extracted your game archives. There are two ways to extract files with CP77Tools: uncook and unbundle. Unbundle is what you did, and that gives you the mesh files themselves, but the actual mesh data is hidden inside some Oodle-compressed data blocks inside those mesh files. That needs your oo2ext_7_win64.dll file from your game in order to extract ("uncook"), and that's why CP77Tools needs that DLL too.

So in order to preview the meshes, they must be surrounded by their extracted data parts (called ".buffer" files). Noesis will find the uncooked buffer file that contains the model data and load it automatically, if it is in the same folder and with the same name as the .mesh file.

To uncook all mesh files from a game archive, use a command like this:

Code: Select all

uncook -p "D:\GOG\Cyberpunk2077\Cyberpunk 2077\archive\pc\content\basegame_4_gamedata.archive" -w *mesh*

truforza
ultra-n00b
Posts: 2
Joined: Thu Feb 04, 2021 10:36 pm
Has thanked: 1 time

Re: Cyberpunk 2077 Noesis script

Post by truforza » Tue Feb 16, 2021 1:30 am

alphaZ wrote:
Fri Feb 12, 2021 2:16 am

This happens because you haven't uncooked the mesh files when you extracted your game archives. There are two ways to extract files with CP77Tools: uncook and unbundle. Unbundle is what you did, and that gives you the mesh files themselves, but the actual mesh data is hidden inside some Oodle-compressed data blocks inside those mesh files. That needs your oo2ext_7_win64.dll file from your game in order to extract ("uncook"), and that's why CP77Tools needs that DLL too.

So in order to preview the meshes, they must be surrounded by their extracted data parts (called ".buffer" files). Noesis will find the uncooked buffer file that contains the model data and load it automatically, if it is in the same folder and with the same name as the .mesh file.

To uncook all mesh files from a game archive, use a command like this:

Code: Select all

uncook -p "D:\GOG\Cyberpunk2077\Cyberpunk 2077\archive\pc\content\basegame_4_gamedata.archive" -w *mesh*
I followed your instructions to re-copy the DLL (just to be sure) and use the 'uncook' command but ended up getting flooded with loads of errors about being unable to read cr2w or something while CP77Tools created 0Kb mesh files for everything. Is this supposed to happen? I still feel like I have missed something very important..

Image


Edit: I managed to unbundle the mesh files after uncooking and gained access to some of the models.. though the majority of them still can't be opened for some reason
Last edited by truforza on Thu Feb 25, 2021 2:09 am, edited 1 time in total.

Crazy31139
advanced
Posts: 72
Joined: Fri Dec 02, 2016 5:53 pm
Has thanked: 173 times
Been thanked: 31 times
Contact:

Re: Cyberpunk 2077 Noesis script

Post by Crazy31139 » Sun Feb 21, 2021 2:39 pm

Screenshot_1.jpg
When i try open npc clair skirt - l1_003_wa_skirt__clair.mesh
Noesis give me this error
I extract all l1_003_wa_skirt__clair.mesh.0.buffer by l1_003_wa_skirt__clair.mesh.73.buffer
You do not have the required permissions to view the files attached to this post.

Post Reply