Romania
Joined: Apr 24, 2014
Post Count: 808
Status:
Offline
Modeller 3D plugin
While some people are busy with serious stuff, I’m continuing with the YAUP series. This is the first version of the Modeller 3D plugin . The name sounds more impressive than it actually is. It’s a pale imitation of Blender and ArtOfIllusion. Based on plugins created by Emmanuel Puybaret: -BasicShapeGenerator (2022) -ShapeGenerator (2020) -TerrenGenerator (2022) Help taken from Miss Claude AI (Sonnet 4.6) (free version)
Purpose: -Generate, modify, and add a custom shape to the house plan WARNING: It’s full of bugs. Use with caution.
It looks something like this:
Also available on SourceForge and PluginManager.
---------------------------------------- A computer program does what you tell it to do, not what you want it to do. Murphy's Law When all else fails, read the instructions. Murphy's Law If you don't like "AS IS", DIY. Dorin's law
----------------------------------------
[Edit 2 times,
last edit by dorin at Mar 20, 2026, 7:05:38 PM]
Netherlands
Joined: Apr 8, 2022
Post Count: 1743
Status:
Offline
Re: Modeller 3D plugin
Great work! This might make the use of Blender obsolete for most model design tasks.
A few remarks & wishes: - Right-click-drag to rotate the model is a little awkward when we use left-click-drag in the Sweet home 3D 3Dview. Perhaps switch with the left-click-drag for the select rectangle. - Transparency doesn't seem to work. - It definitely needs the same reload as the roof generator: when you select a generated model and start the 3D modeller it should load that model. That allows to add changes without having to repeat the previous creation when it was not the latest model in the modeller. For now it can be limited to only generated models but in the future it might be possible to load any model. - The current preview is perspective. This means that you can't drag a selection rectangle to select faces on the front, it will select everything. In some future version it would be very nice to have an orthogonal view (flat) and only select the visible faces with the selection rectangle and not the ones behind it. - Do not clear the selection when you click outside the model. Add buttons to Select all/none. - Very important!: Allow full (vertical) rotation. Currently you can never see/reach the bottom faces. - Also important: add ctrl-Z to undo the last actions. - A drop down for the materials. Allow to add/remove materials. (Even if a new material is not used yet.) Add buttons to (Un)Select by the selected material name. Keep the selection when you select another material to select again. This way you can select all faces for multiple material names and reassign a new material for the combination of selections. - Add smoothing/flat for the selected faces. Don't invent the wheel again, the code for it is out there in multiple versions.
A suggestion: make sure you completely license this to YOU with mandatory acknowledgment. You don't want someone else to take credit and make money with YOUR work. Leave only the Sweet Home 3D parts (libs) licensed as they are. You might even think about making this a separate application.
You're on the right track. So far this already looks great! Slowly add other options and this will become a very, very important plugin for those users that create their own models or want to change materials or make small changes in existing models.
---------------------------------------- Dodecagon.nl 1300+ 3D models, manuals, and projects
Romania
Joined: Apr 24, 2014
Post Count: 808
Status:
Offline
Re: Modeller 3D plugin
@Keet Thanks for your feedback! I could have bet you'd be the first (and probably the only) person to be happy about this. While I was working on this plugin, I had you in mind the whole time. I warned you that it's full of bugs. Let me start with what works: 1.
-Transparency doesn't seem to work.
Try this: - Set the transparency to 50%; - Uncheck the wireframe checkbox; - OK. Bug: the plugin also exports the wireframe portion. I'll now continue with what isn't working: 1.
- Right-click-drag to rotate the model is a little awkward when we use left-click-drag in the Sweet home 3D 3Dview.
I know that, and it bothers me too. I'll see how I can fix it without messing up the others.
- Do not clear the selection when you click outside the model.
Okay, but how do you suggest I deselect all items? It works the same way with the RoofGenerator plugin. It does this when the button is released if no drag operation has been performed. I’ll take a closer look at this. 2.
Add buttons to Select all/none.
That could be a solution. 3.
- It definitely needs the same reload as the roof generator
This means that the objects must be special furniture, just like the roofs. Maybe sometime in the future. 4.
- The current preview is perspective. This means that you can't drag a selection rectangle to select faces on the front, it will select everything. In some future version it would be very nice to have an orthogonal view (flat) and only select the visible faces with the selection rectangle and not the ones behind it.
You're right, but it's pretty much the same with AOI. I don't know how it works in Blender. I will investigate this aspect of the issue further. 5.
- Very important!: Allow full (vertical) rotation. Currently you can never see/reach the bottom faces.
I know. One workaround I used was to lift the entire object so I could access the underside. I'll try to figure something out, too. 6.
- Also important: add ctrl-Z to undo the last actions.
That's what I'm missing too, but first I need to fix the undo/redo feature. 7.
Allow to add/remove materials. (Even if a new material is not used yet.)
Okay, but that might only apply to the current session of SH3D. The feature that lets you name faces was inspired by you. 8.
- Add smoothing/flat for the selected faces. Don't invent the wheel again, the code for it is out there in multiple versions.
Where? Give me some directions. 9.
A suggestion: make sure you completely license this to YOU with mandatory acknowledgment.
How? What else do I need to do? 10. Have you tried the torus option for creating bent cylinders? That was also a suggestion you made. In fact, that’s how I got started on this plugin.
---------------------------------------- A computer program does what you tell it to do, not what you want it to do. Murphy's Law When all else fails, read the instructions. Murphy's Law If you don't like "AS IS", DIY. Dorin's law
Netherlands
Joined: Apr 8, 2022
Post Count: 1743
Status:
Offline
Re: Modeller 3D plugin
- Set the transparency to 50%; - Uncheck the wireframe checkbox;
Yep, with the wireframe box unchecked it works.
- It definitely needs the same reload as the roof generator
This means that the objects must be special furniture, just like the roofs. Maybe sometime in the future.
I don't understand in what way it has to be a 'special' object. It would be perfect if a 'normal' obj definition could be read, i.e read all the vertices and faces (like importing furniture.)
- The current preview is perspective. This means that you can't drag a selection rectangle to select faces on the front, it will select everything. In some future version it would be very nice to have an orthogonal view (flat) and only select the visible faces with the selection rectangle and not the ones behind it.
You're right, but it's pretty much the same with AOI. I don't know how it works in Blender.
In Blender you can switch between perspective and orthogonal view. You can multi-select (or unselect) everything that is visible in the view. That means you don't select vertices/faces that are hidden behind the front faces. Only a part of a face needs to be visible to be included in the selection. Besides that you can select/unselect everything by material name. What is very nice is that you draw a free-hand area for (un)selecting, not a rectangle. The selection is not lost when you click outside the area so you can draw a selection area multiple times to get everything you want to select. An example with a sphere in the work area: Draw a selection around the sphere and select faces. Delete the selection, what is left is half a sphere.
Allow to add/remove materials. (Even if a new material is not used yet.)
Okay, but that might only apply to the current session of SH3D. The feature that lets you name faces was inspired by you.
And an important feature. For now I need Blender for that or manually edit the obj/mtl files. If you get so far as being able to read an existing object than a material pulldown can be populated with the materials found in the object definition. In the current situation you can add to the pulldown when a new material name is assigned. After that you can select a material name to select all faces with that material name. Keep the selection and you can select another material name and add it to the selection (or assign it to a new name or another name in the pulldown.) Of course the pulldown can also be a list (Blender has a list, not a pulldown)
- Add smoothing/flat for the selected faces. Don't invent the wheel again, the code for it is out there in multiple versions.
Where? Give me some directions.
Search for "mesh smoothing code" and you will find multiple sites that either explain the process, have actual code, or point to libraries on github/sourceforge that allow you to implement smoothing. Start here: https://nosferalatu.com/LaplacianMeshSmoothing.html It gives a good explanation and examples (C code). You'll be surprised how little code it takes.
A suggestion: make sure you completely license this to YOU with mandatory acknowledgment.
How? What else do I need to do?
I stated that wrong, GPL3 is fine but you should mark all of YOUR code as copyrighted by you. In several plugins I have seen user created code where the copyright is stated as spacemushrooms where it should be the creator. Only the libraries used from Sweet Home 3D should be left untouched. The template to start a new plugin is a template to create YOUR code and should have your copyright. Having the copyright is important because it makes you the owner and gives you the right to change to a different license later on if you wish so. You might want to investigate a dual-license to prevent commercial use in closed source like the new Sweet Home 3D has become. I think all of the advanced plugins should do this.
It's all work in progress. Keep it up, you are doing great!
---------------------------------------- Dodecagon.nl 1300+ 3D models, manuals, and projects
Joined: Mar 23, 2020
Post Count: 101
Status:
Offline
Re: Modeller 3D plugin
Excellent Work as usual :-) If interested I have some code for creating Sweep 3D geometry , that's creating a profile by 2d shape designer and sweep it along a path.
---------------------------------------- Windows 64bit | Intel i7 | 8GB Ram | SH3D 7.5 + Plugins
Romania
Joined: Apr 24, 2014
Post Count: 808
Status:
Offline
Re: Modeller 3D plugin
@Xlance Thanks, but mine is a mere fraction of yours. I'm interested in Sweep 3D geometry. I've been working for a while on a new feature I want to add to the MBC plugin. My original idea was to add "Extrude room," but now it might be "Sweep room." "MBC" will probably become "MBCS." We'll see. Thank you very much for your offer, and I'll see how I can use your source code.
@Keet You have a lot of valuable requests. I’ll try to fulfill a few of them. First, I need to clarify one thing: the two plugins (this one and the roof generator) have in common the fact that they generate objects based on the parameters entered. The Roof Generator plugin only appears to load a roof. In fact, it regenerates it every time based on the parameters saved along with the roof. This means that the parameters are serialized (I don’t know the details; Daniels118 did it—thanks, Daniele) and are saved as special properties of the roof object. The same thing should be done with the objects generated by this plugin. As for loading objects into the plugin for editing (as in Blender, AOI, or FreeCAD), I’ll leave that task to Xlance, whose plugin is far more complex and advanced in its development. I’ll keep working on improving the current features as much as possible, and only then will I try to add new ones. In the meantime, I’d like to go back to the roof generator plugin and continue working on something I’ve already started but put on hold.
About the "Plugin Template" folder. I created it with the intention of helping other adventurous developers with ideas to build plugins for SH3D. It’s not perfect; anyone can add whatever they want (licenses, logs, resources). An Eclipse plugin that generates an SH3D plugin template based on a user-filled form would probably be better.
@Everyone who hasn't gotten bored yet. A new version (1.1) of the Modeller3D plugin. -I've changed how you navigate, select, and edit using the mouse. -I've tried to improve the texturing. -I've improved the "Undo/Redo" functionality, including Ctrl+Z. -I've probably introduced a lot of other bugs, so please be careful when using it.
Translated with DeepL.com (free version)
---------------------------------------- A computer program does what you tell it to do, not what you want it to do. Murphy's Law When all else fails, read the instructions. Murphy's Law If you don't like "AS IS", DIY. Dorin's law
----------------------------------------
[Edit 1 times,
last edit by dorin at Mar 23, 2026, 11:11:10 AM]
Joined: Mar 23, 2020
Post Count: 101
Status:
Offline
Re: Modeller 3D plugin
@dorin The sweepb3d code is fully functional and independent of javafx or java 3d (i guess) so its a matterof copy and paste, and the additional objects in my shape generator could also be imported in your 3d modeler (i guess the classes are transferable)
P.S. the edit faces, points, edges function is AWESOME :-)
---------------------------------------- Windows 64bit | Intel i7 | 8GB Ram | SH3D 7.5 + Plugins
Netherlands
Joined: Apr 8, 2022
Post Count: 1743
Status:
Offline
Re: Modeller 3D plugin
The ctrl+Z function does a little too much With a single change ctrl+Z should revert that last change. Since there was only one change pressing ctrl+Z again should do nothing, but it executes some weird other changes and never reverts to the original. Look at the Terrain Generator where the arrows at the top execute undo/redo. Those button clicks are the same as ctrl+Z (undo) and ctrl+Y (redo). You can see that a button becomes unavailable if there is nothing to undo or redo. I suspect that an array is used to keep track of the last 20? 50? changes and "walks back" to revert each next change. Redo "walks" up the array until the end. A new change after an undo probably cuts of everything in the array after the current position. You can see that in the TerrainGenerator: do some changes and undo one or two, then do a new change: the redo button becomes unavailable, i.e. the elements in the array after the current position are removed.
By-the-way, I absolutely LOVE that it is possible to set exact coordinates for points. That alone makes this a valuable plugin: it exceeds the 8-point limit of the 3D Shape Generator. You don't want to know how many times I just need one or two more points for a shape
---------------------------------------- Dodecagon.nl 1300+ 3D models, manuals, and projects
----------------------------------------
[Edit 1 times,
last edit by Keet at Mar 23, 2026, 1:02:53 PM]
Romania
Joined: Apr 24, 2014
Post Count: 808
Status:
Offline
Re: Modeller 3D plugin
@Xlance
The sweepb3d code is fully functional
I'll see when I see it
P.S. the edit faces, points, edges function is AWESOME :-)
Believe me, it's not my fault! @Keet
With a single change ctrl+Z should revert that last change. Since there was only one change pressing ctrl+Z again should do nothing, but it executes some weird other changes and never reverts to the original.
That doesn't sound right. I only ran a few quick (superficial) tests before publishing, and it seemed to work. I tried it again just now and didn't notice any issues. Please give me a way to reproduce the problem. It's possible that after multiple edits, "Undo" might produce strange results (I've already noticed this). There may also be some strange results after restarting the plugin during the same session. This still needs to be investigated.
Look at the Terrain Generator where the arrows at the top execute undo/redo.
You're right. The main difference is that TerrenGenerator was created by a professional (Emmanuel), while this one was made by someone with no training in the field (I'm not a programmer).
You don't want to know how many times I just need one or two more points for a shape
I don't even want to, but I already know. What are friends for? Test it some more and let me know what isn't working properly, separate from what you'd like it to do. We'll tackle those requests one by one.
---------------------------------------- A computer program does what you tell it to do, not what you want it to do. Murphy's Law When all else fails, read the instructions. Murphy's Law If you don't like "AS IS", DIY. Dorin's law
----------------------------------------
[Edit 1 times,
last edit by dorin at Mar 23, 2026, 4:06:59 PM]
Netherlands
Joined: Apr 8, 2022
Post Count: 1743
Status:
Offline
Re: Modeller 3D plugin
With a single change ctrl+Z should revert that last change. Since there was only one change pressing ctrl+Z again should do nothing, but it executes some weird other changes and never reverts to the original.
That doesn't sound right. I only ran a few quick (superficial) tests before publishing, and it seemed to work. I tried it again just now and didn't notice any issues. Please give me a way to reproduce the problem.
I tried it again: start with the default cube. Select a corner and drag it a little outside. Undo (either the button or ctrl+Z). It does revert but the undo button should be greyed out now (nothing left to undo). Clicking undo acts like a redo, once undo again works. From that moment on multiple undo's seems to change the coordinates slightly. Repeats do the same. Check if you add movement to the undo queue. You should only add a change to the queue with mouse-up, not every coordinate in the path between the original and end points.
Look at the Terrain Generator where the arrows at the top execute undo/redo.
You're right. The main difference is that TerrenGenerator was created by a professional (Emmanuel), while this one was made by someone with no training in the field (I'm not a programmer).
That shouldn't keep you from "reviewing" the undo/redo code. It keeps the overall code for Sweet Home 3D the same where possible. It's also a good way to learn how a professional did it. You have to look for when the status of the model is stored to the queue. From there you can follow how that is done. Same for the redo. You can learn a lot from this.
Hint: RoomsTerrainGeneratorPlugin.java
import javax.swing.undo.AbstractUndoableEdit; import javax.swing.undo.CannotRedoException; import javax.swing.undo.CannotUndoException; import javax.swing.undo.UndoManager; import javax.swing.undo.UndoableEditSupport; line 431 // Manage local undo / redo actions with a separated undo manager line 770 elevationsUndoSupport: investigate and use it! line 1422 postElevationChange You probably already know that "super" refers to the parent class.)
Dig down and try to follow what happens. Most of the work is already done using the java and Sweet Home 3D libraries. You just have to figure out how to use it
---------------------------------------- Dodecagon.nl 1300+ 3D models, manuals, and projects