Giter Site home page Giter Site logo

justint / usd-idea Goto Github PK

View Code? Open in Web Editor NEW
51.0 8.0 4.0 452 KB

Universal Scene Description (USD) plugin for JetBrains IDEs (PyCharm, CLion, etc...)

License: MIT License

Java 75.68% Lex 22.11% HTML 2.21%
usd vfx pycharm plugin universal-scene-description computer-graphics pixar clion

usd-idea's People

Contributors

justint avatar latios96 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

usd-idea's Issues

Add support for binary USD files

If a user tries to open a binary usd file, PyCharm will read the binary data as-is which isn't helpful.

Instead, the plug-in should be converting the binary data to ASCII whenever a binary file is opened, and converted back whenever the user saves the file (essentially mimicking what usdedit does).

This can likely be done using the VirtualFile system, I'll have to do further investigations on how to implement this functionality.

Add build instructions for language changes

Expanding on #6, I should add instructions to the README on how to re-generate the parser code, *.flex files, and use the JFlex generator to generate the code in src/main/gen. This knowledge is required to see changes in the built plug-in when making changes to the lexers/grammar definitions.

PSI breaks on any parser error

If the plugin's language parser fails at any point while reading a file, the file's PSI structure breaks which stops any dependent integrations (structure view, code folding, etc) from working. Ideally, the language definition should be as good as possible to avoid this, but I imagine I'll be continually tinkering on the language definition forever, especially if/when language changes come in the future.

The language definition should be updated to support recovering after any failures. How recovery works is defined in the Grammer-Kit: tutorial, how-to. This would ensure parsing failures would be less likely to cause other integrations to stop working.

Error displayed on .connect token.

Here's a sample usda (nothing functional, just a stripped back example) using the 0.2.2 version of the plugin.

The first connection shows an error saying it expects it to be named alpha instead of connect.
.connect however is valid. This error also stops on the first instance, but not any others.

#usda 1.0

def "Foo"
{
    def "MyShader"
    {
        token outputa.connect = </path>
        token outputb.connect = </path>
    }
}

image

Also great work!

Integrate CI

JetBrains has set up a really clean plugin template repository that includes pre-integrated GitHub Actions for building, verifying, testing, and releasing your plugin. It'd be neat if some or all of these Actions were added to usd-idea.

new build for Marketplace with 2021 support?

There are recent commits that seem to indicate support for the 2021.1+ JetBrain IDEs, but a new build hasn't been made for the Marketplace. Is this support ready to go and buildable, or is more work needed? I like to use this in my PyCharm 2021.1.1 setup.

Fix deprecated code

Since v0.2.3:

  • com/justint/usdidea/codeinsight/folding/USDFoldingBuilder.java
    • [deprecation] NamedFoldingDescriptor in com.intellij.lang.folding has been deprecated
  • com/justint/usdidea/file/USDFileTypeFactory.java
    • [deprecation] FileTypeFactory in com.intellij.openapi.fileTypes has been deprecated
  • com/justint/usdidea/codeinsight/highlighting/USDSyntaxHighlighter.java 
    • [deprecation] newHashMap() in ContainerUtil has been deprecated where K,V are type-variables: K extends Object declared in method newHashMap() V extends Object declared in method newHashMap()
  • com/justint/usdidea/lang/parser/USDParserDefinition.java 
    • [deprecation] spaceExistanceTypeBetweenTokens(ASTNode,ASTNode) in ParserDefinition has been deprecated

Structure View supported objects

Structure View should support displaying more types of USD objects, since the first iteration only supports prims and attribute properties. Here's a general list of objects that should eventually all be supported:

  • classes
  • dictionaries
  • metadata
  • variant
  • variantSet

Plug-in icons

The plug-in could use some nicely designed icons to maintain a consistent and usable interface. The icon designs should follow the JetBrains UI design guidelines.

Here are some plug-in features that could benefit from icons:

  • USD Filetype (already exists but needs to be updated)
  • Structure view
    • Prims (now using PlatformIcons.PARAMETER_ICON)
    • Classes (now using PlatformIcons.CLASS_ICON)
    • Metadata (now using PlatformIcons.METHOD_ICON)
    • Properties
      • Attributes (now using PlatformIcons.PROPERTY_ICON)
      • Relationships
      • timeSampled properties - these could probably be marked italic and have some layered icon, like a clock or something to indicate that it's a timeSample
    • VariantSets
  • Line marker provider
    • Over specifiers

Branch product for older platform versions

Since this plug-in's v0.4 release, major platform version compatibility issues have come up with versions prior to 191.* (2019.1). There's a notable quantity & variety of issues (new interfaces/classes/methods aren't available in older platform versions, migration to Java 11 in 203) that justify branching this product for older versions of the platform.

I've created a new branch 191.8026.42 to target the latest platform version with compatibility issues (2019.1). This branch will be built using an earlier version of Java and should be maintained with the intention of supporting all pre-2019.2 versions (for now, until I find more compatibility issues between versions below 191 that warrant another branching).

I've delayed the release of v0.4 until I can get both >2019.1 (master) and <2019.1 (191.8026.42) versions of the plugin functionally identical and stable.

Add hyperlinking for references

Asset/path references in USD files are currently colored blue and underlined, giving the impression that they are hyperlinks. Right now no linking behavior is implemented, but it would be great if one could Ctrl+Click on one and have the editor jump to the referenced path.


To implement this I'll need to define a Reference Contributor, which will provide the ability for the plug-in to jump from the usage of an element to its declaration. Implementing this in turn will open the door for getting the "Find usages"/"Refactor"/"Rename" functions available.

To define the reference element's "origin", I'll need to parse the reference path and identify which prim in the PSI tree it's referring to; if the reference also includes a path to an external usd file, I'll likely have to use usdresolve to find the path to the file (similar to how AnimalLogic's VSCode extension does it), parse its PSI tree, and then return the path to the prim in that file.

For defining references for overs or other structures that imply definition outside of the current file, that'll be a little more complicated. I'll likely need to teach the plug-in to check for reference definitions in the parent prim metadata and parse those referenced files' PSI trees for the def of the requested element.

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.