Skip to content
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

Converting models with textured meshes in model ruins the texture #12

Closed
TyNoOutlet opened this issue Feb 24, 2022 · 5 comments
Closed

Comments

@TyNoOutlet
Copy link
Contributor

Not sure why this happens and I can't check rn so leaving this here.

As you can see, before:
image
and after:
image

@ExperiencersInternational
Copy link
Owner

@csqrl can you help?

@TyNoOutlet
Copy link
Contributor Author

TyNoOutlet commented Feb 24, 2022

@ExperiencersInternational looking at the src right now, I think it's because you're using GetDescendants instead of GetChildren.

It's a really simple fix and it would honestly be more of a hassle for me to fork and fix it, could you do that?

@cxmeel
Copy link
Contributor

cxmeel commented Feb 24, 2022

if #selectedObjects == 0 then
warn("You need to select a model first!")
return
elseif #selectedObjects > 1 then
warn("You have too many files selected, only one file can be selected at a time!")
return
end
if selectedObjects[1].ClassName == "Model" then
local folder = Instance.new("Folder")
folder.Name = selectedObjects[1].Name
folder.Parent = selectedObjects[1].Parent
local desc = selectedObjects[1]:GetDescendants()
for index, descendant in pairs(desc) do
descendant.Parent = folder
end
selectedObjects[1].Parent = nil
ChangeHistoryService:SetWaypoint("FolderTool: Changed the class of a model to a folder")
SelectionService:Set({folder})
else
warn("The item selected is not a model.")
end

@ExperiencersInternational looking at the src right now, I think it's because you're using GetDescendants instead of GetChildren.

this seems probable. consider changing to this:

for _, object in ipairs(selectedObjects) do
  if object.ClassName ~= "Model" then
    continue
  end

  local folder = Instance.new("Folder")
  folder.Name = object.Name

  for _, child in ipairs(object:GetChildren()) do
    child.Parent = folder
  end

  folder.Parent = object.Parent
  object:Destroy()
end

-- set history waypoint

this will allow converting of multiple models at once, ignoring anything not a model (rather than throwing warnings into the output)

@ExperiencersInternational
Copy link
Owner

ExperiencersInternational commented Feb 24, 2022

Will implement when I have time after RGDC or something, thanks @csqrl as always

It is a bit harder now that Lucas isn't working on this anymore

@ExperiencersInternational
Copy link
Owner

Fixed this, will be pulling changes over to GitHub soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants