|
Sweet Home 3D Forum » List all forums » » Forum: Developers » » » Thread: Import room from .json » » » » Post: Import room from .json |
Print at Dec 20, 2025, 10:17:21 PM |
| Posted by ilaria_123 at Sep 26, 2018, 11:57:31 AM |
|
Import room from .json Hello, I am new to the whole MVC paradigm and it's been a while since I've used Java. I am trying to write a plug-in where I can read a set of vertices from a .json file and draw a room with those vertices in SH3D (ideally I'd like to draw it in 2D and in 3D). It should be something extremely easy to do, so I've implemented the whole thing (I used the VolumePlugin example and I changed what happens in the execute() method) and it works up to the point where I try to actually add a wall (or a room) to the home. In fact, what happens is that the wall/room are simply not showed on the screen; the home stays empty. So I stripped the method out of everything else and simply added a couple of lines where I just add a wall to the home, and still I can't manage to see the new wall on the screen. This is the code I'm using: Wall new_wall = new Wall(0.0, 0.0, 3.0, 0.0, 0.01, 2.5);I read in the plug-in guide that because of the way the Plugin class has been implemented, all changes should be immediately reflected on the screen; however, now I'm thinking I'm missing something. Should I use HomeController or View or something else and refresh/redraw? I'm sorry if this is a dumb question but I spent the whole afternoon yesterday trying to figure it out and couldn't. Any help would be appreciated. Thanks, Ilaria |
|
|
Current timezone is GMT Dec 20, 2025, 10:17:21 PM |