Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: kavery on August 06, 2019, 11:37:28 PM

Title: Add UV Map at runtime?
Post by: kavery on August 06, 2019, 11:37:28 PM
Is it possible to add a UV map during runtime, like a basic box map or planar map?

In my situation a user imports an .fbx, and applies materials to each part. Would be great to add a base UV map when the imported file lacks one.
Title: Re: Add UV Map at runtime?
Post by: jeanfabre on August 08, 2019, 02:07:21 AM
Hi,

 It's possible, but not without heavy, heavy, very heavy coding :)


Bye,

 Jean
Title: Re: Add UV Map at runtime?
Post by: tcmeric on August 08, 2019, 08:25:59 AM
I wonder if it is possible and easier to do it, by using ProBuilder 4s runtime API. I dont think there is much documentation there, but it should be able to create UVs. (Of course, this still require some coding, but potentially a lot less).

Edit: In this example they take a normal obj and probuilderize it. Make an adjustment and then rebuild it. On the rebuild process, it should regenerate the Uvs.

https://github.com/Unity-Technologies/ProBuilder-API-Examples/blob/master/Runtime/Convert%20Mesh%20to%20Editable/MakePrimitiveEditable.cs
Title: Re: Add UV Map at runtime?
Post by: kavery on August 08, 2019, 06:29:51 PM
Oh wow, I'll try this. Thanks!