Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the default particle emitter source example URL and add a warning #314

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading