SketchUpImporter

Struct SketchUpImporter 

Source
pub struct SketchUpImporter {
Show 115 fields pub generateSecondaryUV: bool, pub keepQuads: bool, pub m_AddColliders: bool, pub m_AdditionalBone: bool, pub m_AnimationCompression: i32, pub m_AnimationDoRetargetingWarnings: bool, pub m_AnimationImportErrors: String, pub m_AnimationImportWarnings: String, pub m_AnimationPositionError: f32, pub m_AnimationRetargetingWarnings: String, pub m_AnimationRotationError: f32, pub m_AnimationScaleError: f32, pub m_AnimationType: i32, pub m_AnimationWrapMode: i32, pub m_AssetBundleName: String, pub m_AssetBundleVariant: String, pub m_AssetHash: Hash128, pub m_BakeSimulation: bool, pub m_ClipAnimations: Vec<ClipAnimationInfo>, pub m_ExtraExposedTransformPaths: Vec<String>, pub m_FileScale: f32, pub m_FileUnit: i32, pub m_GenerateBackFace: bool, pub m_GlobalScale: f32, pub m_HasExtraRoot: bool, pub m_HumanDescription: HumanDescription, pub m_ImportAnimation: bool, pub m_ImportBlendShapes: bool, pub m_ImportedRoots: Vec<PPtr>, pub m_ImportedTakeInfos: Vec<TakeInfo>, pub m_IsReadable: bool, pub m_LODScreenPercentages: Vec<f32>, pub m_LastHumanDescriptionAvatarSource: PPtr, pub m_Latitude: f64, pub m_LegacyGenerateAnimations: i32, pub m_Longitude: f64, pub m_MaterialName: i32, pub m_MaterialSearch: i32, pub m_MergeCoplanarFaces: bool, pub m_MeshCompression: i32, pub m_MotionNodeName: String, pub m_Name: String, pub m_NorthCorrection: f64, pub m_OptimizeGameObjects: bool, pub m_ReferencedClips: Vec<GUID>, pub m_SelectedNodes: Vec<i32>, pub m_SketchUpImportData: SketchUpImportData, pub m_UseFileScale: bool, pub m_UseFileUnits: bool, pub m_UserData: String, pub normalImportMode: i32, pub normalSmoothAngle: f32, pub secondaryUVAngleDistortion: f32, pub secondaryUVAreaDistortion: f32, pub secondaryUVHardAngle: f32, pub secondaryUVPackMargin: f32, pub swapUVChannels: bool, pub tangentImportMode: i32, pub weldVertices: bool, pub bakeAxisConversion: Option<bool>, pub blendShapeNormalImportMode: Option<i32>, pub indexFormat: Option<i32>, pub legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: Option<bool>, pub m_AddHumanoidExtraRootOnlyWhenUsingAvatar: Option<bool>, pub m_AutoGenerateAvatarMappingIfUnspecified: Option<bool>, pub m_AutoMapExternalMaterials: Option<bool>, pub m_AvatarSetup: Option<i32>, pub m_CopyAvatar: Option<bool>, pub m_ExternalObjects: Option<Vec<(SourceAssetIdentifier, PPtr)>>, pub m_ExtraUserProperties: Option<Vec<String>>, pub m_FileIDToRecycleName: Option<Vec<(i64, String)>>, pub m_FileIdsGeneration: Option<i32>, pub m_FileScaleFactor: Option<f32>, pub m_FileScaleUnit: Option<String>, pub m_HasEmbeddedTextures: Option<bool>, pub m_HasPreviousCalculatedGlobalScale: Option<bool>, pub m_HumanoidOversampling: Option<i32>, pub m_ImportAnimatedCustomProperties: Option<bool>, pub m_ImportBlendShapeDeformPercent: Option<bool>, pub m_ImportCameras: Option<bool>, pub m_ImportConstraints: Option<bool>, pub m_ImportLights: Option<bool>, pub m_ImportMaterials: Option<bool>, pub m_ImportPhysicalCameras: Option<bool>, pub m_ImportVisibility: Option<bool>, pub m_InternalIDToNameTable: Option<Vec<((i32, i64), String)>>, pub m_MaterialImportMode: Option<i32>, pub m_MaterialLocation: Option<i32>, pub m_Materials: Option<Vec<SourceAssetIdentifier>>, pub m_NodeNameCollisionStrategy: Option<i32>, pub m_PreserveHierarchy: Option<bool>, pub m_PreviousCalculatedGlobalScale: Option<f32>, pub m_RemapMaterialsIfMaterialImportModeIsNone: Option<bool>, pub m_RemoveConstantScaleCurves: Option<bool>, pub m_ResampleCurves: Option<bool>, pub m_ResampleRotations: Option<bool>, pub m_RigImportErrors: Option<String>, pub m_RigImportWarnings: Option<String>, pub m_SortHierarchyByName: Option<bool>, pub m_StrictVertexDataChecks: Option<bool>, pub m_SupportsEmbeddedMaterials: Option<bool>, pub m_UseSRGBMaterialColor: Option<bool>, pub m_UsedFileIDs: Option<Vec<i64>>, pub maxBonesPerVertex: Option<i32>, pub meshOptimizationFlags: Option<i32>, pub minBoneWeight: Option<f32>, pub normalCalculationMode: Option<i32>, pub normalSmoothingSource: Option<i32>, pub optimizeBones: Option<bool>, pub optimizeMeshForGPU: Option<bool>, pub secondaryUVMarginMethod: Option<i32>, pub secondaryUVMinLightmapResolution: Option<f32>, pub secondaryUVMinObjectScale: Option<f32>, pub skinWeightsMode: Option<i32>, pub splitTangentsAcrossUV: Option<bool>,
}
Expand description

