Skip to content

Commit

Permalink
model swapping now possible
Browse files Browse the repository at this point in the history
  • Loading branch information
rhiannanberry committed Mar 11, 2020
1 parent bd99f77 commit e4e6067
Show file tree
Hide file tree
Showing 66 changed files with 30,952 additions and 268 deletions.
Binary file added includes/icons/body.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added includes/icons/head.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,546 changes: 1,546 additions & 0 deletions includes/icons/icons.ai

Large diffs are not rendered by default.

Binary file added includes/icons/icons_body.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added includes/icons/icons_curvy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added includes/icons/icons_hair_blair.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added includes/icons/icons_hair_long.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added includes/icons/icons_hair_messy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added includes/icons/icons_hair_none.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added includes/icons/icons_head.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added includes/icons/icons_jacket.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added includes/icons/icons_shirt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added includes/icons/icons_straight.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added includes/icons/jacket.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added includes/icons/shirt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13,828 changes: 13,828 additions & 0 deletions includes/models/hubs_model_short_messy.gltf

Large diffs are not rendered by default.

15,338 changes: 15,338 additions & 0 deletions includes/models/hubs_model_short_messy_sep.gltf

Large diffs are not rendered by default.

Binary file added includes/models/merged/model_curvy_blair.blend
Binary file not shown.
Binary file not shown.
Binary file added includes/models/merged/model_curvy_blair.glb
Binary file not shown.
Binary file added includes/models/merged/model_curvy_long.blend
Binary file not shown.
Binary file added includes/models/merged/model_curvy_long.blend1
Binary file not shown.
Binary file added includes/models/merged/model_curvy_long.glb
Binary file not shown.
Binary file added includes/models/merged/model_curvy_none.blend
Binary file not shown.
Binary file added includes/models/merged/model_curvy_none.blend1
Binary file not shown.
Binary file added includes/models/merged/model_curvy_none.glb
Binary file not shown.
Binary file added includes/models/merged/model_curvy_short.blend
Binary file not shown.
Binary file added includes/models/merged/model_curvy_short.glb
Binary file not shown.
Binary file added includes/models/merged/model_straight_blair.blend
Binary file not shown.
Binary file not shown.
Binary file added includes/models/merged/model_straight_blair.glb
Binary file not shown.
Binary file added includes/models/merged/model_straight_long.blend
Binary file not shown.
Binary file added includes/models/merged/model_straight_long.blend1
Binary file not shown.
Binary file added includes/models/merged/model_straight_long.glb
Binary file not shown.
Binary file added includes/models/merged/model_straight_none.blend
Binary file not shown.
Binary file added includes/models/merged/model_straight_none.blend1
Binary file not shown.
Binary file added includes/models/merged/model_straight_none.glb
Binary file not shown.
Binary file added includes/models/merged/model_straight_short.blend
Binary file not shown.
Binary file not shown.
Binary file added includes/models/merged/model_straight_short.glb
Binary file not shown.
Binary file added includes/models/separated/blends/curvy.blend
Binary file not shown.
Binary file added includes/models/separated/blends/curvy.blend1
Binary file not shown.
Binary file added includes/models/separated/blends/hair_blair.blend
Binary file not shown.
Binary file added includes/models/separated/blends/hair_long.blend
Binary file not shown.
Binary file added includes/models/separated/blends/hair_short.blend
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added includes/models/separated/blends/straight.blend
Binary file not shown.
Binary file added includes/models/separated/blends/straight.blend1
Binary file not shown.
Binary file modified includes/models/separated/hubs_model_short_messy.blend
Binary file not shown.
Binary file not shown.
124 changes: 21 additions & 103 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
"mini-css-extract-plugin": "^0.9.0",
"node-sass": "^4.13.1",
"prettier": "^1.19.1",
"react": "16.12.0",
"react-dom": "16.12.0",
"react": "^16.5.2",
"react-dom": "^16.5.2",
"sass-loader": "^8.0.2",
"style-loader": "^1.1.3",
"stylelint": "^13.0.0",
Expand Down
65 changes: 32 additions & 33 deletions src/components/body-editor.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
import React, { Component } from "react";
import * as THREE from "three";
import EditorUtils from "./editor-utils";
import {EditorPage} from "./editor-page"
import Buttons, {DisableButton, PresetColorButton, CustomColorButton, TextureButton} from "./buttons"
import Buttons, {TextureButton} from "./buttons"

