entity component system – ECS multiple materials per mesh (sub-mesh)

In my toy engine I currently have a MeshComponent and a MaterialComponent.

psuedo:

struct MeshComponent
{
    Ptr<Mesh> Mesh;
};

struct MaterialComponent
{
    Ptr<Texture> DiffuseTexture;
    Ptr<Texture> NormalsTexture;
};

This is fine, for when a single mesh uses a single material.

pseudo:

Entity entity = CreateEntity();
AddComponentToEntity(entity, meshComponent);
AddComponentToEntity(entity, materialComponent);

But now I want to consider the concept of “sub-meshes” (regions of a mesh that are rendered with a different material, but each sub-mesh shares the parent vertex list). I don’t want my Mesh class to know anything about materials, and vice-versa.

What good approaches are there for “joining” multiple MaterialComponent to a single MeshComponent?

I’ve considered having an entity for each sub-mesh, but that seems brittle (not to mention overkill, as I’m only interested in MaterialComponents).

pseudo:

struct MeshComponent
{
    Ptr<Mesh> Mesh;
    std::vector<Entity> SubMeshEntities; // Would need to ensure the indices match those of the sub-meshes
};

What other approaches are there?

magento2 – WYSIWYG Editor Issue in UI Component multi row not working

I have created dynamic rows with multiple descriptions filed(1 In a row) with the WYSIWYG editor.

Editor showing and working with first one-row element and rest element which added by adding more it’s not working.

I have added a dynamic row by below code

<dynamicRows name="dynamic_rows">
    <settings>
        <addButtonLabel translate="true">Add More</addButtonLabel>
        <additionalClasses>
            <class name="admin__field-wide">true</class>
        </additionalClasses>
        <componentType>dynamicRows</componentType>
    </settings>
    <container name="record" component="Magento_Ui/js/dynamic-rows/record">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="isTemplate" xsi:type="boolean">true</item>
                <item name="is_collection" xsi:type="boolean">true</item>
                <item name="componentType" xsi:type="string">container</item>
            </item>
        </argument>
        <field name="category_description" formElement="wysiwyg" sortOrder="40">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="wysiwygConfigData" xsi:type="array">
                        <item name="height" xsi:type="string">100px</item>
                        <item name="add_variables" xsi:type="boolean">false</item>
                        <item name="add_widgets" xsi:type="boolean">false</item>
                        <item name="add_images" xsi:type="boolean">false</item>
                        <item name="add_directives" xsi:type="boolean">false</item>
                    </item>
                    <item name="source" xsi:type="string">sun_brand</item>
                </item>
            </argument>
            <settings>
                <validation>
                    <rule name="required-entry" xsi:type="boolean">true</rule>
                </validation>
                <label translate="true">Description</label>
                <dataScope>description</dataScope>
            </settings>
            <formElements>
                <wysiwyg class="MagentoUiComponentFormElementWysiwyg">
                    <settings>
                        <rows>8</rows>
                        <wysiwyg>true</wysiwyg>
                    </settings>
                </wysiwyg>
            </formElements>
        </field>
        <actionDelete sortOrder="50">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="componentType" xsi:type="string">actionDelete</item>
                    <item name="dataType" xsi:type="string">text</item>
                    <item name="fit" xsi:type="boolean">false</item>
                    <item name="label" xsi:type="string">Actions</item>
                    <item name="additionalClasses" xsi:type="string">data-grid-actions-cell</item>
                    <item name="template" xsi:type="string">Magento_Backend/dynamic-rows/cells/action-delete</item>
                </item>
            </argument>
        </actionDelete>
    </container>
</dynamicRows>

and it’s showing like this.
enter image description here

But show/hide button not working, when we add two rows it’s working perfectly with a single row

reactjs – How to re execute componentDidMount again when i click the component again?

enter image description here

This is my top navbar of my project and
enter image description here

when i click on blogs button list of all blogs will rendered and in this component i have a search option now when i have search text let’s say “vue” then i will get the required result

handleSubmit = values => {
    const { size } = this.state;
    this.setState({ searchString: values.searchString, isSearch: true });
    SearchSchema.searchString = this.state.searchString;
    this.props.history.push(`/blogs?q=${values.searchString}`);
    this.props.actions.loadBlogs({ page: 0, size, searchString: values.searchString });
  };

and this is componentDidMount of Blog Component

componentDidMount = () => {
    const { size } = this.state;
    const params = new URLSearchParams(this.props.location.search);
    const q = params.get('q');
    if (q) {
      this.setState({ searchString: q, isSearch: true });
      this.props.actions.loadBlogs({ page: 0, searchString: q, size });
    } else {
      this.setState({ searchString: '', isSearch: false });
      this.props.actions.loadBlogs({ page: 0, size });
    }
  };

After getting the result when i again clicked on Blogs from Top Navbar (in screenshot) url is getting changed but not getting all the blogs

<Link className="nav-link" to="/blogs">
            Blogs
          </Link>

enter image description here

screenshot with search result and url will be http://localhost:8075/blogs?q=vue
same screenshot is also applicable when i clicked blogs button again url is getting changed but blogs is not updated http://localhost:8075/blogs

reactjs – Sharing React Native Component as a “black box”

Looking for a way to share a react native component with 3rd parties without having to share the actual source code.

Something like a .jar in java or a .dll for C#.

Is this possible?

Ideally i want others to be able to

import CustomComponent from '...myCustomComponent';

but not being able to look in the actual code.

Any thoughts are welcome.

reactjs – React Bootstrap component (Form.Control) OnChange event listener doesn’t fire when select all text and delete

I am using Form.Control in form , and when changing the input , I use onChange event listener, to handle the change
as in this snapshot :

<Form.Control
      className="form-control"
      type="text"
      id={props.id}
      defaultValue={props.placeholder}
      onChange={(e) => {
        updateInput(e);
      }}
></Form.Control>

all changes work fine , adding chars , deleting ,,etc ,
But when => Select ALL text and hit backspace , onChange event Listener , isn’t fired !
ps : selecting part of the text and deleting it , fires the onChange .

data structures – find the strong component containing the vertex v

data structures – find the strong component containing the vertex v – Computer Science Stack Exchange

pathfinder 1e – Inquisitors Kit, why does it have a spell component pouch?

According to the SRD on magic:

If the Components line includes F/DF or M/DF, the arcane version of the spell has a focus component or a material component (the abbreviation before the slash) and the divine version has a divine focus component (the abbreviation after the slash).

So it is not an universal rule that all divine spells can substitute material components for divine focus. Spells that require material components only, without such substitution, may exist. And indeed, True Strike requires a small wooden replica of an archery target focus, that cannot be substituted for divine focus, and Force Anchor requires a twisted nail material component, again with no “/DF” on the list.

angular – Passar objeto do template para o component com ngModel

Tenho este formulário no template:

Nome: <input type="text" ((ngModel))="usuario.nome">
Fone: <input type="text" ((ngModel))="usuario.fone" >
UF: <input type="text" ((ngModel))="usuario.uf" >
<button (click)="gravar(usuario)">Gravar</button>

preciso que o usuario do meu .ts seja populado com esses inputs:

usuario!: Usuario;

gravar(usuario: Usuario){
alert(this.usuario.nome);
}

Como eu faço isso? desde já agradeço!

Is there a better way for this ui component?

I need to create a component for displaying a list of avatar users….If the users present in the array is more then 3 I have to display a number to indicate the remaining amount of users.

Example:

({id:1, name: 'Paul', surname: 'Rudd'}, {id:2, name: 'Rose', surname: 'Pink'}, {id:3, name: 'Richard', surname: 'Gere'}, {id:4, name: 'Anna', surname: 'Ross'}, {id:5, name: 'Raphael', surname: 'Bublè'},{id:6, name: 'Gene', surname: 'Hoffman'},{id:7, name: 'Anthony', surname: 'Florence'})

I have to see 3 avatar images with the first letter of name and surname:

PR, RP, RG 4+

This is my component:

    @Component({
      selector: 'mgg-users-detail',
      templateUrl: './users-detail.component.html',
      styleUrls: ('./users-detail.component.scss'),
    })

    export interface users {
      id: number;
      name: string;
      surname: string;
    }
    export class UsersDetailComponent implements OnInit {
      @Input()
      collaborators: users()
        
      constructor() {}

      ngOnInit(): void {}

    }

and this is the html:

    <div *ngIf="users && users.length > 1">
        <div *ngFor="let user of users; index as i">
          <img
            *ngIf="i <= 2"
            (src)="'https://dummyimage.com/50x50/6ECFDB/fff&text=' + collaborator.name(0) + collaborator.surname(0)"
          ></img>
        </div>
        <img
          *ngIf="users.length > 3"
          (src)="'https://dummyimage.com/50x50/6ECFDB/fff&text=' + (users.length - 3)"
        >
        </img>
    </div>

Can I improve the code in other way?

How can I make sure that a component gets destroyed the last out of all components attached to an object in Unity?

How can I make sure that a component gets destroyed the last out of all components attached to an object in Unity?

I have a component with some scripts on it: Script1 and Script2. Inside the Script2.OnDestroy method I have the following line of code: GetComponentInParent<Script1>().

I want that line of code to return Script1 whenever I click the Play button inside Unity editor to stop my game. While right now it returns null.

DreamProxies - Cheapest USA Elite Private Proxies 100 Private Proxies 200 Private Proxies 400 Private Proxies 1000 Private Proxies 2000 Private Proxies ExtraProxies.com - Buy Cheap Private Proxies Buy 50 Private Proxies Buy 100 Private Proxies Buy 200 Private Proxies Buy 500 Private Proxies Buy 1000 Private Proxies Buy 2000 Private Proxies ProxiesLive Proxies-free.com New Proxy Lists Every Day Proxies123