Skip to content

Commit

Permalink
Merge pull request #314 from Exairnous/fix-default-particle-image
Browse files Browse the repository at this point in the history
Fix the default particle emitter source example URL and add a warning
  • Loading branch information
Exairnous authored Oct 19, 2024
2 parents e45e941 + b78a4a4 commit c3ad345
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion addons/io_hubs_addon/components/definitions/particle_emitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class ParticleEmitter(HubsComponent):

src: StringProperty(
name="Image Source", description="The web address (URL) of the image to use for each particle",
default="https://example.org/spoke/assets/images/dot-75db99b125fe4e9afbe58696320bea73.png")
default="https://assets.example.org/spoke/assets/images/dot-75db99b125fe4e9afbe58696320bea73.png")

ageRandomness: FloatProperty(
name="Age Randomness", description="Age Randomness", default=10.0)
Expand Down Expand Up @@ -107,6 +107,21 @@ class ParticleEmitter(HubsComponent):
angularVelocity: FloatProperty(
name="Angular Velocity", description="Angular Velocity", unit="VELOCITY", default=0.0)

def draw(self, context, layout, panel):
alert_src = getattr(self, "src") == self.bl_rna.properties['src'].default
for key in self.get_properties():
if not self.bl_rna.properties[key].is_hidden:
row = layout.row()
if key == "src" and alert_src:
row.alert = True
row.prop(data=self, property=key)
if key == "src" and alert_src:
warning_row = layout.row()
warning_row.alert = True
warning_row.label(
text="Warning: the default URL won't work unless you replace 'example.org' with the domain of your Hubs instance.",
icon='ERROR')

def gather(self, export_settings, object):
props = super().gather(export_settings, object)
props['startVelocity'] = {
Expand Down

0 comments on commit c3ad345

Please sign in to comment.