Skip to content

Commit

Permalink
2024.1.1 (#4)
Browse files Browse the repository at this point in the history
* Update subrepos.

* restore missing updates

restores missing updates

* "Paste" content URL button now filters out file name

"Paste" content URL button now filters out pasted file name automatically

* Replace Blender SDK with Python SDK submodule

* Update submodules.

* Update venv name.

* Remove vircadia-world-meta submodule

* Remove old sdk folder.

* Reinitialized vircadia_world_sdk_py submodule with new name

* Update types further.

* Update README to explain how to install plugin.

* Rename files, prep realtime capability for Blender as a client.

* WIP to setup Realtime functionality.

* WIP.

* Update subrepo.

* Delete docs that were added back by accident.

* Update filters.

* Merge current state [not finished].

---------

Co-authored-by: Aitolda <[email protected]>
  • Loading branch information
digisomni and Aitolda authored Oct 17, 2024
1 parent b88dd9a commit 528124d
Show file tree
Hide file tree
Showing 27 changed files with 1,041 additions and 195 deletions.
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
test/export/*
test/import/*

development-env/
.venv/

wheels/
dist/*

# Python
__pycache__
9 changes: 3 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "vircadia-world-meta"]
path = vircadia-world-meta
url = https://github.com/vircadia/vircadia-world-meta
[submodule "vircadia-world-sdk-blender"]
path = vircadia-world-sdk-blender
url = https://github.com/vircadia/vircadia-world-sdk-blender.git
[submodule "vircadia_world_sdk_py"]
path = vircadia_world_sdk_py
url = https://github.com/vircadia/vircadia-world-sdk-py.git
51 changes: 37 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,32 @@ This is a Blender add-on that allows the creation of full Vircadia worlds within
## Installation

1. Download the latest release from the [releases page](https://github.com/vircadia/vircadia-world-tools/releases).
2. Open Blender and go to `Edit > Preferences > Add-ons`.
3. Click `Install` and select the downloaded folder.
4. Enable the add-on.
5. Make sure your right sidebar is open, if not the hotkey typically is `N` to open it.
6. Navigate to the `Vircadia` tab.
1. Open your Blender scripting console and run the following command:
```python
import sys
print(sys.executable)
```
1. This will print the path to your Python executable. Now, with that path, run the following command:
```python
/path/to/blender/python -m pip install supabase
```
1. In Blender, go to `Edit > Preferences > Add-ons`.
1. Click `Install` and select the downloaded folder.
1. Enable the add-on.
1. Make sure your right sidebar is open, if not the hotkey typically is `N` to open it.
1. Navigate to the `Vircadia` tab.

## Requirements
## Development

Blender Version 4.2 (LTS) or later.
### Requirements

## Development
* Blender Version 4.2 (LTS) or later. (accessible via path as "`blender`")
* Python 3.12
* pip (usually comes with Python)

Pull this repository recursively to get the submodules.
### Steps

1. Clone this repository recursively to get the submodules:

```bash
git clone --recurse-submodules https://github.com/vircadia/vircadia-world-tools.git
Expand All @@ -29,12 +42,22 @@ If you've already cloned it without the submodules, you can initialize and updat
git submodule update --init --recursive
```

1. Make a 'development-env' venv with python 3.10 or later.
2. Install the dependencies with pip.
3. Run Blender from the command line with the development add-on enabled.
2. Navigate to the project directory:

```bash
cd vircadia-world-tools
```

3. Create and activate a virtual environment:

```bash
python -m venv .venv
source .venv/bin/activate # On Windows, use `.venv\Scripts\activate`
```

4. Install the project dependencies:

```bash
python3 -m venv development-env
source development-env/bin/activate
pip install -r requirements.txt
```

14 changes: 11 additions & 3 deletions blender_manifest.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
schema_version = "1.0.0"

id = "vircadia_world_tools"
id = "vircadia_world_blender_tools"
version = "0.1.0"
name = "Vircadia World Tools"
name = "Vircadia World Blender Tools"
tagline = "Create and edit Vircadia worlds in Blender"
maintainer = "Vircadia Contributors <[email protected]>"
type = "add-on"
Expand All @@ -15,6 +15,14 @@ license = [
"SPDX:Apache-2.0",
]

wheels = [
]

platforms = [
"windows.x86_64",
"linux.x86_64",
"macos-arm64",
]

[permissions]
files = "Import/export Vircadia environments to/from disk"

12 changes: 6 additions & 6 deletions import_export/__init__.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
from . import old_json_importer
from . import old_json_exporter
from . import gltf_importer
from . import gltf_exporter
from . import world_import
from . import old_gltf_exporter

def register():
old_json_importer.register()
old_json_exporter.register()
gltf_importer.register()
gltf_exporter.register()
world_import.register()
old_gltf_exporter.register()

def unregister():
gltf_exporter.unregister()
gltf_importer.unregister()
old_gltf_exporter.unregister()
world_import.unregister()
old_json_exporter.unregister()
old_json_importer.unregister()
129 changes: 0 additions & 129 deletions import_export/gltf_importer.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def export_glb(context, filepath):

# Add register and unregister functions to avoid the attribute error
def register():
print("gltf_exporter registered")
print("old_gltf_exporter registered")

def unregister():
print("gltf_exporter unregistered")
print("old_gltf_exporter unregistered")
4 changes: 2 additions & 2 deletions import_export/old_json_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import json
import os
import logging
from ..utils import coordinate_utils, object_utils, property_utils, world_setup, collection_utils, error_handling
from ..utils import coordinate_utils, property_utils, world_setup, object_creation, collection_utils, error_handling

def load_json(file_path):
try:
Expand Down Expand Up @@ -34,7 +34,7 @@ def import_entities(data, json_directory):
entity["shape"] = "Shape"

try:
obj = object_utils.create_blender_object(entity)
obj = object_creation.create_blender_object(entity)
if obj is not None:
logging.info(f"Created Blender object: {obj.name}")

Expand Down
Loading

0 comments on commit 528124d

Please sign in to comment.