This is a project based on the built-in example project, Voxel Editor.
Specifically, it adds several features to the original project, including:
- model editing capabilities (which is the core functionality of the original project),
- a user interface (UI) that conveniently adjusts sizes to fit different screens,
- the ability to save and load models, You can select the model to be loaded through the thumbnails in the model list panel.
- the option to freely name models,
- the capability to slice the model along the XYZ axes at any scale to facilitate the editing of the modelâs interior space, such as a castle model,
- the ability to shrink the model by half and enlarge it by double the scale,
- to cycle the model along the XYZ axes,
- You have the option to choose solid color blocks or blocks with textured material assets.
- the option to choose different block materials (which can be achieved by incorporating dependencies from different material projects, as long as the block names in each material library are ensured not to be repeated).
- There are two color panels (I originally planned to only keep one set), and I have not yet determined which colors to provide.
- You can even import terrain blocks generated by voxel terrain to perform internal editing. If you wish to manually edit an adventurerâs cave, this is a great option. It is important to note that the terrain blocks should not be too large, as this may cause the program to crash.
dependences(already imported into project, There is no need to manually import it into the project.):
- Block Library
- UI
- Cameras
- Touches
I would like to express my gratitude to the following friends whose shared code has been utilized in this project.
â Using @John Millardâs base code
â Using @UberGoober 's undo/redo code, voxel models and the new block library.
â Using @SugarRay 's objcTextView code.
The known bug is that the volume:resize(x, y, z)
function exhibits a significant error when processing the X parameter. @John, it seems itâs up to you now, as if I recall correctly, you are the only one in the team who is an expert in these voxel module codes. Of course, when you have spare time available.
Some menu options may not be very intuitive in relation to their implemented functions. I will find time later to record some tutorial videos, or interested friends can start exploring on their own for now.
tut video:
- Create a model
- Save/load a model
- Half/double a model
- Split a model and edit its internal space
note
You need to manually create a directory named âMyAmuseModelsâ under the Documents folder of Codea to back up your models. The backup is conducted automatically, and it occurs each time you exit the viewer normally, which enhances the security of your models. You can access it within the code using the asset keyasset.documents.MyAmuseModels
.
good news!
@sim helped us identify the cause of the performance issues in version 3.10 and provided a solution. After testing (on an iPad, Codea version 3.10.1), it has very perfectly resolved the issue, so our project no longer requires a specific version. All versions can now run smoothly! I hope everyone enjoys using it!
This video teaches you how to use TestFlight to downgrade the Codea version to 3.9.8 (443).
run on iphone(Codea version 3.9.8) video:
The video was played at its original speed without any fast-forwarding.
Please temporarily ignore the UI buttons that may appear somewhat chaotic (as the UI adaptation for the iPhone has not yet been done).
- version log
â V007[20240329]: itemPanel.lua modify the model loading path to asset.models.all
â V008[20240329]: fix the performance issue with @simâs help, modify _dep_Craft:UI cache spriteSize
â V009[20240330]: backup models to asset.documents.MyAmuseModels when close viewer(exit)
Strictly speaking, this is a semi-finished product. The code is written rather casually (as it was developed in fits and starts during spare time), with a significant amount of redundant code. Many planned features are yet to be implemented, such as better color selection options and support for user interface layouts on screens of various sizes (currently, it only considers a 12.9-inch screen), as well as detailed online help (which I have not written at all; I originally intended to refine it thoroughly before sharing, but the recent version update has led to a sharp decline in performance.
I am very grateful for the assistance from @sim, and I have followed your instructions to disable viewer.warning. Other projects have returned to their original smoothness, but this particular project remains very sluggish. I suspect it might be related to my UI code, but pinpointing and resolving such an issue is a bit beyond my capabilities.
I have just tested several different beta versions and found that the project runs very smoothly on version 3.9.8 (443), but it becomes sluggish immediately upon updating to the next version, 3.10 (445).
I am not clear on what optimizations Codea has made internally that might have affected my UI code (perhaps the way I wrote the UI code has caused some conflict with the latest version of Codea), but identifying and solving this problem is clearly beyond my ability.
Moreover, I worry that with subsequent version updates, this fun project, into which I have invested a considerable amount of my leisure time, may become a pile of unexecutable junk. Therefore, although this project is still in an extremely incomplete stage of development, I have decided to release it. Perhaps other friends might be able to identify the cause of its sudden and severe performance degradation.
MyAmuseVoxel.zip (1.3 MB)