Skip to content

Commit 655bab6

Browse files
committed
Surface promotion, remixing and attribution
1 parent 5c0af84 commit 655bab6

File tree

3 files changed

+51
-4
lines changed

3 files changed

+51
-4
lines changed

PROMOTION.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## Avatar Promotion
2+
3+
As part of saving your avatar, you can choose to allow Mozilla to promote your avatar. If you choose to allow Mozilla to promote your avatar, you grant to Mozilla a non-exclusive, worldwide, royalty-free, sublicensable license under all of your rights necessary to review your avatar, and publish, distribute, and promote it as part of Hubs or related Mozilla promotional efforts.

REMIXING.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## Remixing
2+
3+
Allowing remixing means that others can download, edit, change, and re-publish your Hubs avatar as long as they give credit to the creators of the avatar. If you allow remixing, you agree to license your avatar under a [CC-BY 3.0](https://creativecommons.org/licenses/by/3.0/legalcode) license. We’ll provide you an opportunity to include the attribution information you want to include. This information will be associated with the avatar, but not stored with your account.
4+
5+
You can change this setting at any time, by re-saving your avatar.
6+
7+
If you don't allow remixing, your content will be published under the Hubs [Terms of Service](https://github.com/mozilla/hubs/blob/master/TERMS.md).

src/react-components/avatar-editor.js

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export default class AvatarEditor extends Component {
4242
componentDidMount = async () => {
4343
if (this.props.avatarId) {
4444
const avatar = await this.fetchAvatar(this.props.avatarId);
45+
avatar.creatorAttribution = (avatar.attributions && avatar.attributions.creator) || "";
4546
Object.assign(this.inputFiles, avatar.files);
4647
this.setState({ avatar, previewGltfUrl: avatar.base_gltf_url });
4748
} else {
@@ -115,6 +116,9 @@ export default class AvatarEditor extends Component {
115116
const fileUploads = await Promise.all(filesToUpload.map(f => this.inputFiles[f] && upload(this.inputFiles[f])));
116117
const avatar = {
117118
...this.state.avatar,
119+
attributions: {
120+
creator: this.state.avatar.creatorAttribution
121+
},
118122
files: fileUploads
119123
.map((resp, i) => [filesToUpload[i], resp && [resp.file_id, resp.meta.access_token, resp.meta.promotion_token]])
120124
.reduce((o, [k, v]) => ({ ...o, [k]: v }), {})
@@ -242,7 +246,7 @@ export default class AvatarEditor extends Component {
242246
</div>
243247
);
244248

245-
checkbox = (name, label, disabled) => (
249+
checkbox = (name, children, disabled) => (
246250
<div className="checkbox-container">
247251
<input
248252
id={`avatar-${name}`}
@@ -252,7 +256,7 @@ export default class AvatarEditor extends Component {
252256
checked={!!this.state.avatar[name]}
253257
onChange={e => this.setState({ avatar: { ...this.state.avatar, [name]: e.target.checked } })}
254258
/>
255-
<label htmlFor={`#avatar-${name}`}>{label}</label>
259+
<label htmlFor={`#avatar-${name}`}>{children}</label>
256260
</div>
257261
);
258262

@@ -283,8 +287,41 @@ export default class AvatarEditor extends Component {
283287

284288
{this.mapField("orm_map", "ORM Map", "image/*", false, "Occlussion (r), Roughness (g), Metallic (b)")}
285289

286-
{debug && this.checkbox("allow_promotion", "Allow Promotion")}
287-
{debug && this.checkbox("allow_remixing", "Allow Remixing")}
290+
<hr />
291+
292+
{this.checkbox(
293+
"allow_promotion",
294+
<span>
295+
Allow{" "}
296+
<a
297+
href="https://github.com/mozilla/hubs/blob/master/PROMOTION.md"
298+
target="_blank"
299+
rel="noopener noreferrer"
300+
>
301+
Promotion
302+
</a>
303+
</span>
304+
)}
305+
{this.checkbox(
306+
"allow_remixing",
307+
<span>
308+
Allow{" "}
309+
<a
310+
href="https://github.com/mozilla/hubs/blob/master/REMIXING.md"
311+
target="_blank"
312+
rel="noopener noreferrer"
313+
>
314+
Remixing
315+
</a>{" "}
316+
<span>
317+
(under{" "}
318+
<a href="https://creativecommons.org/licenses/by/3.0/" target="_blank" rel="noopener noreferrer">
319+
CC-BY 3.0
320+
</a>)
321+
</span>
322+
</span>
323+
)}
324+
{this.textField("creatorAttribution", "Your Attribution (optional)", false, false)}
288325

289326
{/* {this.mapField("ao_map", "AO Map", "images/\*", true)} */}
290327
{/* {this.mapField("metallic_map", "Metallic Map", "image/\*", true)} */}

0 commit comments

Comments
 (0)