I’m using 2018.1.0f2 on Windows 10.
Having the same issue with 2018.1.3f1. Any solution yet? (except to use old .NET runtime)
Could you please open a case for this in Fogbugz?
Could you give a link?
This issue is rather annoying as it prevents me from using new version of C# because I need “Export asset” as part of my prototyping workflow (very convenient to make simple models for prefabs in-editor without going to Maya).
You can report a bug using the menu item “Help / Report a bug…”
I wasn’t able to reproduce the problem on my machine, but with a bug report our testers will be able to test with a variety of setups.
Just tested again by creating a blank project with just a ProBuilder 3.0.9 installed, some stairs and .NET 4.x selected in the Player Settings. The issue is 100% reproducible.
I have sent the bug report via menu item in Unity.
So I got tired of waiting for a fix and decided to look into it. It turns out the reason for error is function Path.GetDirectoryName() returning the path with "" as directory separator on my windows, while the rest of Unity functions that deal with paths return path with “/” as separator. This issue is only with “.NET 4.x equivalent”. This is rather serious issue IMO and should be dealt sooner rather than later, as it can potentially break a lot of stuff not just ProBuilder.
It turns out the Probuilder functions involved are public and so I created my own implementation of asset export without this issue and with some QoL improvements:
Not anymore.
using ProBuilder.EditorCore;
Not there.
I have the same issue. Just updated from 2018.2.9 to 2018.2.14 with no change.
I’d like to use your fix Phobos. Could you tell me please, how to implement and make use of it?
What’s weird is if you look at the bug page, it says fixed in Probuilder 4.0. However We cnnot get PB 4.0. so what is the point?
In my post there is a link. Just save that file to your Scripts/Editor folder, change the path in the code (it is specific to my game now), and you should be good to go.
I used this solution for some time and it still works pretty well for me. But in other thread I think ProBuilder developer told me they fixed/revamped this functionality in new version of ProBuilder. Haven’t checked that one yet.
Not fixed in the old version on the store. Need to use that for a 2017.4 project…
So I checked the latest version and “Export Asset” function still doesn’t work as well as it could. It uses the random internal ProBuilder mesh name for the mesh asset instead of the (more logical) object name. Who would want to have mesh asset named incomprehensibly?
@gabrielw_unity please consider my solution in the post above . It has a bunch of improvements that you might find useful.
Hi,
trying your script but errors :
Assets\Scripts\Editor\ProBuilderTools.cs(5,7): error CS0246: The type or namespace name 'ProBuilder' could not be found (are you missing a using directive or an assembly reference?)
Any idea ? Using Unity 2018.3.12f1
Thanks
It seems the code needs to be updated for 4.x version. It was written for 3.x.
Edit: I’ve upgraded the gist to work with latest ProBuilder. Didn’t change the code much from the way it was (based on 3.x original export code), but still works and works better than built-in export. May required to use an assembly definition file for the folder where this script resides in (you need to add reference to Unity.ProBuilder and Unity.ProBuilder.Editor).
Found out that ProBuilder code is not open source. I’ll probably make this into a pull request (to improve original menu item instead of hacking a new one) later.
Issues that I’d like to address (that are fixed in my code above):
- Mesh asset is saved under internal Mesh object name (like “pb_Mesh22270”) instead of more helpful game object name
- Prefab replacement is not handled at all. If you either used the generated prefab or just the mesh asset directly, your game objects will be broken after you “Export asset” with the same name
My pull request was accepted, if anyone needs the asset export improvements explained above you may grab the version 4.1.0 or later.