Package apple.modelio
Class MDLAsset
- java.lang.Object
-
- org.moe.natj.general.NativeObject
-
- org.moe.natj.objc.ObjCObject
-
- apple.NSObject
-
- apple.modelio.MDLAsset
-
- All Implemented Interfaces:
NSCopying,NSFastEnumeration,NSObject
public class MDLAsset extends NSObject implements NSCopying, NSFastEnumeration
MDLAsset An MDLAsset represents the contents of a model file. Each asset contains a collection of hierarchies of objects, where each object in the asset is the top level of a hierarchy. Objects include transforms, lights, cameras, and meshes. MDLAssets are typically instantiated from NSURLs that refer to a model resource. The model resource may represented timed information, for example, a series of mesh morphs. If the asset is timed, then the framerate will be non-zero, and the firstFrame and lastFrame properties will indicate the range for which sample data exists. Samples before or after that range will be clamped. Some model resource representations allow continuous sampling, others are discrete. In the discrete case, if a requested sample time is not on a discrete boundary the returned sample will be the sample exactly on the sample time, or if no such is available, the immediately preceding sample. If no time is specified for a sample, the first data will be returned. An asset's bounding box can be queried without traversing the hierarchy of objects. Fast enumeration of an MDLAsset iterates the top level objects contained within.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class apple.NSObject
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedMDLAsset(org.moe.natj.general.Pointer peer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static booleanaccessInstanceVariablesDirectly()voidaddObject(MDLObject object)addObject: Add a top level object to an asset.static MDLAssetalloc()static java.lang.ObjectallocWithZone(org.moe.natj.general.ptr.VoidPtr zone)MDLObjectContainerComponentanimations()[@property] animations Animations that can be bound to MDLObjects (@see MDLAnimationBindComponent)static MDLAssetassetWithSCNScene(SCNScene scnScene)static MDLAssetassetWithSCNSceneBufferAllocator(SCNScene scnScene, MDLMeshBufferAllocator bufferAllocator)static booleanautomaticallyNotifiesObserversForKey(java.lang.String key)MDLMeshBufferAllocatorbufferAllocator()[@property] bufferAllocator Allocator used to create vertex and index buffersstatic voidcancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)static voidcancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget, org.moe.natj.objc.SEL aSelector, java.lang.Object anArgument)static booleancanExportFileExtension(java.lang.String extension)canImportFileExtension: Indicates whether MDLAsset object can export asset to resource with the given extensionstatic booleancanImportFileExtension(java.lang.String extension)canImportFileExtension: Indicates whether MDLAsset object can be initialized with resource with the given extensionNSArray<? extends MDLObject>childObjectsOfClass(org.moe.natj.objc.Class objectClass)childObjectsOfClass: Inspects an asset's hierarchy for objects of the specified class type This can be used to get references to all MDLMesh objects, MDLLights, etc. if objectClass is not a subclass of MDLObject, an exception will be raised.static NSArray<java.lang.String>classFallbacksForKeyedArchiver()static org.moe.natj.objc.ClassclassForKeyedUnarchiver()java.lang.ObjectcopyWithZone(org.moe.natj.general.ptr.VoidPtr zone)longcount()[@property] count The number of top level objectslongcountByEnumeratingWithStateObjectsCount(org.moe.natj.general.ptr.VoidPtr state, org.moe.natj.general.ptr.Ptr<org.moe.natj.objc.ObjCObject> buffer, long len)static java.lang.StringdebugDescription_static()static java.lang.Stringdescription_static()doubleendTime()[@property] endTime End time bracket of animation data If no animation data was specified by resource or resource incapable of specifying animation data, this value defaults to 0.booleanexportAssetToURL(NSURL URL)exportAssetToURL: Export an asset to the specified URL.booleanexportAssetToURLError(NSURL URL, org.moe.natj.general.ptr.Ptr<NSError> error)exportAssetToURL:error: Export an asset to the specified URL.doubleframeInterval()[@property] frameInterval Inherent frame rate of an asset If no framerate was specified by resource or resource uncapable of specifying framerate, this value defaults to 0static longhash_static()MDLAssetinit()MDLAssetinitWithBufferAllocator(MDLMeshBufferAllocator bufferAllocator)initWithBufferAllocator: Initialize an empty MDLAsset with a buffer allocator to be used during other operations.MDLAssetinitWithURL(NSURL URL)initWithURL: Initialize an MDLAsset using the contents of the resource located at the indicated URL Vertex layout (i.e. vertexDescriptor) will be specified by ModelIO depending on attributes of the resource.MDLAssetinitWithURLVertexDescriptorBufferAllocator(NSURL URL, MDLVertexDescriptor vertexDescriptor, MDLMeshBufferAllocator bufferAllocator)initWithURL:vertexDescriptor:bufferAllocator: Initialize an MDLAsset using the contents of the resource located at URL, ensuring that the asset conforms to the supplied vertexDescriptor, and buffers are allocated in the supplied allocator The default behavior is to triangulate any discovered meshes and to conform the mesh to the supplied vertexDescriptor.MDLAssetinitWithURLVertexDescriptorBufferAllocatorPreserveTopologyError(NSURL URL, MDLVertexDescriptor vertexDescriptor, MDLMeshBufferAllocator bufferAllocator, boolean preserveTopology, org.moe.natj.general.ptr.Ptr<NSError> error)initWithURL:vertexDescriptor:bufferAllocator:preserveTopology:error: Same as initWithURL:vertexDescriptor:bufferAllocator: except that if preserveTopology is YES, a topology buffer might be created on the submeshes.static NSObject.Function_instanceMethodForSelector_retinstanceMethodForSelector(org.moe.natj.objc.SEL aSelector)static NSMethodSignatureinstanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)static booleaninstancesRespondToSelector(org.moe.natj.objc.SEL aSelector)static booleanisSubclassOfClass(org.moe.natj.objc.Class aClass)static NSSet<java.lang.String>keyPathsForValuesAffectingValueForKey(java.lang.String key)voidloadTextures()loadTextures Iterates over all material properties on all materials.MDLObjectContainerComponentmasters()[@property] masters Master objects that can be instanced into the asset's object hierarchystatic java.lang.Objectnew_objc()MDLObjectobjectAtIndex(long index)objectAtIndex: return the indexed top level objectMDLObjectobjectAtIndexedSubscript(long index)objectAtIndexedSubscript: return the indexed top level objectMDLObjectobjectAtPath(java.lang.String path)Return the object at the specified path, or nil if none exists therestatic NSArray<? extends MDLLightProbe>placeLightProbesWithDensityHeuristicUsingIrradianceDataSource(float value, long type, MDLLightProbeIrradianceDataSource dataSource)voidremoveObject(MDLObject object)removeObject: Remove a top level object from an asset.static booleanresolveClassMethod(org.moe.natj.objc.SEL sel)static booleanresolveInstanceMethod(org.moe.natj.objc.SEL sel)MDLAssetResolverresolver()[@property] AssetResolver Resolver asset that helps find associated files The default asset resolver is the RelativeAssetResolvervoidsetAnimations(MDLObjectContainerComponent value)[@property] animations Animations that can be bound to MDLObjects (@see MDLAnimationBindComponent)voidsetEndTime(double value)[@property] endTime End time bracket of animation data If no animation data was specified by resource or resource incapable of specifying animation data, this value defaults to 0.voidsetFrameInterval(double value)[@property] frameInterval Inherent frame rate of an asset If no framerate was specified by resource or resource uncapable of specifying framerate, this value defaults to 0voidsetMasters(MDLObjectContainerComponent value)[@property] masters Master objects that can be instanced into the asset's object hierarchyvoidsetResolver(MDLAssetResolver value)[@property] AssetResolver Resolver asset that helps find associated files The default asset resolver is the RelativeAssetResolvervoidsetStartTime(double value)[@property] startTime Start time bracket of animation data If no animation data was specified by resource or resource incapable of specifying animation data, this value defaults to 0.static voidsetVersion_static(long aVersion)doublestartTime()[@property] startTime Start time bracket of animation data If no animation data was specified by resource or resource incapable of specifying animation data, this value defaults to 0.static org.moe.natj.objc.Classsuperclass_static()NSURLURL()[@property] URL URL used to create the asset If the asset was not created with a URL, nil will be returned.static longversion_static()MDLVertexDescriptorvertexDescriptor()[@property] vertexDescriptor Vertex descriptor set upon asset initialization Will be nil if there was no descriptor set-
Methods inherited from class apple.NSObject
accessibilityActivate, accessibilityActivationPoint, accessibilityAssistiveTechnologyFocusedIdentifiers, accessibilityAttributedHint, accessibilityAttributedLabel, accessibilityAttributedUserInputLabels, accessibilityAttributedValue, accessibilityContainerType, accessibilityCustomActions, accessibilityCustomRotors, accessibilityDecrement, accessibilityDragSourceDescriptors, accessibilityDropPointDescriptors, accessibilityElementAtIndex, accessibilityElementCount, accessibilityElementDidBecomeFocused, accessibilityElementDidLoseFocus, accessibilityElementIsFocused, accessibilityElements, accessibilityElementsHidden, accessibilityFrame, accessibilityHint, accessibilityIncrement, accessibilityLabel, accessibilityLanguage, accessibilityNavigationStyle, accessibilityPath, accessibilityPerformEscape, accessibilityPerformMagicTap, accessibilityRespondsToUserInteraction, accessibilityScroll, accessibilityTextualContext, accessibilityTraits, accessibilityUserInputLabels, accessibilityValue, accessibilityViewIsModal, addObserverForKeyPathOptionsContext, attemptRecoveryFromErrorOptionIndex, attemptRecoveryFromErrorOptionIndexDelegateDidRecoverSelectorContextInfo, autoContentAccessingProxy, awakeAfterUsingCoder, awakeFromNib, class_objc, classForCoder, classForKeyedArchiver, copy, dealloc, debugDescription, description, dictionaryWithValuesForKeys, didChangeValueForKey, didChangeValueForKeyWithSetMutationUsingObjects, didChangeValuesAtIndexesForKey, doesNotRecognizeSelector, fileManagerShouldProceedAfterError, fileManagerWillProcessPath, finalize_objc, forwardingTargetForSelector, forwardInvocation, hash, indexOfAccessibilityElement, isAccessibilityElement, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableArrayValueForKey, mutableArrayValueForKeyPath, mutableCopy, mutableOrderedSetValueForKey, mutableOrderedSetValueForKeyPath, mutableSetValueForKey, mutableSetValueForKeyPath, observationInfo, observeValueForKeyPathOfObjectChangeContext, performSelector, performSelectorInBackgroundWithObject, performSelectorOnMainThreadWithObjectWaitUntilDone, performSelectorOnMainThreadWithObjectWaitUntilDoneModes, performSelectorOnThreadWithObjectWaitUntilDone, performSelectorOnThreadWithObjectWaitUntilDoneModes, performSelectorWithObject, performSelectorWithObjectAfterDelay, performSelectorWithObjectAfterDelayInModes, performSelectorWithObjectWithObject, prepareForInterfaceBuilder, provideImageDataBytesPerRowOrigin_Size_UserInfo, removeObserverForKeyPath, removeObserverForKeyPathContext, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, self, setAccessibilityActivationPoint, setAccessibilityAttributedHint, setAccessibilityAttributedLabel, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedValue, setAccessibilityContainerType, setAccessibilityCustomActions, setAccessibilityCustomRotors, setAccessibilityDragSourceDescriptors, setAccessibilityDropPointDescriptors, setAccessibilityElements, setAccessibilityElementsHidden, setAccessibilityFrame, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLanguage, setAccessibilityNavigationStyle, setAccessibilityPath, setAccessibilityRespondsToUserInteraction, setAccessibilityTextualContext, setAccessibilityTraits, setAccessibilityUserInputLabels, setAccessibilityValue, setAccessibilityViewIsModal, setIsAccessibilityElement, setNilValueForKey, setObservationInfo, setShouldGroupAccessibilityChildren, setValueForKey, setValueForKeyPath, setValueForUndefinedKey, setValuesForKeysWithDictionary, shouldGroupAccessibilityChildren, superclass, validateValueForKeyError, validateValueForKeyPathError, valueForKey, valueForKeyPath, valueForUndefinedKey, willChangeValueForKey, willChangeValueForKeyWithSetMutationUsingObjects, willChangeValuesAtIndexesForKey
-
-
-
-
Method Detail
-
accessInstanceVariablesDirectly
public static boolean accessInstanceVariablesDirectly()
-
alloc
public static MDLAsset alloc()
-
allocWithZone
public static java.lang.Object allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
-
assetWithSCNSceneBufferAllocator
public static MDLAsset assetWithSCNSceneBufferAllocator(SCNScene scnScene, MDLMeshBufferAllocator bufferAllocator)
-
automaticallyNotifiesObserversForKey
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
-
canExportFileExtension
public static boolean canExportFileExtension(java.lang.String extension)
canImportFileExtension: Indicates whether MDLAsset object can export asset to resource with the given extension- Returns:
- YES is returned if MDLAsset is able is able to export assets to resources with the given extension
-
canImportFileExtension
public static boolean canImportFileExtension(java.lang.String extension)
canImportFileExtension: Indicates whether MDLAsset object can be initialized with resource with the given extension- Returns:
- YES is returned if MDLAsset is able to load and represent assets with the given extension
-
cancelPreviousPerformRequestsWithTarget
public static void cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)
-
cancelPreviousPerformRequestsWithTargetSelectorObject
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget, org.moe.natj.objc.SEL aSelector, java.lang.Object anArgument)
-
classFallbacksForKeyedArchiver
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
-
classForKeyedUnarchiver
public static org.moe.natj.objc.Class classForKeyedUnarchiver()
-
debugDescription_static
public static java.lang.String debugDescription_static()
-
description_static
public static java.lang.String description_static()
-
hash_static
public static long hash_static()
-
instanceMethodForSelector
public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
-
instanceMethodSignatureForSelector
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
-
instancesRespondToSelector
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
-
isSubclassOfClass
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
-
keyPathsForValuesAffectingValueForKey
public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(java.lang.String key)
-
new_objc
public static java.lang.Object new_objc()
-
placeLightProbesWithDensityHeuristicUsingIrradianceDataSource
public static NSArray<? extends MDLLightProbe> placeLightProbesWithDensityHeuristicUsingIrradianceDataSource(float value, long type, MDLLightProbeIrradianceDataSource dataSource)
-
resolveClassMethod
public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
-
resolveInstanceMethod
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
-
setVersion_static
public static void setVersion_static(long aVersion)
-
superclass_static
public static org.moe.natj.objc.Class superclass_static()
-
version_static
public static long version_static()
-
URL
public NSURL URL()
[@property] URL URL used to create the asset If the asset was not created with a URL, nil will be returned.
-
addObject
public void addObject(MDLObject object)
addObject: Add a top level object to an asset. If the object was already in the asset, this has no effect.
-
bufferAllocator
public MDLMeshBufferAllocator bufferAllocator()
[@property] bufferAllocator Allocator used to create vertex and index buffers
-
childObjectsOfClass
public NSArray<? extends MDLObject> childObjectsOfClass(org.moe.natj.objc.Class objectClass)
childObjectsOfClass: Inspects an asset's hierarchy for objects of the specified class type This can be used to get references to all MDLMesh objects, MDLLights, etc. if objectClass is not a subclass of MDLObject, an exception will be raised.- Returns:
- returns an NSArray of all objects in the asset matching the requested class
-
copyWithZone
public java.lang.Object copyWithZone(org.moe.natj.general.ptr.VoidPtr zone)
- Specified by:
copyWithZonein interfaceNSCopying
-
count
public long count()
[@property] count The number of top level objects
-
countByEnumeratingWithStateObjectsCount
public long countByEnumeratingWithStateObjectsCount(org.moe.natj.general.ptr.VoidPtr state, org.moe.natj.general.ptr.Ptr<org.moe.natj.objc.ObjCObject> buffer, long len)- Specified by:
countByEnumeratingWithStateObjectsCountin interfaceNSFastEnumeration
-
endTime
public double endTime()
[@property] endTime End time bracket of animation data If no animation data was specified by resource or resource incapable of specifying animation data, this value defaults to 0. If the endTime was set explicitly, then the value of endTime will be the greater of the set value and the animated values.
-
exportAssetToURL
public boolean exportAssetToURL(NSURL URL)
exportAssetToURL: Export an asset to the specified URL.- Returns:
- YES is returned if exporting proceeded successfully,
-
exportAssetToURLError
public boolean exportAssetToURLError(NSURL URL, org.moe.natj.general.ptr.Ptr<NSError> error)
exportAssetToURL:error: Export an asset to the specified URL.- Returns:
- YES is returned if exporting proceeded successfully,
-
frameInterval
public double frameInterval()
[@property] frameInterval Inherent frame rate of an asset If no framerate was specified by resource or resource uncapable of specifying framerate, this value defaults to 0
-
initWithBufferAllocator
public MDLAsset initWithBufferAllocator(MDLMeshBufferAllocator bufferAllocator)
initWithBufferAllocator: Initialize an empty MDLAsset with a buffer allocator to be used during other operations.
-
initWithURL
public MDLAsset initWithURL(NSURL URL)
initWithURL: Initialize an MDLAsset using the contents of the resource located at the indicated URL Vertex layout (i.e. vertexDescriptor) will be specified by ModelIO depending on attributes of the resource. Buffers will be allocated using a default NSData based allocator Submeshes will be converted to triangle topology.
-
initWithURLVertexDescriptorBufferAllocator
public MDLAsset initWithURLVertexDescriptorBufferAllocator(NSURL URL, MDLVertexDescriptor vertexDescriptor, MDLMeshBufferAllocator bufferAllocator)
initWithURL:vertexDescriptor:bufferAllocator: Initialize an MDLAsset using the contents of the resource located at URL, ensuring that the asset conforms to the supplied vertexDescriptor, and buffers are allocated in the supplied allocator The default behavior is to triangulate any discovered meshes and to conform the mesh to the supplied vertexDescriptor. If nil is passed as the vertexDescriptor, then a vertexDescriptor will be created according to the attributes of the resource. If nil is passed as the bufferAllocator, buffers will be allocated using a default NSData based allocator. Submeshes will be converted to triangle topology.
-
initWithURLVertexDescriptorBufferAllocatorPreserveTopologyError
public MDLAsset initWithURLVertexDescriptorBufferAllocatorPreserveTopologyError(NSURL URL, MDLVertexDescriptor vertexDescriptor, MDLMeshBufferAllocator bufferAllocator, boolean preserveTopology, org.moe.natj.general.ptr.Ptr<NSError> error)
initWithURL:vertexDescriptor:bufferAllocator:preserveTopology:error: Same as initWithURL:vertexDescriptor:bufferAllocator: except that if preserveTopology is YES, a topology buffer might be created on the submeshes. If all faces in a submesh have the same vertex count, then the submesh will a geometry type corresponding to that vertex count. For example, if all faces have four vertices, then the geometry type will be MDLGeometryTypeQuads. If faces have a varying number of vertices, then the the submesh type will be MDLGeometryTypeVariableTopology, and a faceTopologyBuffer will be created.
-
masters
public MDLObjectContainerComponent masters()
[@property] masters Master objects that can be instanced into the asset's object hierarchy- See Also:
MDLObjectContainerComponent
-
objectAtIndex
public MDLObject objectAtIndex(long index)
objectAtIndex: return the indexed top level object
-
objectAtIndexedSubscript
public MDLObject objectAtIndexedSubscript(long index)
objectAtIndexedSubscript: return the indexed top level object
-
removeObject
public void removeObject(MDLObject object)
removeObject: Remove a top level object from an asset. If the object not in the asset, this has no effect.
-
setEndTime
public void setEndTime(double value)
[@property] endTime End time bracket of animation data If no animation data was specified by resource or resource incapable of specifying animation data, this value defaults to 0. If the endTime was set explicitly, then the value of endTime will be the greater of the set value and the animated values.
-
setFrameInterval
public void setFrameInterval(double value)
[@property] frameInterval Inherent frame rate of an asset If no framerate was specified by resource or resource uncapable of specifying framerate, this value defaults to 0
-
setMasters
public void setMasters(MDLObjectContainerComponent value)
[@property] masters Master objects that can be instanced into the asset's object hierarchy- See Also:
MDLObjectContainerComponent
-
setStartTime
public void setStartTime(double value)
[@property] startTime Start time bracket of animation data If no animation data was specified by resource or resource incapable of specifying animation data, this value defaults to 0. If startTime was set explicitly, then the value of startTime will be the lesser of the set value and the animated values.
-
startTime
public double startTime()
[@property] startTime Start time bracket of animation data If no animation data was specified by resource or resource incapable of specifying animation data, this value defaults to 0. If startTime was set explicitly, then the value of startTime will be the lesser of the set value and the animated values.
-
vertexDescriptor
public MDLVertexDescriptor vertexDescriptor()
[@property] vertexDescriptor Vertex descriptor set upon asset initialization Will be nil if there was no descriptor set
-
animations
public MDLObjectContainerComponent animations()
[@property] animations Animations that can be bound to MDLObjects (@see MDLAnimationBindComponent)- See Also:
MDLObjectContainerComponent
-
loadTextures
public void loadTextures()
loadTextures Iterates over all material properties on all materials. If they are string values or NSURL values, and can be resolved as textures, then the string and NSURL values will be replaced by MDLTextureSampler values.
-
objectAtPath
public MDLObject objectAtPath(java.lang.String path)
Return the object at the specified path, or nil if none exists there
-
resolver
public MDLAssetResolver resolver()
[@property] AssetResolver Resolver asset that helps find associated files The default asset resolver is the RelativeAssetResolver
-
setAnimations
public void setAnimations(MDLObjectContainerComponent value)
[@property] animations Animations that can be bound to MDLObjects (@see MDLAnimationBindComponent)- See Also:
MDLObjectContainerComponent
-
setResolver
public void setResolver(MDLAssetResolver value)
[@property] AssetResolver Resolver asset that helps find associated files The default asset resolver is the RelativeAssetResolver
-
-