import PropTypes from "prop-types";
import { LabeledTexture } from "../labeled-texture";
import Material from "./material"

import ColorPicker from "./color-picker"

import straight from "../../includes/icons/icons_straight.png"
import curvy from "../../includes/icons/icons_curvy.png"

import skin from "../../includes/textures/skin_default.png";
import blush from "../../includes/textures/blush_default.png";
import logo from "../../includes/textures/logo_front/ae.png"
Expand All @@ -28,51 +32,46 @@ export default class BodyEditor extends Component{
new Material(this.props.model.material.clone(), "skin", [new LabeledTexture(skin)]),
new Material(this.props.model.material.clone(), "blush", [new LabeledTexture(blush)])
]
this.color = "red"
this.editorPage = React.createRef();
this.state = {
skin:new THREE.Color().randomize().getHexStringFull(),
blush:new THREE.Color().randomize().getHexStringFull()
}
EditorUtils.setMaterialColor(this.state.skin, this.materials[0])
EditorUtils.setMaterialColor(this.state.blush, this.materials[1])

}

render() {
console.log(this.color)

render() {
return (
<EditorPage ref={this.editorPage}>
<label>Body Type</label>
<ColorPicker
color={this.color}
colors={["#aaabbb", "#ababab"]}
onChange={(e) => {this.color = e.hex; console.log(e.hex)}}
/>
<div>
<TextureButton value="1" defaultChecked={true} name="body-type" src={logo} />
<TextureButton value="2" defaultChecked={false} name="body-type" src={skin} />
<TextureButton value="1" defaultChecked={true} name="body-type" src={straight} />
<TextureButton value="2" defaultChecked={false} name="body-type" src={curvy} />
</div>
<label>Skin Color</label>
<div>
<CustomColorButton
value="0"
defaultChecked={true}
name="body-color"
onClick={(e) => {this.materials[0].setActive(true)}}
onChange={ (clr) => { EditorUtils.setMaterialColor(clr, this.materials[0]) } }
/>

{ EditorUtils.presetColorButtons(skinColors, "body-color", this.materials[0]) }

<ColorPicker
color={this.state.skin}
colors={skinColors}
onChange={(e) => {
this.setState({skin:e.rgb});
EditorUtils.setMaterialColor(e.hex, this.materials[0])
}}
/>

</div>
<label>Blush</label>
<div>
<DisableButton value="0" name="blush-color" onChange={(e) => {this.materials[1].setActive(false)}}/>

<CustomColorButton
value="1"
defaultChecked={true}
name="blush-color"
onClick={(e) => {this.materials[1].setActive(true)}}
onChange={(clr) => {EditorUtils.setMaterialColor(clr, this.materials[1])}}
/>

{ EditorUtils.presetColorButtons(blushColors, "blush-color", this.materials[1]) }
<ColorPicker
color={this.state.blush}
colors={blushColors}
onChange={(e) => {
this.setState({blush:e.rgb});
EditorUtils.setMaterialColor(e.hex, this.materials[1])
}}
/>
</div>
</EditorPage>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/buttons.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export class TextureButton extends Component {
return (
<RadioButton
id={this.props.id}
onChange= { (e) => {if (typeof props.onChange == "function") props.onChange(e)} }
onChange= { (e) => {if (typeof this.props.onChange == "function") this.props.onChange(e)} }
value={this.props.value}
defaultChecked={this.props.defaultChecked}
name={this.props.name}
Expand Down
4 changes: 2 additions & 2 deletions src/components/color-picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { CustomPicker } from 'react-color'
import { Hue, Saturation, Swatch } from 'react-color/lib/components/common'
import color from 'react-color/lib/helpers/color'

export const ColorPicker = ({ hsl, hsv, colors, onChange }) => {
export const ColorPicker = ({ hex, hsl, hsv, colors, onChange }) => {
const styles = {
customContainer: {
height: 50,
Expand Down Expand Up @@ -33,7 +33,7 @@ export const ColorPicker = ({ hsl, hsv, colors, onChange }) => {
swatch: {
width: 50,
height: 50,
//background: hex,
background: hex,
borderRadius: 4
},
}
Expand Down
Loading

0 comments on commit e4e6067

Please sign in to comment.