Viewport Creator Plugin

Now that the ViewportFrame feature is in beta testing, I figured that it might be useful to create and release a plugin that makes it easier to put content in a ViewportFrame. Here’s the result:

Link to the plugin

How it works

The plugin allows users to easily add selected instances to a preview ViewportFrame in the plugin's widget. This preview uses the workspace's CurrentCamera so you can move your camera around to perfectly fit objects in the frame. There are a few colored buttons to change the background of this preview in case it is difficult to see the objects in the preview.

Available buttons:

  • Import Selection: Add a copy of currently selected objects to the preview.
  • Export to Selection: If you have a ViewportFrame selected, copy the contents of the preview over to the selection.
  • Lock/unlock preview: A toggle to lock the preview in place, in case you find the perfect angle but want to move your camera.
  • Clear Viewport: Removes all instances from the preview.

Available options:

  • Clear viewport after exporting: If this box is ticked, your preview will be cleared after you export your selection to the selected ViewportFrame. This option is useful when you have a lot of exporting to do and you don’t want to keep pressing Clear Viewport.
  • Clear children of selection upon export: If the ViewportFrame you want to export to has children, these will all be deleted before copying over the instances from the preview; Useful if you want to replace the contents of a ViewportFrame, but not so if they contain important children.

If you find any bugs, let me know. At this moment the plugin only supports dark theme, however everyone is free to edit the plugin and add more features if they so desire. Enjoy!

64 Likes

Yes. This is going to save me so much time when I (finally) play with ViewPortFrames today. Thanks!

1 Like

Cool!

Possible extra feature could be to show the Vector3 offset from the center of the visible children. This means it would be useful for people creating item thumbnails and such.

I made myself a plugin that does similar:

5 Likes

One huge oversight I found while using this today is that it clears all the children of a viewportframe. It should only remove the model and the camera. I almost lost some work due to this…

1 Like