Giter Site home page Giter Site logo

decentraland / builder Goto Github PK

View Code? Open in Web Editor NEW
147.0 27.0 73.0 549.05 MB

๐Ÿ‰ Build scenes for Decentraland

Home Page: https://builder.decentraland.org

License: Other

HTML 0.09% TypeScript 84.68% CSS 6.96% JavaScript 8.26% Shell 0.01%
builder decentraland land dapp 3d-editor

builder's Introduction

Decentraland Builder Coverage Status

You can create beautiful scenes for Decentraland even if you don't own a parcel.

How to run

The builder is a SPA or single page application built with create-react-app. It uses an .env file as configuration for a few things, you'll need to create that first.

After that, to run this app you have two options:

  • Development Server: run npm start from the root path
  • Production: run npm run build and host the resulting index.html file with your server of choice, for example python -m SimpleHTTPServer 5000

For more information, check the create-react-app repo.

Environment

This project depends on a few environment variables to work, as well as external services for some features. The front-end connects to these services via URLs set via environment variables.

Creating an environment file

You'll need Create an .env file on the root folder and fill it following the .env.example file found there.

You will need to specify NODE_PATH to be src.

Here are the basic requirements to run the project:

# .env

NODE_PATH=src

builder's People

Contributors

2fd avatar abarmat avatar agusferreira avatar belohlavek avatar braianj avatar cazala avatar chakravarthy7102 avatar cyaiox avatar dependabot-preview[bot] avatar dependabot[bot] avatar eordano avatar flobarreto avatar fzavalia avatar gonpombo8 avatar juanigallo avatar juanmahidalgo avatar kevinszuchet avatar lautaropetaccio avatar lauti7 avatar malaniz avatar matiasjaure avatar meelrossi avatar menduz avatar nachomazzara avatar nchamo avatar nearnshaw avatar nicosantangelo avatar olavra avatar pbosio avatar twaldorf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

builder's Issues

Translation gizmo and hooks

We need to be able to move stuff with a translation gizmo

The gizmos should affect the client entities and report back the state changes for the builder to update its internal representation of the scene. Only the client side hooks should be implemented for this issue.

Add option to edit project layout

Edit:

We need to investigate the possibility of adding an option to allow the user to edit the scene size. Say you pick a 2x3 scene but decide you want it to be 2x2 later, you need to redo the entire scene.

Publish/Deploy to LAND

Projects should be deployable to a LAND or Estate. There should be a button in the top toolbar for this.

Play mode

The play mode should place the user in first person view (similar to the CLI).

Undo/Redo

We need the client to report the simplified node that was changed together with a path to that specific node. Then, we can store the reference to previous redux states to perform time travel undo/redo.

Modal state

There should be a modal reducer for all modals in the app:

  • Contest modal
  • New project modal
  • Deployment (publish) modal

Project creation templates

screen shot 2019-01-14 at 12 28 01

We should support project creation templates for:

  • 1x1
  • 2x2
  • 3x2
  • Custom builds up to 32 parcels (+ modal)

Depends on #60

Save and display projects locally

Projects should be saved to localstorage and displayed in the home page for users to continue work without exporting/re-importing data.

Refactor category domain

Categories can be derived from already existing state and will make filtering/searching easier

Asset pack state

  category: {
    [name]: {
      name: string,
      assets: string[] // assetId
    }
  },
  assetPack: {
    [assetPackId]: {
      id: string, // id=title-version?
      title: string,
      assets: string[]
    }
  },
  asset: AssetDescriptor & { id: string, assetPackId: string }[]

App state

Redux state

{
  wallet: {
    /*(...)*/
  },
  camera: {
    zoom: number,
    origin: Vector2,
    rotation: Vector4
    // position => caculated on the fly
  },
  scene: {
    [sceneId]: {
      id: string,
      metrics: {
        triangles: number,
        materials: number
      },
      tree: SimplifiedNode // what we send to the client
    }
  },
  project: { // current project from URL
    [projectId]: {
      id: string,
      title: string,
      description: string,
      ownerEmail: string,
      parcels: {x:number, y:number}[],
      scene_id: string
    }
  },
  ui: {
    sidebarVisible: boolean,
    viewport: 'preview' | 'editor',
    modal: (...)
  },
  editor: {
    mode: 'move' | 'rotate' | 'scale'
    selectedEntity: string // instance of asset
  },
  category: {
    [name]: {
      name: string,
      assets: string[] // assetId
    }
  },
  assetPack: {
    [assetPackId]: {
      id: string, // id=title-version?
      title: string,
      assets: string[]
    }
  },
  asset: AssetDescriptor & { id: string, assetPackId: string }[]
}

