Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Where can I find a list of all available scene-node properties/attributes please? For example: how would I adjust the 'alpha' transparency of a scene-node, using: ccbSetSceneNodeProperty? Thanks. |
||||
|
Read the documentation. You can change the alpha of a 2D Overlay with ccbSetSceneNodeProperty. For 3D nodes see: ccbSetSceneNodeMaterialProperty. |
||||
|
Thanks for your comment but it's not helpful at all. Yeah, I did read the docs, it doesn't explain how to adjust transparency and the docs do not contain a complete list of properties and attributes. So unless one already knows how to code (which I don't) the docs don't contain enough information for me to be able to do what I want without reaching out to the forum. Here's what the docs say. Maybe you understand it better than me but you seem unwilling to help. ccbSetSceneNodeMaterialProperty(sceneNode, materialIndex, propertyName, value) Sets the property of the material of a scene node. Parameters: sceneNode: A scene node. materialIndex: The index of the material. Must be a value greater or equal 0 and smaller than ccbGetSceneNodeMaterialCount(). propertyName: The propertyName in a material. Can be 'Type', 'Texture1', 'Texture2', 'Lighting', 'Backfaceculling'. See below. value: New value of the material property Possible material parameters are: Parameter name Possible values Type "solid", "lightmap", "lightmap_add", "lightmap_m2", "lightmap_m4", "reflection_2layer", "trans_add", "trans_alphach", "trans_reflection_2layer" Texture1 A texture for texture layer 1 Texture2 A texture for texture layer 2 Lighting true or false to enable or disable dynamic lighting Backfaceculling true or false to enable or disable backface culling Also, if you are writing a plugin for the editor, there are some advanced properties available: "Type", "Ambient", "Diffuse", "Emissive", "Specular", "Shininess", "Param1", "Param2", "Texture1", "Texture2", "Texture3", "Texture4", "Wireframe", "GouraudShading", "Lighting", "ZBuffer", "ZWriteEnable", "BackfaceCulling", "BilinearFilter", "TrilinearFilter", "AnisotropicFilter", "FogEnable", "NormalizeNormals". Example: var s = ccbGetSceneNodeFromName("cubeMesh1"); ccbSetSceneNodeMaterialProperty(s, 0, "Lighting", true); Makes a node with the name 'cubeMesh1' to use dynamic light. Example 2: var node = ccbGetSceneNodeFromName("cubeMesh1"); var tex = ccbLoadTexture("example.jpg"); ccbSetSceneNodeMaterialProperty(node, 0, "Texture1", tex); Loads a texture and sets it as material onto an object name 'cubeMesh1'. ccbSetSceneNodeProperty(sceneNode, propertyName, r, g, b) Sets the property value of a scene node. The propertyName is also the name displayed in the property window of the editor in the left column. Possible names depend on the scene node type, but usually names like 'Name',?'Position', 'Rotation', 'Scale', and 'Visible' are available at least. Please note that the name is case sensitive. When setting a vector, you can use x,y,z parameters, or a vector3d object. For colors, you can use a single int or 3 RGB values like 255,128,0. For animated scene nodes, Properties like 'Animation', 'Looping', 'FramesPerSecond' 'AnimationBlending', and 'BlendTimeMs' are available. For camera nodes, Properties like 'Target', 'UpVector', 'AspectRatio' and 'FieldOfView_Degrees' are available. For 2D overlay nodes, Properties like the following are available: 'Pos X (percent)', 'Pos Y (percent)', 'Width (percent)', 'Height (percent)', 'Pos X (pixels)', 'Pos Y (pixels)', 'Width (pixels)', 'Height (pixels)', 'Alpha', 'Image', 'Background Color', 'Draw Text', 'TextColor', 'Text'. For light nodes, Properties like 'Radius' (for point lights), 'Color', and 'Direction' (for directional lights) are available. For the root scene node, you can use "FogColor", "Realtime Shadows" (to enable/disable shadow mapping), "AmbientLight", and |
||||
|
I answered your question so I don't understand what you mean by saying I don't seem to want to help you. The code below applies additive (fake) transparency to the node. You can also apply an alpha texture to the node first and then set Type to "trans_alphach" for true alpha. var cube = ccbGetSceneNodeFromName("cubeMesh1"); If you want to fade the node over time then you need to use a shader like the one on JIC's website. |
||||
|
or use "trans_vertex_alpha_and_channel" for make it more transparency, you right, lot of properties is not shown in documentation but all them you can find in editor |
||||
|
but if you look at all property in editor you ain't find property for transparency of node, so if you need change transparent by value (like for 2d node) you need write custom shader |
||||
|
Thank you Guest - yes, that makes sense. I was getting frustrated, trying to fade it over time. I've found the fade node shader/plugin by JIC you mentioned - I'll probably just use that instead. Thank you SamGrady - Ah, I see it now in the Editor window for each node! That will make things much easier for me now - I honestly hadn't noticed that they were the same Property/Attribute names you can use in coding/API, lol. Nice one. Thanks, you;re both shining stars. |
|