SketchUpImporter is a class of the Unity engine since version 5.1.0f1. Exert from Unity’s scripting documentation: Derives from AssetImporter to handle importing of SketchUp files. From the SketchUpImporter, you can access certain properties that are extracted from the SketchUp file.The following is an example of showing the geo coordinate extracted from the SketchUp file.

Fields§

§generateSecondaryUV: bool

Generate secondary UV set for lightmapping.

§keepQuads: bool

If this is true, any quad faces that exist in the mesh data before it is imported are kept as quads instead of being split into two triangles, for the purposes of tessellation. Set this to false to disable this behavior.

§m_AddColliders: bool§m_AdditionalBone: bool§m_AnimationCompression: i32

Animation compression setting.

§m_AnimationDoRetargetingWarnings: bool§m_AnimationImportErrors: String§m_AnimationImportWarnings: String§m_AnimationPositionError: f32

Allowed error of animation position compression.

§m_AnimationRetargetingWarnings: String§m_AnimationRotationError: f32

Allowed error of animation rotation compression.

§m_AnimationScaleError: f32

Allowed error of animation scale compression.

§m_AnimationType: i32

Animator generation mode.

§m_AnimationWrapMode: i32

The default wrap mode for the generated animation clips.

§m_AssetBundleName: String

Get or set the AssetBundle name.

§m_AssetBundleVariant: String

Get or set the AssetBundle variant.

§m_AssetHash: Hash128§m_BakeSimulation: bool§m_ClipAnimations: Vec<ClipAnimationInfo>

Animation clips to split animation into. See Also: ModelImporterClipAnimation.

§m_ExtraExposedTransformPaths: Vec<String>

Animation optimization setting.

§m_FileScale: f32

Scaling factor used when useFileScale is set to true (Read-only).

§m_FileUnit: i32§m_GenerateBackFace: bool§m_GlobalScale: f32

Global scale factor for importing.

§m_HasExtraRoot: bool§m_HumanDescription: HumanDescription

The human description that is used to generate an Avatar during the import process.

§m_ImportAnimation: bool

Import animation from file.

§m_ImportBlendShapes: bool

Controls import of BlendShapes.

§m_ImportedRoots: Vec<PPtr>

Vec<PPtr<GameObject>>: (5.1.0f1 - 2022.3.2f1)

§m_ImportedTakeInfos: Vec<TakeInfo>

Generates the list of all imported take.

§m_IsReadable: bool

Are mesh vertices and indices accessible from script?

§m_LODScreenPercentages: Vec<f32>§m_LastHumanDescriptionAvatarSource: PPtr

PPtr<Avatar>: (5.1.0f1 - 2022.3.2f1)

§m_Latitude: f64

Retrieves the latitude Geo Coordinate imported from the SketchUp file.

§m_LegacyGenerateAnimations: i32§m_Longitude: f64

Retrieves the longitude Geo Coordinate imported from the SketchUp file.

§m_MaterialName: i32

Material naming setting.

§m_MaterialSearch: i32

Existing material search setting.

§m_MergeCoplanarFaces: bool§m_MeshCompression: i32

Mesh compression setting.

§m_MotionNodeName: String

The path of the transform used to generation the motion of the animation.

§m_Name: String

The name of the object.

§m_NorthCorrection: f64

Retrieves the north correction value imported from the SketchUp file.

§m_OptimizeGameObjects: bool

Animation optimization setting.

§m_ReferencedClips: Vec<GUID>

Generates the list of all imported Animations.

§m_SelectedNodes: Vec<i32>§m_SketchUpImportData: SketchUpImportData§m_UseFileScale: bool

Use FileScale when importing.

§m_UseFileUnits: bool

Detect file units and import as 1FileUnit=1UnityUnit, otherwise it will import as 1cm=1UnityUnit.

§m_UserData: String

Get or set any user data.