Endpoint responses

/api/assetPacks
returns AssetPack[]

type AssetPack = {
  // Asset pack manifest version (1 by default)
  version: number
  // Asset pack title
  title: string
  assets: AssetDescriptor[]
}

type AssetResource = {
  // Asset display name
  name: string
  // Resource URL (content server)
  url: string
  thumbnail: string
}

type AssetDescriptor = AssetResource & {
  id: string
  // Tag list
  tags: string[]
  category: string
  variations: AssetResource[]
} 

Notes

  • Colissions toggle is internal state
  • Toolbar:
    • No scalling
    • No skins
    • The rest of the "left" buttons are internal state
    • The "guy" icon (spawn point) won't be there no more
  • Asset detail:
    • We won't have a description, dimensions or creator for now
  • Probably not for the MVP:
    • Search
    • Variations

TODO

  • Who controls client window sagas?
    Possible answer: have a client? module that hooks the events and fires actions. The other modules listen to the actions and don't use window

Keyboard shorcut reference

We need a modal that can display all the active shortcuts. This modal should be displayed by clicking a button at the bottom-right of the editor viewport.

Depends on #17

Scaffold Editor layout

We require:

  • A topbar
  • A sidebar

The initial layout with initial background colors is enough

Topbar toggle buttons

screen shot 2019-01-14 at 10 11 42

These two buttons should:

  • Toggle play/edit mode
  • Toggle sidebar visibility

All functionality implementation is required for this issue as buttons should already be implemented by #46 and the sidebar should be already implemented by #30, lastly the play mode should already be implemented by #12

Working Project module

The business logic domain for the current opened project:

Settings reducer

  • Project name
  • Parcels
    (And any other scene.json fields that are relevant)

Scene reducer

  • Scene tree (simplified nodes)

Load AssetPacks from content server

The assetpack manifest should contain an asset as follows:

      {
        "id": "abc-def-fgh",
        "name": "Test",
        "thumbnail": "<direct content server url>",
        "url": "Tree/Tree_StarterPack.gltf",
        "tags": ["test"],
        "category": "test",
        "variations": [],
        "mappings": {
           "Tree/Tree_StarterPack.gltf': 'https://content.decentraland.today/contents/QmdmNp5MuRxkNAAsyFd7z3nFGYcPaeZQRjFDm4AphE7K4V',
           "Tree/texture.png": '<content server url>'
         }
      }

All model dependencies must be listed in the dependencies field of the asset pack

The mappings sent to the client should be defined as follows:

{
  '<assetpack-uuid>/Tree/Tree_StarterPack.gltf': 'https://content.decentraland.today/contents/QmdmNp5MuRxkNAAsyFd7z3nFGYcPaeZQRjFDm4AphE7K4V'
}

Where the asetpack id servers as a namespace to avoid conflicts with assets that share the same name

Limits detail view UI

screen shot 2019-01-14 at 10 04 45

screen shot 2019-01-14 at 10 05 27

screen shot 2019-01-14 at 10 05 36

We need a widget at the bottom of the editor viewport where users can display the current count towards the parcel limits. The count should be displayed in <metric>: x/y format as in "Materials: 5/10" and a link to the docs should be displayed after the list.

Editor interoop enhancements

We should optimize the mappings sent to the editor, we are sending all of them when only a few are needed.

We should optimize the js code generation, creating randomly named variables is good enough but we can use an array and be sure that we will never have naming collisions. Also we should only use ES5 syntax.

Decoration Palette

There should be a palette where decorative items packs can be displayed based on their category and searched based on their tags (may be name as well?).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.