Skip to content

Conversation

@lopezt-unity
Copy link
Collaborator

Purpose of this PR

Fixing Probuilder mesh throwing errors with FBX Exporter due to the presence of ProBuilderShape that was not removed.
The PR calls the StripProBuilderScripts class now for more consistency and the code is now also aware of the difference between "FBX Export" that does not replace the PB Object and "Convert to prefab" that creates a prefab, strips PB objects and replace the object in the scene.

FBXexportResolution

Links

Fogbugz: https://fogbugz.unity3d.com/f/cases/1334017/

Comments to Reviewers

[List known issues, planned work, provide any extra context for your code.]

Addons/Fbx.cs Outdated

var getMeshForComponent = FbxExporterAssembly.GetTypes()
.Where(t => t.BaseType == typeof(MulticastDelegate) && t.Name.StartsWith("GetMeshForComponent"))
.First(t => t.ContainsGenericParameters);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should replace the reflection here with an optional dependency on FBX Exporter

if (component != null)
Object.DestroyImmediate(component);
// probuilder can't handle mesh assets that may be externally reloaded, just strip pb stuff for now.
StripProBuilderScripts.DoStrip(pmesh);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice 🥇

@lopezt-unity lopezt-unity requested a review from JoelFortin May 19, 2021 20:08
@lopezt-unity lopezt-unity requested a review from karl- May 19, 2021 21:33
Copy link
Contributor

@JoelFortin JoelFortin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Tried Export and Convert.
Also note for @vkovec, the warning we get about the temp meta file that needs to be deleted is logged right ?

Copy link
Contributor

@modrimkus modrimkus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compared behaviour before/after fix - lgtm.

@vkovec
Copy link
Contributor

vkovec commented Jun 8, 2021

@JoelFortin Yes I don't think the warning was specific to Probuilder, we have made a fix for the next release

@lopezt-unity lopezt-unity merged commit 9fd4331 into master Jun 8, 2021
@lopezt-unity lopezt-unity deleted the bugfix/1334017-pbshape-fbxexport branch June 8, 2021 18:36
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

Successfully merging this pull request may close these issues.

6 participants