§normalImportMode: i32§normalSmoothAngle: f32§secondaryUVAngleDistortion: f32

Threshold for angle distortion (in degrees) when generating secondary UV.

§secondaryUVAreaDistortion: f32

Threshold for area distortion when generating secondary UV.

§secondaryUVHardAngle: f32

Hard angle (in degrees) for generating secondary UV.

§secondaryUVPackMargin: f32

Margin to be left between charts when packing secondary UV.

§swapUVChannels: bool

Swap primary and secondary UV channels when importing.

§tangentImportMode: i32§weldVertices: bool

Combine vertices that share the same position in space.

§bakeAxisConversion: Option<bool>

Computes the axis conversion on geometry and animation for Models defined in an axis system that differs from Unity’s (left handed, Z forward, Y-up). When enabled, Unity transforms the geometry and animation data in order to convert the axis. When disabled, Unity transforms the root GameObject of the hierarchy in order to convert the axis. bool: (2020.1.0b1 - 2022.3.2f1)

§blendShapeNormalImportMode: Option<i32>

i32: (2018.3.0f2 - 2022.3.2f1)

§indexFormat: Option<i32>

Format of the imported mesh index buffer data. i32: (2017.3.0b1 - 2022.3.2f1)

§legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: Option<bool>

bool: (2018.3.0f2 - 2022.3.2f1)

§m_AddHumanoidExtraRootOnlyWhenUsingAvatar: Option<bool>

bool: (2020.2.0f1 - 2022.3.2f1)

§m_AutoGenerateAvatarMappingIfUnspecified: Option<bool>

Generate auto mapping if no avatarSetup is provided when importing humanoid animation. bool: (2019.3.0f1 - 2022.3.2f1)

§m_AutoMapExternalMaterials: Option<bool>

bool: (2017.2.0b2 - 2017.2.0b6)

§m_AvatarSetup: Option<i32>

The Avatar generation of the imported model. i32: (2019.3.0b1 - 2022.3.2f1)

§m_CopyAvatar: Option<bool>

bool: (5.1.0f1 - 2019.3.0a2)

§m_ExternalObjects: Option<Vec<(SourceAssetIdentifier, PPtr)>>

Vec<(SourceAssetIdentifier, PPtr<[Object]>)>: (2017.2.0b2 - 2022.3.2f1)

§m_ExtraUserProperties: Option<Vec<String>>

A list of default FBX properties to treat as user properties during OnPostprocessGameObjectWithUserProperties. Vec: (2017.1.0f2 - 2022.3.2f1)

§m_FileIDToRecycleName: Option<Vec<(i64, String)>>

Vec<(i64, String)>: (5.1.0f1 - 2018.4.36f1)

§m_FileIdsGeneration: Option<i32>

i32: (2019.4.0f1 - 2022.3.2f1)

§m_FileScaleFactor: Option<f32>

f32: (2018.3.0f2 - 2022.3.2f1)

§m_FileScaleUnit: Option<String>

String: (2018.3.0f2 - 2022.3.2f1)

§m_HasEmbeddedTextures: Option<bool>

bool: (2017.2.0b2 - 2022.3.2f1)

§m_HasPreviousCalculatedGlobalScale: Option<bool>

bool: (2018.2.0b1 - 2019.1.0a13)

§m_HumanoidOversampling: Option<i32>

Controls how much oversampling is used when importing humanoid animations for retargeting. i32: (5.2.0f2 - 2022.3.2f1)

§m_ImportAnimatedCustomProperties: Option<bool>

Import animated custom properties from file. bool: (2017.2.0b2 - 2022.3.2f1)

§m_ImportBlendShapeDeformPercent: Option<bool>

Import BlendShapes deform percent. bool: (2022.1.0b1 - 2022.3.2f1)

§m_ImportCameras: Option<bool>

Controls import of cameras. Basic properties like field of view, near plane distance and far plane distance can be animated. bool: (2017.1.0b1 - 2022.3.2f1)

§m_ImportConstraints: Option<bool>

Import animation constraints. bool: (2018.1.0b2 - 2022.3.2f1)

§m_ImportLights: Option<bool>

Controls import of lights. Note that because light are defined differently in DCC tools, some light types or properties may not be exported. Basic properties like color and intensity can be animated. bool: (2017.1.0b1 - 2022.3.2f1)

§m_ImportMaterials: Option<bool>

bool: (5.1.0f1 - 2019.3.0a6)

§m_ImportPhysicalCameras: Option<bool>

bool: (2022.2.19f1 - 2022.3.2f1)

§m_ImportVisibility: Option<bool>

Use visibility properties to enable or disable MeshRenderer components. bool: (2017.1.0b1 - 2022.3.2f1)

§m_InternalIDToNameTable: Option<Vec<((i32, i64), String)>>

Vec<((i32, i64), String)>: (2019.1.0b1 - 2022.3.2f1)

§m_MaterialImportMode: Option<i32>

Material creation options. i32: (2019.3.0b1 - 2022.3.2f1)

§m_MaterialLocation: Option<i32>

Material import location options. i32: (2017.2.0b2 - 2022.3.2f1)

§m_Materials: Option<Vec<SourceAssetIdentifier>>

Vec: (2017.2.0b2 - 2022.3.2f1)

§m_NodeNameCollisionStrategy: Option<i32>

i32: (2021.2.0b1 - 2022.3.2f1)

§m_PreserveHierarchy: Option<bool>

If true, always create an explicit Prefab root. Otherwise, if the model has a single root, it is reused as the Prefab root. bool: (2017.3.0b1 - 2022.3.2f1)

§m_PreviousCalculatedGlobalScale: Option<f32>

f32: (2018.2.0b1 - 2019.1.0a13)

§m_RemapMaterialsIfMaterialImportModeIsNone: Option<bool>

bool: (2020.3.37f1 - 2022.3.2f1)

§m_RemoveConstantScaleCurves: Option<bool>

Removes constant animation curves with values identical to the object initial scale value. bool: (2021.2.0b1 - 2022.3.2f1)

§m_ResampleCurves: Option<bool>

If set to false, the importer will not resample curves when possible.Read more about animation curve resampling.Notes:- Some unsupported FBX features (such as PreRotation or PostRotation on transforms) will override this setting. In these situations, animation curves will still be resampled even if the setting is disabled. For best results, avoid using PreRotation, PostRotation and GetRotationPivot.- This option was introduced in Version 5.3. Prior to this version, Unity’s import behaviour was as if this option was always enabled. Therefore enabling the option gives the same behaviour as pre-5.3 animation import. bool: (5.4.0f3 - 2022.3.2f1)

§m_ResampleRotations: Option<bool>

bool: (5.3.0f1 - 5.3.8f2)

§m_RigImportErrors: Option<String>

String: (5.6.0b1 - 2022.3.2f1)

§m_RigImportWarnings: Option<String>

String: (5.6.0b1 - 2022.3.2f1)

§m_SortHierarchyByName: Option<bool>

Sorts the gameObject hierarchy by name. bool: (2019.2.0b1 - 2022.3.2f1)

§m_StrictVertexDataChecks: Option<bool>

Enables strict checks on imported vertex data. bool: (2022.1.0b1 - 2022.3.2f1)

§m_SupportsEmbeddedMaterials: Option<bool>

bool: (2017.2.0f2 - 2022.3.2f1)

§m_UseSRGBMaterialColor: Option<bool>

When disabled, imported material albedo colors are converted to gamma space. This property should be disabled when using linear color space in Player rendering settings.The default value is true. bool: (2018.3.0f2 - 2022.3.2f1)

§m_UsedFileIDs: Option<Vec<i64>>

Vec: (2019.1.0b1 - 2022.3.2f1)

§maxBonesPerVertex: Option<i32>

The maximum number of bones per vertex stored in this mesh data. i32: (2019.1.0b1 - 2022.3.2f1)

§meshOptimizationFlags: Option<i32>

Options to control the optimization of mesh data during asset import. i32: (2019.1.0b1 - 2022.3.2f1)

§minBoneWeight: Option<f32>

Minimum bone weight to keep. f32: (2019.1.0b1 - 2022.3.2f1)

§normalCalculationMode: Option<i32>

Normal generation options for ModelImporter. i32: (2017.1.0b1 - 2022.3.2f1)

§normalSmoothingSource: Option<i32>

Source of smoothing information for calculation of normals. i32: (2018.3.0f2 - 2022.3.2f1)

§optimizeBones: Option<bool>

Only import bones where they are connected to vertices. bool: (2021.2.0b1 - 2022.3.2f1)

§optimizeMeshForGPU: Option<bool>

bool: (5.1.0f1 - 2018.4.36f1)

§secondaryUVMarginMethod: Option<i32>

Method to use for handling margins when generating secondary UV. i32: (2020.1.0b1 - 2022.3.2f1)

§secondaryUVMinLightmapResolution: Option<f32>

The minimum lightmap resolution in texels per unit that the associated model is expected to have. f32: (2020.1.0b1 - 2022.3.2f1)

§secondaryUVMinObjectScale: Option<f32>

The minimum object scale that the associated model is expected to have. f32: (2020.1.0b1 - 2022.3.2f1)

§skinWeightsMode: Option<i32>

i32: (2019.1.0b1 - 2022.3.2f1)

§splitTangentsAcrossUV: Option<bool>

bool: (5.1.0f1 - 5.2.5f1)

Trait Implementations§

Source§

impl Debug for SketchUpImporter

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for SketchUpImporter

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for SketchUpImporter

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,