Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add properties and name to all scene items #92

Open
BraindeadBZH opened this issue Jan 27, 2013 · 1 comment
Open

Add properties and name to all scene items #92

BraindeadBZH opened this issue Jan 27, 2013 · 1 comment

Comments

@BraindeadBZH
Copy link

Hi,

It would be great that every items in the scene have the properties and name member, like SceneObject. Camera is missing the properties member. Light is missing both name and properties.

Thanks.

@BraindeadBZH
Copy link
Author

The modification for Light:

if (typeof (light_type) == 'object') {
    // ...
    this.name = (light_type.name === undef) ? ((name !== undef) ? name : null) : light_type.name;
    this.properties = base.get(light_type.properties)||{};
} else {
    // ...
    this.name = "light" + this.light_type;
    this.properties = {};
}

The modification for Camera:

if (typeof (width) == 'object') {
    // ...
    this.properties = base.get(obj_init.properties)||{};

    height = obj_init.height ? obj_init.height : undef;
    width = obj_init.width ? obj_init.width : undef;
} else {
    // ...
    this.properties = {};
}

Its particularly useful when you construct your scene from JSON file and you have to interact with the items.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant