Shmoopy Posted April 11, 2015 Share Posted April 11, 2015 (edited) How to morph a mesh in-game - Tools needed: 3ds max 2010 and above + KAM's script 3ds max script : http://www.mediafire.com/download/at1dk6th5zw3hvh/ExportVertsId.mcr Sanny builder + Cleo - Step 1: Import your model , I chose to import the Admiral model , select the part you want to modify if your model has multiple parts , I chose the chassis, [Right-click] on it and click on [Hide unselected] , then expand the + Editable mesh and go to - Vertex mode and select the vertices which you want to apply your modification on: Run the script that you downloaded: Click on export , make sure that the vertices are still selected : - Step 2:You should obtain the vertices ids like shown below : Make a new ini file out of it like this : Save your ini file to the cleo folder- Step 3:Use this script to manipulate your vertices : const chassis = 0x64C wheel_rf_dummy = 0x650 wheel_rm_dummy = 0x654 wheel_rb_dummy = 0x658 wheel_lf_dummy = 0x65C wheel_lm_dummy = 0x660 wheel_lb_dummy = 0x664 door_rf_dummy = 0x668 door_rr_dummy = 0x66C door_lf_dummy = 0x670 door_lr_dummy = 0x674 bump_front_dummy = 0x678 bump_rear_dummy = 0x67C wing_rf_dummy = 0x680 wing_lf_dummy = 0x684 bonnet_dummy = 0x688 boot_dummy = 0x68C windscreen_dummy = 0x690 exhaust_ok = 0x694 misc_a = 0x698 misc_b = 0x69C misc_c = 0x6A0 misc_d = 0x6A4 misc_e = 0x6A8 end0AB1: call_scm_func @VehNodeGetStructure params 2 car [email protected] node chassis ret: RwFrame [email protected] RpAtomic [email protected] RpClump [email protected] RpGeometry [email protected] RpMaterial [email protected] [email protected] = 1 // Beginning IDrepeatwait 00AD3: [email protected] = format "%d" [email protected]: [email protected] = get_int_from_ini_file "cleo\data.ini" section "chas_top" key [email protected]: call_scm_func @MorphGeometryPoints params 6 RpGeometry [email protected] starting_V3d_ID [email protected] num_Points 1 morph 0.0 0.0 0.4 [email protected] += 1until [email protected] == 185 // Ending ID + 1end_thread:MorphGeometryPoints 0AA7: RwMatrixCreate 0x7F2A50 num_params 0 pop 0 RwMatrix [email protected]//0AA5: RwMatrixScale 0x7F22C0 num_params 3 pop 3 combine 1 scaleoffset [email protected] RwMatrix [email protected]//0AA5: RwMatrixRotate 0x7F1FD0 num_params 4 pop 4 combine 1 rot_angle 90.0 rot_axis [email protected] RwMatrix [email protected]: RwMatrixTranslate 0x7F2450 num_params 3 pop 3 combine 1 pos [email protected] RwMatrix [email protected]@ += 920A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0 //[email protected] -= [email protected] += 28 // RwV3d 1 - RwV3d in [email protected] -= [email protected] = 12006A: [email protected] *= [email protected] 005A: [email protected] += [email protected] 0085: [email protected] = [email protected] // RwV3d out 0AA5: RpGeometryLock 0x74C7D0 num_params 2 pop 2 Lockmode 0x02 RpGeometry [email protected] //rpGEOMETRYLOCKPOLYGONS = 0x01 ;rpGEOMETRYLOCKVERTICES = 0x02 ;rpGEOMETRYLOCKNORMALS = 0x04 ;rpGEOMETRYLOCKPRELIGHT = 0x08 ;rpGEOMETRYLOCKTEXCOORDS = 0x10 ;rpGEOMETRYLOCKTEXCOORDS1 = 0x10 ;rpGEOMETRYLOCKTEXCOORDS2 = 0x20 ;rpGEOMETRYLOCKTEXCOORDS3 = 0x40 ;rpGEOMETRYLOCKTEXCOORDS4 = 0x80 ;rpGEOMETRYLOCKTEXCOORDS5 = 0x0100 ;rpGEOMETRYLOCKTEXCOORDS6 = 0x0200 ;rpGEOMETRYLOCKTEXCOORDS7 = 0x0400 ;rpGEOMETRYLOCKTEXCOORDS8 = 0x0800 ;rpGEOMETRYLOCKTEXCOORDSALL = 0x0ff0 ;rpGEOMETRYLOCKALL = 0x0fff 0AA5: RwV3dTransformPoints 0x7EDD90 num_params 4 pop 4 RwMatrix [email protected] numPoints [email protected] V3d_pointsIn [email protected] V3d_pointsOut [email protected]: RpGeometryUnlock 0x74C800 num_params 1 pop 1 RpGeometry [email protected] 0AB2: ret 0:VehNodeGetStructure 0A97: [email protected] = car [email protected] struct005A: [email protected] += [email protected] 0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 00AB1: call_scm_func @FrameGetAtomic 1 RwFrame [email protected] ret: RpAtomic [email protected]: call_scm_func @AtomicGetClump 1 RpAtomic [email protected] ret: RpClump [email protected]: call_scm_func @AtomicGetGeometry 1 RpAtomic [email protected] ret: RpGeometry [email protected]: call_scm_func @GeometryGetMaterial 1 RpGeometry [email protected] ret: RpMaterial [email protected]: ret 5 [email protected] [email protected] [email protected] [email protected] [email protected]:GeometryGetMaterial0AA7: call 0x74c760 num_params 2 pop 2 RpTriangle [email protected] RpGeometry [email protected] RpMaterial [email protected] 0AB2: ret 1 [email protected]:[email protected] += 0x180A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 00AB2: ret 1 [email protected]:[email protected] += 0x3C0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 00AB2: ret 1 [email protected]:FrameGetAtomic0AA7: call_function 0x7348C0 num_params 1 pop 1 RwFrame [email protected] RpAtomic [email protected] 0AB2: ret 1 [email protected]:[email protected] += 0x980A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 00AB2: ret 1 [email protected]:[email protected] += 0x9C0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 00AB2: ret 1 [email protected]:[email protected] += 0xA00A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 00AB2: ret 1 [email protected] - Results:You can modify any part you want: Edited April 11, 2015 by Shmoopy madleg 1 Link to comment Share on other sites More sharing options...
DK22Pac Posted April 11, 2015 Share Posted April 11, 2015 (edited) look to RpMorph plugin in rwsdk. Also, learn how to work with file read/write operations. Don't use INI for such tasks. Edited April 11, 2015 by DK22Pac Link to comment Share on other sites More sharing options...
Shmoopy Posted April 11, 2015 Author Share Posted April 11, 2015 (edited) look to RpMorph plugin in rwsdk. Also, learn how to work with file read/write operations. Don't use INI for such tasks. RpMorph is definitely implemented in Gta SA ... Oh , and I prefer to work with a 3 lines code for reading data rather than a sh*thole of 0A9D: readfile [email protected] size 1 to [email protected] Edited April 11, 2015 by Shmoopy Link to comment Share on other sites More sharing options...
DJThanos Posted July 30, 2015 Share Posted July 30, 2015 Bump, but does it work in VC and 3ds max 2009? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now