My problem:
OK, let’s see… I have a folder on my desktop named “my_ext_1.0”.
And inside this folder, there are two parts: one is a sub-folder, named “ext_subfolder” (contains a rb file “ext_main.rb” and a folder “ext_images”); Another is a rb file “ext_loader.rb”.
Let’s make it clear:
my_ext_1.0 >> ext_subfolder (ext_main.rb + ext_images) + ext_loader.rb
Now, I am ready to publish this into a SketchUp extension.
So:
I send “my_ext_1.0” to the compressed folder, and get a “my_ext_1.0.zip”
I renamed “my_ext_1.0.zip” to “my_ext_1.0.rbz”, the logo of the zipped file changed to SketchUp Ruby Extension RBZ icon.
I open the SketchUp 2019, windows → extension manager → install extension → select “my_ext_1.0.rbz”
I restart the SketchUp 2019, AND DID NOT FIND MY EXTENSION THERE.
I check in file explorer:
C:\Users\ME\AppData\Roaming\SketchUp\SketchUp 2019\SketchUp\Plugins
In the plugin folder, I was surprised that:
Instead of having two files “ext_subfolder” and “ext_loader.rb”, I actually got a combined folder “my_ext_1.0”.
When installing an rbz file, the zipped file is meat to be exploded, all the inside parts should go into the Plugins folder. However, I believe the problem is due to when I install my “my_ext_1.0.rbz” file, this file was regarded as an entity to added into Plugin folder.
The structure of your zip/rbz file is wrong. By convention, the structure of a SketchUp extension rbz is:
zip file
→ extension registration rb file
→ extension folder
→ extension loader rb file
→ any other required rb files
→ other subfolders and content as needed (e.g. images, icons, dialog html, etc.)
Edit: that didn’t format right. I need to review my markdown syntax. I meant the first two items to be at the same level and the rest to be nested inside the extension folder.
Also by convention, the name of the registration file matches the name of your extension and the extension folder has the same name without the .rb suffix. The extension loader file can have any name; it is specified in the registration file.
To create an rbz,
change to the folder that contains the registration rb fle
create a zip file containing the registration file, the extension folder and its contents
Thanks to Steve Baumgartner for your replying. You have suggested very useful stuff which names of the folder and the registration must be the same.
After I fix this, I tried the procedure, however, it’s the same result that:
I actually got a combined folder “my_ext_1.0" in Plugins.
I wondered whether the registration.rb is not working. So:
I put my subfolder (containing “ext_loader.rb”, “ext_main.rb” and “images”) into the Plugins. (I did NOT put “ext_register.rb” into the Plugin)
Rather, I opened SketchUp 2019 and opened up Ruby Code Editor, copy all stuff from “ext_register.rb” and run.
The ruby console said:
Registration of extension Edge Connect was blocked
“false”
I have not submit this extension to be accessed by the reviewers yet, I just want to test everything works. ^v^
Let’s assume your tool is named Qiny-WonderTool
It will consist of two parts when it’s in the Plugins folder: Qiny-WonderTool.rb [the loader RB which sets up the Extension]
and a subfolder named exactly the same: Qiny-WonderTool
that subfolder contains all of the other files needed to make the Extension work.
ALL Ruby files should be RB at this stage, because any ‘signing’ process requires that, and any desired encryption to RBE is done during that process.
When you make the ZIP select both the RB and the same name subfolder, add them to the ZIP file - named say Qiny-WonderTool.zip
To check it’s worked open the ZIP and you should see the two at its base level, opening the zipped subfolder should reveal its contents.
Now you simply rename the .ZIP as .RBZ [you need to have filetype extensions visible to do this]. Qiny-WonderTool.rbz
You can probably set up your compression software to treat RBZ files as ZIP - then you can double-check its contents.
On installing Qiny-WonderTool.rbz the RB and same name subfolder should appear in the Plugins folder.
Errors in the loader RB file might prevent the Extension Manager showing it as loaded…
Having those files in the Plugins folder and using the Ruby Console to:
load "Qiny-WonderTool.rb"
Will show error messages without ever going through the RBZ steps…
In the past a very few compression apps have caused issues with making suitable ZIP files - what are you using ??
Thank you for replying mate. I will have a go now.
I am not using an application, I used Windows 10 right click - send to - compressed folder. By the way, my [control panel - personalize - file explorer options - view - advanced - (un-tick hide)] is correctly settled.
Problem solved, which is Awesome! Thank you very much to slbaumgartner and TIG, I really appreciate your help.
Here is a quick summary:
After you made the zip folder, you must click on it to check what’s inside. If it only contains a folder, IT WON’T WORK.
You must create another zip file by the correct procedure. which is:
Select your rb file (for registration)
press Ctrl, select another your folder (contains all other stuff)
(#WARNING: both items must have the same name. for example: Qiny-WonderTool.rb & Qiny-WonderTool)
right click, send both file to the compressed folder.
Then it should work!
My issue though is once I had downloaded the master file (click to download), the plugin is not an RBZ file, it’s a ZIP that looks like this in the file explorer:
An rbz is simply a zip file with a particular internal structure. It always contains a top-level Ruby file, and for a SketchUp extension usually a folder named for the extension. The top level file is the “registrar “ that tells SketchUp about the extension. The folder contains any additional Ruby files and supporting files such as images. With that structure, you get an rbz from a zip simply by changing the .zip file’s extension to .rbz.
So if that’s the structure of what you have, you simply need to rename it. If that’s not the structure it is not a valid rbz.
You need to edit the name by changing the filename extension. Your OS may resist that, making you verify that it is really what you wanted to do, as changing the filename extension will usually associate a file with a different app. In the listing you showed, I don’t know what the Thumbs database file is for, but it wouldn’t usually be top-level like that in an rbz. When the SketchUp extension manager installs the rbz, I think it will put Thumbs directly into the Plugins folder, where it really doesn’t belong. You might try removing that file and see if the extension will load and run correctly.
Probably, Better not touch the structure - the files seemed to be different size. I would guess that the folder FPSNav_for _SketchUp_Master ís the one you need to zip and rename to .rbz but I am only guessing.
So, It seems like he’s saying I need to move the Chatham_FPSNav.rb into the plugins folder, then move the “thumbs” into the fps nav folder, like this, (Starting from the extraction):
Then I need to put the fps nav folder into the plugins folder, like this:
I installed FPS Nav successfully, but the fork from GitHub I couldn’t figure out:
So, I thought it would be a good idea to ask for help on a topic that was discussing the very issue I’m having.
If I have broken some of the bullets in Keep it Tidy, please forgive me, and I will condense my replies into one post, then delete, copy, and paste a new reply into the “Walk/Fly WASD+Mouse Navigation Mode” topic that was referred to by @dezmo.
I did not find any harmful code with a quick check, but could be conflicted by other extension…because it does not follow the basic rules of making extensions.
Use your own risk:
Here is the .rbz FPSNav.rbz (343.9 KB)
Thanks for doing that for me @dezmo, it seems to not work right anymore though. It probably isn’t your fault. Eye height is not locked when moving. Thank you so much!
Edit: actually I kinda like that the eye height isn’t locked now.