3d Model Loader Extension

An extension to load 3d models into an application.

Currently, the extension supports all the standard 3d model formats such as OBJ, 3ds, ASC and MD2 formats. :upside_down_face:

There are a few blocks currently, there are many features to cover :smiley:


โ€” Blocks

load

Loads the Model into an Object.

  • model: The file path of the 3d model. This can also be a URI Object.
  • options: Configurations settings to load the Model in List form.

Options for types of Models:

Note: Scale can be in form of floating decimal

  • 3ds: Scale
  • asc: Scale and Swap (boolean)
  • md2: Scale
  • obj: MTL properties (File path / URI Note: can be empty) and Scale

The property list cannot be empty

  • type: The type of the model, valid properties are "3ds, asc, md2, obj". Case insensitive.

Initialize

Initializes the model in the arrangement.

  • arrangement: Vertical or Horizontal arrangement
  • model: The model that was loaded.

Load texture

By default, there is no texture applied, this will load the texture into the memory

  • texture: File path or the URI to the resources image
  • textureName: The name for the texture (an identity)

Note: Don't try to load the texture with the same textureName more than once.


ApplyTexture

Applies the texture into the model.

  • model: The model that was loaded.
  • textureName Is the name of the texture that was loaded.

Set-Get

Sets the background colour of the surface (view) the model is placed in.


โ€” Examples and blocks

  • Loading and Initializing the model

Store the loaded model into a variable, to avoid loading it again over.


  • Applying the texture to the model

If you are in companion, only call LoadTexture once even if you refresh the companion.


  • Working with SAF

Since the extension also accepts URI objects, you can use the SAF extension by @vknow360.


โ€” The results



โ€” Download extension

xyz.kumaraswamy.themodel.aix (156.5 KB)
This extension was created with Rush by @Shreyash :upside_down_face:


Feel free to suggest new things :grinning:
Thanks!

22 Likes

wow super cool extension @KUMARASWAMY_B.G :clap:

1 Like

Very good extension :+1:

2 Likes

Well, epic :grinning::heart:

4 Likes

Thank You for this amazing extension! :star_struck::+1:t4:

1 Like

So far for the next version, I'm able to implement more controllability to the 3d models, create worlds, adjust the surfaces, light, camera position, object collision movement and more :smiley:

We could make a 3d game maybe now :face_with_hand_over_mouth:

4 Likes

Unity: "He's too dangerous to be left alive!"

4 Likes

yawnface

really excited to V2 :grin: :grin:

3 Likes

What is the maximum file size that I can upload? My friend's made a really neat Cybertruck using SketchUp, and we're really excited to see if we can make an app out of it.
It's 128MB in size (.obj of course).

Hi, there isn't any specif limit put on to loading the models, I was able to load a file with 70 MB, unfortunately loading 121 MB did not work for me, it would take too much to load.), well if you could like maybe resize it, it would be good.

2 Likes

Isn't loading from the assets not supported?

image

And maybe type could be extracted from the filename so you would have a socket less?

3 Likes

I had to use these settings in order for the object to display properly / fully (on a Android 9 device).

6 Likes

Currently, the extension cannot load the asset files if you testing in a companion but if you test it as an APK, it should work.

I will do the changes accordingly for the next version :slightly_smiling_face:

1 Like

No, I already checked it.

On Andoid 9:

grafik

Weird, I am able to get this working on Android 11.

Can you send me your project file?

Yes, it works only if you set no slash. It doesn't work with โ†’ //.

And this should work on all Android versions with Companion & APK:

But it doesn't work with Companion on Android 11.

2 Likes

... and also it doesn't work on Android 9 with Companion (using an .obj file from the assets).

It is just supposed to work how other things work...