Skip to content

[Feature/Bug fix] Make possible to replace clump models #3170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 9 commits into from
Closed

[Feature/Bug fix] Make possible to replace clump models #3170

wants to merge 9 commits into from

Conversation

CrosRoad95
Copy link

This pr make possible to replace clump model with another clump model

addCommandHandler("replace", function()
    local model = 3425
    local x,y,z = getElementPosition(localPlayer)
    txd = engineLoadTXD("clumpmodel.txd")
    engineImportTXD(txd, model)
    local dff = engineLoadDFF("clumpmodel.dff")
    engineReplaceModel(dff, model)
    local obj = createObject(model,x + 5,y,z)
end)

Test resource:
replaceclump.zip
Blender project:
blender project.zip

image

@botder
Copy link
Member

botder commented Sep 3, 2023

Why do you have to move all atomics from the old clump to the new one? Wouldn't replacing just the RwObject pointer be enough?

@CrosRoad95
Copy link
Author

Why do you have to move all atomics from the old clump to the new one? Wouldn't replacing just the RwObject pointer be enough?

from what i know, just swapping pointer wont be enough

@CrosRoad95
Copy link
Author

as i'm testing it i encountered potential problem, unsupported feature, idk. Because i created scene in blender that involve using models hierarchy, connected few cubes together and exported them, but all frames are now called "Cube" even they have different names in blender ( maybe while exporting, exporter took some name and used it for all? )

The question is:

  1. can dragondff export models with preserved hierarchy? Maybe models in gta are not inteded to have it?
  2. Should it be supported in mta? as you can see my later pr let you move frames so having hierarchy can be beneficial in some cases

@CrosRoad95
Copy link
Author

@botder I'd like to ask for feedback

@botder
Copy link
Member

botder commented Sep 19, 2023

I'd like to ask for feedback

I don't have the necessary knowledge about models/RenderWare to judge this.

@lopezloo lopezloo added the enhancement New feature or request label Sep 19, 2023
@CrosRoad95
Copy link
Author

@Pirulax and @tederis may know more about it

@tut001
Copy link
Member

tut001 commented Sep 23, 2023

@CrosRoad95

  1. can dragondff export models with preserved hierarchy? Maybe models in gta are not inteded to have it?

Max's DFF plugin does have a 'user data' export setting for frames, a 'node names' setting for object names I am guessing (or dummy helpers), and a separate 'object names' setting which I assume does the same

To my knowledge GTA uses multiclump objects together with object IFP's to animate things like soda factory signs and oil pumps in the desert

It does look like it preserves object names when inspected with RW Analyze
1.dff = node names false
2.dff = node names true
3.dff = node names true, object names true
4.dff = node names true, user-data set to 'frame' true
name test.zip

@CrosRoad95 CrosRoad95 closed this by deleting the head repository Dec 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants