Git Product home page Git Product logo

nicolas-constanty / dnai.editor Goto Github PK

View Code? Open in Web Editor NEW
138.0 16.0 32.0 209.66 MB

Dnai Editor - Visual Scripting (Node Editor)

Home Page: https://nicolas-constanty.github.io/Dnai.Editor/

License: Other

QMake 1.40% C++ 64.06% QML 17.72% Shell 2.40% C 12.16% JavaScript 0.07% Ruby 0.07% Python 0.87% AppleScript 0.28% Batchfile 0.94% PowerShell 0.01%
editor visual-scripting graph-editor flow-graph flowgraph dataflow-programming qt5 graph dataflow node-editor

dnai.editor's Introduction

Main view screenshot


Build status Build Status Build Circle Ci CodeFactor Codacy Badge

Dnai Editor is a visual scripting software that allow you to code with node editing. This editor allow to create ".dnai" files that you can share on our hub. Those ".dnai" are binary files, that can be read by our plugins.

For now we already have a Unity3D plugin, that you can find here. We are currently working on JavaScript library in order to read dnai in JS application.

The Concept

Our main goal is to provide a way to share "logics" over different solutions :

IMAGE ALT TEXT

IMAGE ALT TEXT

Main view screenshot

You can download it for Windows, and macOS on Dnai website.

Exemple of basic case

A self-driving car can be usefull in real life but such AI are also really nice for video games. In a very basic case, a car could use two distance sensors in order to avoid obstacle, one the left and one the right. The "logic" behind could be define as follow :

  • if leftSensorDistance < minDistance && rightSensorDistance < minDistance then stop the car.
  • if leftSensorDistance < minDistance then turn right.
  • if rightSensorDistance < minDistance then turn left.

If we extract the logic behind the avoidance, we can see that in video games we use a RayCast instead of distance sensor as input for leftSensorDistance and rightSensorDistance. As we can see the logic behind remain the same whether you are in real life or in a video game.

The idea here, is to bring an interface that can handle such case, for that we use our ".dnai" file created by our editor. Notice that for now we only have a Unity3D plugin so can test it only on Unity at this point. In the futur we want to bring JavaScript and Python capability in order to add more compatibity and interest for our solution.

Installation

If you want to test our editor you can get if from our website https://dnai.io/download.

You just need to follow the installation instructions, we maintain a Windows 10 and MacOs deploiement.

Compilation

You can compile the software using Qt >= 5.10.1, but you will need our "Core" library to run it properly.

Build the server

  • Get the repository content
git clone https://github.com/Nicolas-Constanty/Dnai.Editor.git
git submodule update --init --recursive
  • Open Dnai.Editor/Server/Server.pro with qt creator
  • Build->Run qmake
  • Build->Build All

Build the editor

  • Open Dnai.Editor/Gui/DNAI.pro with qt creator (Qt >= 5.10.1)
  • Build->Run qmake
  • Go to Projects->Build->Add Build step->Make
  • add "install" to the make argument

Main view screenshot

  • Build->Build All

Install dependencies

  • Our Core library sources remain private until it become more mature, so you can get it here.
  • Put binary files of the Server inside [YOUR BUILD DNAI FOLDER]/app you can find your build directory in the "Projects" tab on the left
  • Put binary files of the Core inside [YOUR BUILD DNAI FOLDER]/app/Core
  • Press Run on Qt

Documentation

We need to improve our actual documentation, but for now you can find a doxygen here.

Authors

Adrien Wery - Website API and Dnai.Editor (github)

Fernand Veyrier - Dnai.Core (virtual machine for compilation) and Unity3D Plugin (github)

Nicolas Constanty - Dnai.Editor and Website design (github)

Quentin Gasparoto - Dnai.Core (virtual machine for compilation) and Dnai.Editor (github)

Victor Gouet - Dnai.Server, Deploiement Windows/Mac and Dnai.Editor (github)

See also the list of contributors who participated in this project.

License

Licensed under the (L)GPL v2/3 License, with Qt Open source licence.

dnai.editor's People

Contributors

gasparq avatar gouet avatar nicolas-constanty 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

dnai.editor's Issues

Edit enumeration

User story

As a user, I want to manage enumerations, in order to set predefined data in my behaviour.

Conditions of satisfaction

Conditions Description Status
C1 A user can declare an enumeration entity into a context or a class ✔️
C2 A user can add a new literal to an enumeration ✔️
C3 A user can set the storage type of the enumeration ✔️
C4 The core is correctly refreshed ✔️
C5 The interface is correctly refreshed ✔️
C6 A project with enumerations must replicate them into core when loaded ✔️

Technical remarks

  • The declaration view must add a new button to declare enums
  • A new model for enumerations must be provided
  • The property panel must provide literal management
  • The property panel must provide storage type assignment

Menu

Menu

Sous menu

  • grossir la font
  • mettre plus de padding

View Menu

  • toogle => toggle
  • mettre une icône pour dire si c'est activé pour les toggles

Edit function parameters/returns

User story

As a user, I want to manage the parameters/returns of a function, in order to create custom behaviours.

Conditions of satisfaction

Condition Description Status
C1 A user is able to declare a variable into a function ✔️ :
C2 A user is able to define a declared variable as a parameter or return ✔️
C3 The core is correctly refreshed ✔️
C4 The interface is correctly refreshed ✔️
C5 A project that contains function must replicate parameters/returns to core

Technical remarks

  • When clicking to the function, the NodeCanvas is open and not the DeclarationView
  • Must provide parameters/returns managment into the property panel
  • When a parameter/return is added or removed from a function, all the CallFunction instructions must be updated

Abort on closing context in treeview

Description

The program crash when we close contexts in treeview

Reproduce

  • Open the test.dnaisolution file
  • Expand the following contexts in treeview: Test A*, context1, context1.1, class1.1
  • Reduce the contexts that you've open
  • Reopen Test A* context

Undo redo link/unlink

Problem

The instructions can be linked but, when we undo the action, the interface is not correctly refreshed

Start of solution

We have to connect the InstructionHandler::dataLinked/dataUnlinked/executionLinked/executionUnlinked signals in the nodecanvas and call views::GenericNode::createLink.

Declaration bug

Description

In the declaration process, I found (or maybe create) a bug that invalidate the tree view.

When you declare an entity without expanding any context, the tree view add an empty field at the end.

Reproduce the bug

First of all, you'll need to open the project test.dnaisolution.

baseview

Then, open the declaration view of the context context1

declarationview

Declare a new Context (green button) in the openned context.

after_declare

As you can see, a new blank line have been added to the tree-view.

The bug only occurs on if you didn't expand any context yet.

If you tries to expand the context1 in the tree view.

expand_context

And try to redeclare another Context.

add_expanded

As you can see, no blank items have been added to the tree view.

Even if we close the context1 from the tree view, the problem is not here.

readd_closed

Bug declaration view

If I load the test.dnaisolution and I click to open the class1 entity, I have the following message qrc:/resources/Views/DeclarationView.qml:176: TypeError: Cannot read property 'entityType' of null

It points to the following lines into the file resources/Views/DeclarationView.qml at the following line

AddButton {
    id: _addContext
    width: 45
    visible: modelData.parentRef.entityType === 0
    onPressed: {
        console.log(idx)
        console.log(modelData.listIndex)

        var name = proj.generateUniqueChildName(modelData.parentRef);

        proj.addEntityColumnUid(modelData.parentRef.id, name, modelData.listIndex)
        Controller.declarator.declare(modelData.parentRef.id, 0, name)
    }
}

The problem is in the line visible: modelData.parentRef.entityType === 0 where it says that modelData.parentRef is null.

If we look into the class Column, the function used to get the property modelData is the following one.

Entity* Column::parentRef() const
{
    if (m_entities.empty())
        return nullptr;
    return m_entities.first()->parentItem();
}

In the case where the column have no entities declared, the parentRef is null and can't be accessed in the QML. Indeed, the class1 entity have no children declared in it.

This issue is problematic because we use the modelData.id to declare an entity.

Serialization bug

Description

  1. Open a dnai project
  2. Then clic on a variable
  3. Set the variable type to boolean
  4. Save the project
  5. Exit dnai editor
  6. Open the save project
  7. Select the same variable
  8. Set variable type to integer
  9. Save project
  10. Exit dnai editor
  11. Open the save project
  12. clic on the same variable
  13. The Integer variable is set as a string "true" or "false" instead of 0

Edit Variable

User Story

As a user, I want to edit variable attributes, in order to have a consistent behaviour environment.

Conditions of satisfaction

Condition Description Status
C1 The user can choose the type of a variable ✔️
C2 The user can provide a default value to a variable ✔️
C3 The core variable states is correctly refreshed
C4 The interface is correctly refreshed ✔️
C5 A project with variables correctly set their attributes when loaded ✔️

Technical remarks

  • The QML view must call the right core controller method.
  • The core controller must emit a signal at the end of its action.
  • The signal must be catched by an object in order to edit the interface.
  • The property panel must be used to this feature.

[Core] Core command finder

Description

Each core command can fail.
We need to remove a core command that has failed from the CommandManager.
You can remove a core command from the CommandManager with its adress.
We can detect that a command has failed by the network communication between DNAI editor and the CoreDaemon.
We need a way to find the core command adresse that has failed in order to remove it.

Conditions of satisfaction

Condition Description
C1 Core commands are stored in a way we can easily find them
C2 Any handler can tell that a core command succeded
C3 Any handler can tell that a core command failed
C4 A core command that has failed must be removed from the CommandManager

Remove protobuf

When you have finished this task, i can start to fix the Travis Build :)

Edit function instructions

User story

As a user, I want to add instructions into a function, in order to create my own behaviour.

Conditions of satisfaction

Condition Description Status
C1 A user have access to a panel of instructions he can add ✔️
C2 A user can link instructions in the interface ✔️
C3 Core is correctly refreshed ✔️
C4 Interface is correctly refreshed ✔️
C5 A project with instructions must replicate them to core when loaded ✔️

Technical remarks

  • Big issue in the editor
  • The instruction instanciation must be provided by the core controller
  • The interface would only have to call controller method
  • An easy way to handle the system is to provide an any type from Core that is set into the GUI
  • The instruction to call a function must be created with the right input/output
  • Others instructions like operators are instanciated with any type
  • Instructions like getters/setters must be correctly handled

Settings theme

Settings pop-up that asks the theme to set into the GUI now always open when we launch the editor.

asktheme

The pop-up is not very beautiful and moreover, if I choose the light theme, there is no significant changes that appears in GUI.

light

nolight

Instead of sending time to fix this, better disable the pop-up and choose the dark theme by default.

[GUI] Editor crash when leaving

Conditions

To reproduce the bug :

  • Open the file test.dnaisolution
  • Click on a certain number of context/class (generally between 5 and 10)
  • Select the 2nd project
  • Leave the application by pressing the top right cross button
  • You'll notice the following message in Qt after few seconds : The process was ended forcefully.
    D:\EIP\Duly-GUI\build-DNAI-Desktop_Qt_5_10_1_MSVC2017_64bit-Release\app\release\DNAI.exe crashed.

[Core] Solution replication to CoreDaemon

Description

We can load .dnaiproject in the editor.
Once a project is loaded, it's vital to replicate it in the CoreDaemon in order to manipulates the AI.
Then we need mecanism that calls the right core commands to correctly replicate the entities.

Conditions of satisfaction

Condition Description
C1 Implementation of the Declare command
C2 System that automatically declare Entity children
C3 System that allows to create a project

[Core] Remove command on Command Manager

Description

Each core command can fail.
We can detect that a core command has failed by the network communication between the DNAI editor and the CoreDaemon.
When a command fail, we need to provide a system that removes it from the CommandManager in order to prevent the undo and redo to use them.

Condition of satifsaction :

Condition Description
C1 Any object can remove a command from its adress in the CommandManager

Vue Contexte ect...

Rendre toute la zone clickable (voir image)
Aujourd'hui comme ça :
capture d ecran 2018-02-22 a 11 35 37

Je pense que c'est plus intuitif si la partie clicable est :
newclicable

A discuter

Add dialogBox

Add dialog to confirm suppression operation or warning closing without saving for exemple

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.