Skip to content

Commit 701404a

Browse files
committed
Updated engon from monorepo commit f309e58c0a949b3c388cdcead68af72b3e1d661f
1 parent 3e15857 commit 701404a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+4448
-520
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<a href="https://github.com/polygoniq/engon/issues/new?assignees=&labels=question&template=04_SUPPORT_QUESTION.md&title=support%3A+">Ask a Question</a>
1818
<br />
1919

20-
[![Buy on BlenderMarket](https://img.shields.io/badge/Buy_on-BlenderMarket-orange?style=flat)](https://blendermarket.com/products/engon?ref=673)
20+
[![Buy on Superhive](https://img.shields.io/badge/Buy_on-Superhive-orange?style=flat)](https://superhivemarket.com/products/engon?ref=673)
2121
[![Buy on Gumroad](https://img.shields.io/badge/Buy_on-Gumroad-blue?style=flat&color=%23fb80e8)](https://polygoniq.gumroad.com/l/engon/)
2222
[![Project license](https://img.shields.io/github/license/polygoniq/engon.svg?style=flat)](LICENSE)
2323
[![Pull Requests welcome](https://img.shields.io/badge/PRs-welcome-ff69b4.svg?style=flat)](https://github.com/polygoniq/engon/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22)

__init__.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@
106106
from . import asset_registry
107107
from . import asset_pack_installer
108108
from . import pack_info_search_paths
109+
from . import available_asset_packs
109110
from . import asset_helpers
110111
from . import preferences
111112
from . import convert_selection
@@ -132,12 +133,12 @@
132133
bl_info = {
133134
"name": "engon",
134135
"author": "polygoniq xyz s.r.o.",
135-
"version": (1, 5, 1), # bump doc_url and version in register as well!
136+
"version": (1, 6, 0), # bump doc_url and version in register as well!
136137
"blender": (3, 6, 0),
137138
"location": "polygoniq tab in the sidebar of the 3D View window",
138139
"description": "Browse assets, filter and sort, scatter, animate, adjust rigs",
139140
"category": "Object",
140-
"doc_url": "https://docs.polygoniq.com/engon/1.5.1/",
141+
"doc_url": "https://docs.polygoniq.com/engon/1.6.0/",
141142
"tracker_url": "https://polygoniq.com/discord/",
142143
}
143144

@@ -154,14 +155,17 @@ def _post_register():
154155
polib.ui_bpy.expand_addon_prefs(__package__)
155156
prefs.first_time_register = False
156157

158+
addon_updater_ops.check_for_update_background()
159+
157160

158161
def register():
159162
# We pass mock "bl_info" to the updater, as from Blender 4.2.0, the "bl_info" is
160163
# no longer available in this scope.
161-
addon_updater_ops.register({"version": (1, 5, 1)})
164+
addon_updater_ops.register({"version": (1, 6, 0)})
162165

163166
utils.register()
164167
pack_info_search_paths.register()
168+
available_asset_packs.register()
165169
convert_selection.register()
166170
panel.register()
167171
scatter.register()
@@ -195,6 +199,7 @@ def unregister():
195199
scatter.unregister()
196200
panel.unregister()
197201
convert_selection.unregister()
202+
available_asset_packs.unregister()
198203
pack_info_search_paths.unregister()
199204
utils.unregister()
200205

addon_updater_ops.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1472,7 +1472,7 @@ def register(bl_info):
14721472
# check for update in user preferences found a new version, show a popup
14731473
# (at most once per blender session, and it provides an option to ignore
14741474
# for future sessions); default behavior is set to True.
1475-
updater.show_popups = True
1475+
updater.show_popups = False
14761476
# note: if set to false, there will still be an "update ready" box drawn
14771477
# using the `update_notice_box_ui` panel function.
14781478

asset_helpers.py

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434

3535

3636
PARTICLE_SYSTEMS_COLLECTION = "engon_particle_systems"
37+
GEONODES_TARGET_COLLECTION = "engon_geometry_nodes"
3738
ANIMATION_EMPTIES_COLL_NAME = "animation_empties"
3839

3940

@@ -50,7 +51,7 @@
5051
BOTANIQ_ALL_SEASONS_RAW = "spring-summer-autumn-winter"
5152
BQ_COLLECTION_NAME = "botaniq"
5253
BQ_VINE_GENERATOR_NODE_GROUP_NAME = "bq_Vine_Generator"
53-
BQ_CURVES_GENERATOR_NODE_GROUP_NAME = "bq_Generator_Curves"
54+
BQ_CURVES_SCATTER_NODE_GROUP_NAME = "bq_Curve_Scatter"
5455
BQ_ANIM_LIBRARY_BLEND = "bq_Library_Animation_Data.blend"
5556

5657
# traffiq constants
@@ -299,6 +300,38 @@ def gather_instanced_objects(
299300
yield from instance_collection.all_objects
300301

301302

303+
def gather_curves_instanced_objects(
304+
objects: typing.Iterable[bpy.types.Object],
305+
) -> typing.Iterator[bpy.types.Object]:
306+
"""Goes through 'objects' and gathers all objects instanced in curve scatter.
307+
308+
This checks whether any object from 'objects' is a polygoniq curve scatter and if yes
309+
it yields objects from curve scatter instance collections.
310+
"""
311+
for obj in objects:
312+
for mod in obj.modifiers:
313+
if mod.type != 'NODES':
314+
continue
315+
316+
mod = typing.cast(bpy.types.NodesModifier, mod)
317+
318+
if mod.node_group is None or not mod.node_group.name.startswith(
319+
BQ_CURVES_SCATTER_NODE_GROUP_NAME
320+
):
321+
continue
322+
323+
for group_input in mod.node_group.inputs:
324+
if group_input.type == 'COLLECTION' and group_input.description.startswith(
325+
"bq_Curve_Scatter_Collection"
326+
):
327+
if mod.get(group_input.identifier) is not None:
328+
yield from mod.get(group_input.identifier).all_objects
329+
330+
instance_collection = mod.node_group.nodes.get("Instance Collection")
331+
if instance_collection is not None and instance_collection.collection is not None:
332+
yield from instance_collection.collection.all_objects
333+
334+
302335
def get_car_color() -> typing.Tuple[float, float, float]:
303336
value = random.random()
304337
idx = bisect.bisect(TQ_COLOR_DISTRIBUTION, value, key=lambda x: x[0]) - 1

asset_pack_installer.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,8 @@ def _get_install_path(self) -> str:
784784
description="Select Asset Pack Install Path",
785785
set=_set_install_path,
786786
get=_get_install_path,
787+
# We use custom file browser in lower versions
788+
subtype='DIR_PATH' if bpy.app.version >= (4, 1, 0) else 'NONE',
787789
)
788790

789791
# Used for passing to operators when offering to switch operation

asset_registry.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ def __init__(
157157
# newest one.
158158
self.full_name = full_name
159159
# Short name of the asset pack, without variant
160+
# TODO: This might not be unique for all asset packs, as evermotion packs don't have
161+
# variants in their names and are treated differently.
160162
assert "_" in full_name
161163
self.short_name = full_name.rsplit("_")[0]
162164
# Semantic version of the asset pack
@@ -473,6 +475,9 @@ def _unregister_pack(self, asset_pack: AssetPack) -> None:
473475
def get_registered_packs(self) -> typing.Iterable[AssetPack]:
474476
return self._packs_by_full_name.values()
475477

478+
def get_registered_packs_full_names(self) -> typing.Set[str]:
479+
return set(self._packs_by_full_name.keys())
480+
476481
def get_install_paths_by_engon_feature(self) -> typing.Dict[str, typing.List[str]]:
477482
"""Returns a dictionary with engon features as keys and list of related packs as values"""
478483
output_dict: typing.Dict[str, typing.List[str]] = {}

0 commit comments

Comments
 (0)