grasshopper3d / GrasshopperDocsSite

Documentation for open source components of Rhino and Grasshopper
33 stars 3 forks source link

Missing Component in Wallacei add on #4

Closed miladshowkatbakhsh closed 4 years ago

miladshowkatbakhsh commented 4 years ago

First of all, thank you for this, This is incredible. I noticed that a couple of components are missing in Wallacei addon (.gha). The ones that are listed here are the user objects (Analytics components). Wallacei plugin has both user objects and .gha. Components like Wallacei X (this is the solver) Shuffler GDecoder PDecoder and Distributer are missing. Here is the link of the plugin. I also attached an image for your reference. Wallacei

Best, Milad

robinrodricks commented 4 years ago

Your addon is obfuscated and fails to load in my indexer. Maybe if you can provide a non-obfuscated addon GHA, those additional components can be read.

karakasa commented 4 years ago

Your addon is obfuscated and fails to load in my indexer. Maybe if you can provide a non-obfuscated addon GHA, those additional components can be read.

Is your indexer an offline (analyze the assembly without GH) or online (analyze in a GH env) one? Recently I changed the component infrastructure of Pancake to support localization. It will be sort of like what Elefront has done: individual component classes <- PancakeComponent <- GH_Component. And components' names, descriptions, parameter names, descriptions, etc are read on the fly (during initialization of individual component classes). The code will be like:

public PancakeComponent() : base(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty)
        {
            var type = GetType();

            while (type != typeof(PancakeComponent))
            {
                ReadAttributes(type);
                type = type.BaseType;
            }

            if (_subPanelIndex == -1)
                Debug.WriteLine("missing: " + GetType().Name + " no subpanel info.");

            RefreshLocalizationAppearance(); // Read names, descriptions, parameter identifiers, and load localized strings from resources
            SaveCurrentLangIfNot();
        }

public void RefreshLocalizationAppearance()
        {
            CopyFrom(new GH_InstanceDescription(DisplayName,
                LocalizedNickname, DisplayDescription, CategoryName, _sectionName));
        }

public string DisplayName => LocalizationHelper.GetDisplayName(this);
        public string DisplayDescription => LocalizationHelper.GetDisplayDescription(this);

I am not quite sure if your indexer can process this.

robinrodricks commented 4 years ago

I support both modes. But whenever I try loading Wallacei add-on into my application as an add-on (and using reflection to instantiate classes) then my entire app hangs, so I'm forced to read the add-on in offline mode and that doesn't work very coz your add-on is obfuscated.

I'll send you the json schema and you can enter in the details manually. At least that way we'll be able to get your add-on into the GH site.

karakasa commented 4 years ago

But whenever I try loading your add-on into my application as an add-on (and using reflection to instantiate classes) then my entire app hangs, so I'm forced to read the add-on in offline mode and that doesn't work very coz your add-on is obfuscated.

It's weird because my plugin is never obfuscated. I don't like doing that. Have you filtered out abstract classes? I can see the base component class, which is defined abstract, listed separately in the docs.

Anyway, let me deal with the JSON and really thanks for your effort!

public abstract class pcNativeExport : GH_Component
{
    public override GH_Exposure Exposure => IsRhinoSupported() ? GH_Exposure.primary : GH_Exposure.hidden;

    public pcNativeExport(string formatName)
        : base("Export " + formatName, "pcExport" + formatName, "This component exports geometries from GH to " + formatName + " file directly\r\nThis component doesn't rely on Export command.", "Pancake", "I/O")
    {
    }
...
robinrodricks commented 4 years ago

I was saying that Wallacei add on was obfuscated. Please add another github issue for your addon as I'm not sure what the issue is.

@karakasa I index all classes that extend from GH_Component. I have no way of knowing its a base class. If you tell me I can filter it out.

robinrodricks commented 4 years ago

@miladshowkatbakhsh All issues fixed.

http://grasshopperdocs.com/addons/wallacei.html