Search Unity

ProBuilder, call "Strip ProBuilder scripts" via script

Discussion in 'World Building' started by Zapan15, May 5, 2021.

  1. Zapan15

    Zapan15

    Joined:
    Apr 11, 2011
    Posts:
    186
    Hi,

    we need to call a version of the menu item Tools/Actions/Strip ProBuilder Scripts in Selection via editor script where we can hand over certain ProBuilderMesh components, instead of using the manual editor selection.

    Just calling the menu item via script would not be enought, as we would get a messagebox and need a selection of the object in the editor (we need that for some autoamted build scripts).

    We have seen that there is a StripProBuilderScripts.cs file in the ProBuilder package which contains our needed function: DoStrip. However, this is in sealed class StripProBuilderScripts so we cannot call it.

    Is there another way to call this function and/or is there any reason which this is not public? Does some one know how to call this via reflection?

    Thank you.
    :)
     
  2. Zapan15

    Zapan15

    Joined:
    Apr 11, 2011
    Posts:
    186
    No need to do that, we can just call UnityEngine.ProBuilder.MeshUtility.Compile to do the job!