[Closed] Remove Face Materials?
I’m having a really bad issue, it seems a plugin I use is doing something wierd to the objects material.
The plugin is UV – Packer it seems to be adding an invisible material or something, because whenever I use it when I export the file and import to my game engine I’m getting a material error.
I dont see the material in either of the material editors anywhere. It doesn’t show up on the object itself in the viewport. But it’s definitely there somewhere, game engine is showing the file as having 1 more material than what I have assigned to it, so say I have a multi-sub object material with 8 sub materials 1 for each Material ID of the object, the game shows 9 materials and gives a material error and wont accept the file. I can import the file prior to using UV-Packer no problem.
I’ve tried using this script to remove the invisible material but it does not work.
for i = 1 to selection.count do
(
selection[i].material = undefined
)
It does however sucessfully remove the materials I assign it.
Is there something I’m missing here?
Probably going to have to, but the benifit of UV Packer over Pack UVs is UV-Packer calculates the perfect quadrature of your maps, scales them and put the pieces together in a mathematically exact way. In other words it rescales the uvs according to geometry portions, to minimize stretching.
if UV-Packer is a good thing ask its developers for support.
my position is – if no support there is no thing to use.
The extra material is probably stored in the modifier, just like the unwrap modifier does with its default mapping. What happens if you collapse the stack, or copy/paste the channel info data and then remove the modifiers?
-Eric
Ok guys, it’s not from UV Packer. I found out the problem no solution yet, but its because it was initially made via spline modeling > enabled in viewport then converted to edit poly.
I don’t think so. Unless the material is assigned within a multi-material (which will be accessible by getting the objects material into the material editor) with 9 sub-materials, then it is something in the modifier stack holding reference to it.
-Eric
It’s something to do with it being modeling from a spline and converted to an edit poly, some data from the spline must still be left over in the object, i dunno but it effects all objects in the scene reguardless if made via spline or not, unless the spline modeled edit poly is hidden upon exporting selected.
Select the object(s) in question and run this code:
(
function faceCount obj = (
if classof obj == PolyMeshObject then (
return polyop.getNumFaces obj
)
if classof obj == Editable_Mesh do (
return getNumFaces obj
)
)
function faceID obj val = (
if classof obj == PolyMeshObject then (
return polyOp.getFaceMatID obj val
)
if classof obj == Editable_Mesh do (
return getFaceMatID obj val
)
)
function getIDs obj = (
arrID = #()
for i in 1 to (faceCount obj) do (
if (findItem arrID (faceID obj i)) == 0 then (
append arrID (faceID obj i)
)
)
return sort arrID
)
with printAllElements on (
with undo off (
for o in selection do (
try (
obj = converttomesh (copy o)
format "%:%
" o.name (getIDs obj)
delete obj
) catch (
format "Error Printing IDs on %
" o.name
)
)
)
)
)
It will print all the material IDs on the selected object(s). See if the results there match what you expect or not.
-Eric