sketchucation logo sketchucation
    • Login
    1. Home
    2. ArunYoganandan
    3. Posts
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
    A
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 11
    • Posts 38
    • Groups 1

    Posts

    Recent Best Controversial
    • Texture overlay on selection

      Hi All,

      This is kind of a tricky question. When a face of a group is selected by double clicking, the rest of the groups or objects in the world get an overlay on them that renders their textures not viewable. Here is a screenshot to show what I'm talking about

      https://lh5.googleusercontent.com/-8RFlZrPcpNY/UHYTA9HPWmI/AAAAAAAAAZg/0n0onMVt_lc/s1440/Screen%2520Captures.jpg

      As shown, the wood texture on the cylinder goes away on selecting the face of the box. Is there a way to prevent this from happening on specific objects?

      I'm building an immersive version of sketchup that features floating 3D menus. these menus are 3D objects with textures on them for icons. When this kind of a selection is done for a face, the textures on these menus go blank making them useless. If there is a specific way to turn off this feature on objects, that would be immensely helpful. Thanks in advance for your help.

      Arun

      posted in Developers' Forum
      A
      ArunYoganandan
    • RE: Color interpolation across a face

      Thanks everyone for the replies.

      @Dan using the draw in a tool's view method looks like a plausible option. Let me dig into it and get back.

      Thanks again.

      posted in Developers' Forum
      A
      ArunYoganandan
    • RE: Color interpolation across a face

      @dan rathbun said:

      You might use THAT image as a material applied to the face. Then adjust the corners of the material image to the face's vertices. ??

      Hi Dan,

      Thanks for your reply. What I'm trying to do is build a sliceable color cube like
      http://www.sonycsl.co.jp/person/nielsen/visualcomputing/programs/colorcube-1.png
      This is an immersive system and the user would be able to grab a corner and move it within the original cube's dimensions in 3D to
      indicate the color desired. i.e, position 0.4,0.1,0.3 within the cube will denote the corresponding RGB values.
      When the corner is moved, the faces will also correspondingly change in shape/fragment (Exactly like how it would behave when the vertex of a cube is moved in sketchup)
      revealing new colors at the depth (like slicing a volume with interpolated colors).

      Simply put, the faces of the cube get modified to different configurations and hence I will not be able to use a static texture. Something like a GLSL shader would be perfect except I don't think we could do that in SU?

      Thanks,
      Arun

      posted in Developers' Forum
      A
      ArunYoganandan
    • Color interpolation across a face

      Hello all,

      Is there a way to set up the color for each vertex in a face and let the color of the face be the interpolated value?

      This is a pretty common thing in openGL. For eg. in OpenGL, you could set the color array to

      float[] colors = { 
                      1f, 0f, 0f, 1f, // vertex 0 red
                      0f, 1f, 0f, 1f, // vertex 1 green
                      0f, 0f, 1f, 1f, // vertex 2 blue
                      1f, 0f, 1f, 1f, // vertex 3 magenta
              };
      

      across a square and you would get an image like
      http://blog.uncle.se/wp-content/uploads/2012/02/02_SmoothColoring.png

      Is there a way to do something like that programmatically in Sketchup? I'm only able find ways to set the color of the whole face.

      Thanks in advance.
      Arun

      posted in Developers' Forum
      A
      ArunYoganandan
    • RE: Getting the status bar text

      Hmm...
      Thanks Tom!

      @thomthom said:

      No API.

      You might be able to use Win32 under Windows - but I have no idea for OSX.

      posted in Developers' Forum
      A
      ArunYoganandan
    • Getting the status bar text

      Hi All,

      Is there a way to find out the current text being displayed in the status bar?
      My application is an Immersive Environment and SU's status bar does not show up.
      I plan to grab this text and set it up as 3D text in the scene.
      I'm able to see how to set it, but no method to get the status.
      Thanks in advance!

      Arun

      posted in Developers' Forum
      A
      ArunYoganandan
    • RE: Creating components from existing objects

      @sdmitch said:

      There is always a way but at what cost. The code would no doubt expand from 3 lines to 3000.

      I'm on a framerate sensitive medium, so anything I can do to improve frame rate would be useful. It would be great if you have any tips on how to set the LOD for the miniature.

      posted in Developers' Forum
      A
      ArunYoganandan
    • RE: Creating components from existing objects

      @dan rathbun said:

      You might play with the Fog settings. Adjust the near and far clipping planes. (But this is really not LOD.)

      Thanks Dan. Will give that a try

      posted in Developers' Forum
      A
      ArunYoganandan
    • RE: Creating components from existing objects

      @tig said:

      Beware... if ents is model.entities and that's not the current 'active_entities' context then ents.add_group(ents.to_a) or ents.add_group(model.selection.to_a) etc will Bugsplat!

      So... always ensure that the ents=model.**active_**entities and the objects you are trying to add to the new group are in the same context - hence the recommendation for 'selection' because the user can't manually select things that are not in the current active context...

      TIG thanks. Will keep that in mind

      posted in Developers' Forum
      A
      ArunYoganandan
    • RE: Creating components from existing objects

      Another question on a related note.

      Is there a way to set the Level Of Detail on the miniature component instance alone?
      It seems to be affecting performance with large models like castles and for the size at which I'm rendering the miniature, I couldn't care if its quality went down

      posted in Developers' Forum
      A
      ArunYoganandan
    • RE: Creating components from existing objects

      @sdmitch said:

      This seems to work.

      mod = Sketchup.active_model
      > ent = mod.entities
      > sel = mod.selection
      > 
      > wgrp=ent.add_group ent.to_a #create a group containing all existing entities
      > wcmp=wgrp.to_component #convert the group to a component/instance.
      > wcmp.definition.name="World" #give it a name
      > 
      

      Ahhh! group to component! Thank you so much 😍

      posted in Developers' Forum
      A
      ArunYoganandan
    • RE: Creating components from existing objects

      @thomthom said:

      Are your script also generating the geometry you want to place in the component? If so, then you should just add it directly to the component definition.

      Hi Tom,

      The geometries are generated by the users as they go along. I'm trying to make this a tool so as and when the user switches to the tool, all of the currently existing models (except certain objects) become part of the miniature view

      posted in Developers' Forum
      A
      ArunYoganandan
    • Creating components from existing objects

      Hello,

      I'm trying to do a world-in-miniature kind of concept, whereby I'm taking all existing entities in the world and make it into a component. At a later point, the plan is to make an instance of it.

      The part I'm having trouble is adding existing entities into the component definition. My components are showing up empty irrespective of how I add the existing entities. Any help would be greatly appreciated.

      Here is my trial code

      
      list = Sketchup.active_model.definitions
      world_def = list.add "World"
      world_def.description = "This is all of the world."
      ents = world_def.entities
      
      
      Sketchup.active_model.entities.each{ 
      |x|
      	if(x.class == Sketchup;;Group)
      		ents.add_group x
      	end
      }
      
      
      # Create the extrusion and save the definition
      comp_path = Sketchup.find_support_file "Components", ""
      world_def.save_as comp_path + "/candle.skp"
      
      t1=  Geom;;Transformation.translation Geom;;Point3d.new(0,100,0)
      inst1 = Sketchup.active_model.entities.add_instance world_def, t1
      
      
      
      

      Thanks in advance
      Arun

      posted in Developers' Forum
      A
      ArunYoganandan
    • RE: Vertical anchoring of 3D text

      @tig said:

      The text-string affects the result.
      "V\nE\nR\nT\nI\nC\nA\nL"

      V
      E
      R
      T
      I
      C
      A
      L

      That did it! thank you so much!

      posted in Developers' Forum
      A
      ArunYoganandan
    • RE: Vertical anchoring of 3D text

      @tig said:

      Via the API 3dText is always made at the origin, at the bottom-left corner of its bounding box.
      If you want to control its location make an empty group, add the 3dText to its entities collection rather than the model's entities, then transform that group to the required location or rotation etc...

      TIG thanks for your reply. There might be some misunderstanding in the way I state my question. I would like to anchor the text vertically,i.e stack up the alphabets one over the other
      rather than have the side-by-side text rotated 90 degrees to become vertical. If I rotate as a group, the text will end up sideways but I want them to be upright. Hope My explanation is clear.

      posted in Developers' Forum
      A
      ArunYoganandan
    • Vertical anchoring of 3D text

      Hello,

      Is there a way in the API to vertically anchor 3D text?
      http://support.google.com/sketchup/bin/answer.py?hl=en&answer=95665
      This page here (at the bottom) defines how to do it for 2D text, but I couldn't find a way to do the same for 3D text via the API.

      Thanks,
      Arun Yoganandan

      posted in Developers' Forum
      A
      ArunYoganandan
    • RE: Modifying or extending SU native tools

      Sorry guys about the double post. After my first post, I wasn't sure if it went through. Now I understand.

      I'm going to play around with the toolsobserver to see if it can help me and get back. Thanks for your help!

      posted in Developers' Forum
      A
      ArunYoganandan
    • Modifying or extending SU native tools

      Is there a way to extend/modify SU's native tools? like access the native tool's callbacks or methods. Or even inherit them to override or add to their behavior?

      like

      <span class="syntaxdefault"></span><span class="syntaxkeyword">class&nbsp;</span><span class="syntaxdefault">MySelectionTool&nbsp;</span><span class="syntaxkeyword"><&nbsp;</span><span class="syntaxdefault">SelectionTool<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;def&nbsp;initialize</span><span class="syntaxkeyword">()<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="syntaxdefault">super</span><span class="syntaxkeyword">()<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="syntaxdefault">end<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;def&nbsp;draw</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">view</span><span class="syntaxkeyword">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="syntaxcomment">#&nbsp;Do&nbsp;my&nbsp;own&nbsp;thing&nbsp;here..<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="syntaxdefault">end<br /><br />end</span>
      

      Any suggestions or insight would be appreciated.

      Thanks
      Arun

      posted in Developers' Forum
      A
      ArunYoganandan
    • 1 / 1